hyperglyph-codec 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. hyperglyph_codec-0.1.0/.gitattributes +2 -0
  2. hyperglyph_codec-0.1.0/.github/workflows/ci.yml +45 -0
  3. hyperglyph_codec-0.1.0/.github/workflows/publish-testpypi.yml +38 -0
  4. hyperglyph_codec-0.1.0/.github/workflows/publish.yml +38 -0
  5. hyperglyph_codec-0.1.0/.gitignore +12 -0
  6. hyperglyph_codec-0.1.0/.pre-commit-config.yaml +11 -0
  7. hyperglyph_codec-0.1.0/CHANGELOG.md +8 -0
  8. hyperglyph_codec-0.1.0/CONTRIBUTING.md +9 -0
  9. hyperglyph_codec-0.1.0/LICENSE +21 -0
  10. hyperglyph_codec-0.1.0/PKG-INFO +627 -0
  11. hyperglyph_codec-0.1.0/README.md +592 -0
  12. hyperglyph_codec-0.1.0/RELEASE.md +24 -0
  13. hyperglyph_codec-0.1.0/docs/algorithm.md +14 -0
  14. hyperglyph_codec-0.1.0/docs/api.md +18 -0
  15. hyperglyph_codec-0.1.0/docs/cli.md +33 -0
  16. hyperglyph_codec-0.1.0/docs/index.md +22 -0
  17. hyperglyph_codec-0.1.0/docs/roadmap.md +30 -0
  18. hyperglyph_codec-0.1.0/examples/compress_mlp.py +11 -0
  19. hyperglyph_codec-0.1.0/examples/compress_state_dict.py +10 -0
  20. hyperglyph_codec-0.1.0/examples/mnist_demo.py +11 -0
  21. hyperglyph_codec-0.1.0/hyperglyph.png +0 -0
  22. hyperglyph_codec-0.1.0/pyproject.toml +75 -0
  23. hyperglyph_codec-0.1.0/src/hyperglyph/__init__.py +19 -0
  24. hyperglyph_codec-0.1.0/src/hyperglyph/blocks.py +49 -0
  25. hyperglyph_codec-0.1.0/src/hyperglyph/cli.py +112 -0
  26. hyperglyph_codec-0.1.0/src/hyperglyph/codec.py +200 -0
  27. hyperglyph_codec-0.1.0/src/hyperglyph/config.py +37 -0
  28. hyperglyph_codec-0.1.0/src/hyperglyph/exceptions.py +9 -0
  29. hyperglyph_codec-0.1.0/src/hyperglyph/hdc.py +69 -0
  30. hyperglyph_codec-0.1.0/src/hyperglyph/metrics.py +60 -0
  31. hyperglyph_codec-0.1.0/src/hyperglyph/prototypes.py +60 -0
  32. hyperglyph_codec-0.1.0/src/hyperglyph/py.typed +0 -0
  33. hyperglyph_codec-0.1.0/src/hyperglyph/residual.py +49 -0
  34. hyperglyph_codec-0.1.0/src/hyperglyph/serialization.py +75 -0
  35. hyperglyph_codec-0.1.0/src/hyperglyph/torch_adapter.py +67 -0
  36. hyperglyph_codec-0.1.0/tests/test_blocks.py +44 -0
  37. hyperglyph_codec-0.1.0/tests/test_cli.py +22 -0
  38. hyperglyph_codec-0.1.0/tests/test_codec.py +41 -0
  39. hyperglyph_codec-0.1.0/tests/test_hdc.py +32 -0
  40. hyperglyph_codec-0.1.0/tests/test_prototypes.py +24 -0
  41. hyperglyph_codec-0.1.0/tests/test_residual.py +23 -0
  42. hyperglyph_codec-0.1.0/tests/test_serialization.py +38 -0
  43. hyperglyph_codec-0.1.0/tests/test_torch_adapter.py +19 -0
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
@@ -0,0 +1,45 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, dev]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+
13
+ strategy:
14
+ matrix:
15
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install package
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ python -m pip install -e ".[dev]"
28
+
29
+ - name: Ruff lint
30
+ run: ruff check .
31
+
32
+ - name: Ruff format check
33
+ run: ruff format --check .
34
+
35
+ - name: Type check
36
+ run: mypy src/hyperglyph
37
+
38
+ - name: Tests
39
+ run: pytest --cov=hyperglyph --cov-report=term-missing
40
+
41
+ - name: Build package
42
+ run: python -m build
43
+
44
+ - name: Check package
45
+ run: twine check dist/*
@@ -0,0 +1,38 @@
1
+ name: Publish to TestPyPI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ permissions:
7
+ contents: read
8
+ id-token: write
9
+
10
+ jobs:
11
+ publish-testpypi:
12
+ runs-on: ubuntu-latest
13
+ environment:
14
+ name: testpypi
15
+ url: https://test.pypi.org/p/hyperglyph-codec
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - uses: actions/setup-python@v5
21
+ with:
22
+ python-version: "3.12"
23
+
24
+ - name: Install build tools
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ python -m pip install build twine
28
+
29
+ - name: Build package
30
+ run: python -m build
31
+
32
+ - name: Check package
33
+ run: twine check dist/*
34
+
35
+ - name: Publish package distributions to TestPyPI
36
+ uses: pypa/gh-action-pypi-publish@release/v1
37
+ with:
38
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,38 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+ id-token: write
10
+
11
+ jobs:
12
+ publish:
13
+ name: Build and publish Python package
14
+ runs-on: ubuntu-latest
15
+ environment:
16
+ name: pypi
17
+ url: https://pypi.org/p/hyperglyph-codec
18
+
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+
22
+ - uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.12"
25
+
26
+ - name: Install build tools
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ python -m pip install build twine
30
+
31
+ - name: Build package
32
+ run: python -m build
33
+
34
+ - name: Check package
35
+ run: twine check dist/*
36
+
37
+ - name: Publish package distributions to PyPI
38
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,12 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ .pytest_cache/
5
+ .mypy_cache/
6
+ .ruff_cache/
7
+ .coverage
8
+ htmlcov/
9
+ dist/
10
+ build/
11
+ .venv/
12
+ venv/
@@ -0,0 +1,11 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.6.9
4
+ hooks:
5
+ - id: ruff
6
+ - id: ruff-format
7
+ - repo: https://github.com/pre-commit/pre-commit-hooks
8
+ rev: v4.6.0
9
+ hooks:
10
+ - id: trailing-whitespace
11
+ - id: end-of-file-fixer
@@ -0,0 +1,8 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0
4
+
5
+ - Initial public release.
6
+ - Added NumPy compression path.
7
+ - Added optional PyTorch adapter.
8
+ - Added CLI and .hwz serialization.
@@ -0,0 +1,9 @@
1
+ # Contributing
2
+
3
+ Contributions are welcome.
4
+
5
+ 1. Fork the repository.
6
+ 2. Create a branch for your change.
7
+ 3. Install dev dependencies.
8
+ 4. Run tests and linting.
9
+ 5. Submit a pull request.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Robert McMenemy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ACTION OF
20
+ CONTRACT, NEGLIGENCE OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.