feat(Init): Initial upload of array + interoperability package#1
Open
Simpag wants to merge 10 commits into
Open
feat(Init): Initial upload of array + interoperability package#1Simpag wants to merge 10 commits into
Simpag wants to merge 10 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Initial import of the decent_array package, providing an Array wrapper and a single-active-backend interoperability layer with NumPy/PyTorch/JAX/TensorFlow backends, plus CI, docs, benchmarks, and a comprehensive pytest suite.
Changes:
- Added backend manager + abstract backend contract, plus concrete backends (NumPy/PyTorch/JAX/TensorFlow) and module-level iop functions/RNG coordination.
- Added
Arraywrapper implementing operators, indexing, and common properties via the active backend. - Added tox/CI/Sphinx/ReadTheDocs scaffolding, benchmarks, and extensive tests.
Reviewed changes
Copilot reviewed 49 out of 52 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_iop_rng.py | Tests for RNG seeding, snapshot/restore, and distribution helpers. |
| tests/test_iop_functions.py | Tests for module-level interoperability functions (creation, math, linalg, indexing). |
| tests/test_decorators.py | Tests for the cost-method autodecorator argument unwrapping/rewrapping behavior. |
| tests/test_backend_manager.py | Tests backend activation, registration, listener behavior, and reset semantics. |
| tests/test_array.py | Tests Array operators/dunders, indexing, coercion, and properties across backends. |
| tests/conftest.py | Parametrized backend/device fixture with skip logic for unavailable combinations. |
| readthedocs.yaml | Read the Docs build configuration. |
| pyproject.toml | Project metadata, dependencies/extras, tox envs, ruff/mypy/pytest config, mypyc build hook. |
| LICENSE | Adds AGPL-3.0 license text. |
| docs/sphinx_theme.txt | Sphinx theme requirements list. |
| docs/source/user.rst | Initial user guide stub + installation snippet. |
| docs/source/index.rst | Sphinx landing page and toctree. |
| docs/source/developer.rst | Developer guide covering tox workflows, mypyc usage, and contribution process. |
| docs/source/conf.py | Sphinx configuration (theme, intersphinx, missing-reference fixups, sidebar config). |
| docs/source/background.rst | Background page stub. |
| docs/source/author.rst | Contributors page. |
| docs/source/api/decent_array.types.rst | API stub for decent_array.types. |
| docs/source/api/decent_array.rst | API toctree root. |
| docs/source/api/decent_array.interoperability.rst | API stub for decent_array.interoperability. |
| docs/source/api/decent_array.array.rst | API stub for decent_array (exports Array). |
| docs/source/_templates/package.rst.jinja | Custom sphinx-apidoc package template. |
| docs/source/_templates/module.rst.jinja | Custom sphinx-apidoc module template. |
| docs/source/_static/custom.css | Small theme CSS tweak for logo sizing. |
| docs/Makefile | Sphinx Makefile (unix). |
| docs/make.bat | Sphinx make script (windows). |
| decent_array/types.py | Shared type aliases + supported framework/device enums. |
| decent_array/interoperability/_tensorflow/tensorflow_backend.py | TensorFlow backend implementation + registration side-effect. |
| decent_array/interoperability/_tensorflow/init.py | TensorFlow backend package initializer/export. |
| decent_array/interoperability/_pytorch/pytorch_backend.py | PyTorch backend implementation + registration side-effect. |
| decent_array/interoperability/_pytorch/init.py | PyTorch backend package initializer/export. |
| decent_array/interoperability/_numpy/numpy_backend.py | NumPy backend implementation + registration side-effect. |
| decent_array/interoperability/_numpy/init.py | NumPy backend package initializer/export. |
| decent_array/interoperability/_jax/jax_backend.py | JAX backend implementation + registration side-effect. |
| decent_array/interoperability/_jax/init.py | JAX backend package initializer/export. |
| decent_array/interoperability/_iop/rng.py | Cross-backend RNG coordination (python random, numpy, backend) + distributions. |
| decent_array/interoperability/_iop/functions.py | Module-level iop function surface delegating to the active backend. |
| decent_array/interoperability/_iop/init.py | iop package marker/init (empty). |
| decent_array/interoperability/_decorators.py | Decorator to unwrap Array args for backend-native cost-method implementations. |
| decent_array/interoperability/_backend_manager.py | Backend registry/activation/reset + auto-import and listener mechanism. |
| decent_array/interoperability/_abstracts/backend.py | Abstract Backend API contract (creation/manipulation/linalg/math/RNG). |
| decent_array/interoperability/_abstracts/init.py | Abstracts package export (Backend). |
| decent_array/interoperability/init.py | Public interoperability API exports (functions + RNG helpers + decorator). |
| decent_array/_array.py | Array wrapper implementation (operators, indexing, properties) tied to active backend. |
| decent_array/init.py | Package exports (Array, interoperability, types). |
| benchmarks/profile_hotpath.py | cProfile-based hot-path profiler for wrapper vs function dispatch. |
| benchmarks/bench_iop.py | Microbenchmark for iop function-call overhead vs native frameworks. |
| benchmarks/bench_common.py | Shared benchmark helpers (backend discovery/activation + timing utilities). |
| benchmarks/bench_array.py | Microbenchmark for Array operator overhead vs native frameworks. |
| .gitignore | Python/build/dev artifact ignores. |
| .github/workflows/ci.yaml | CI pipeline running tox envs (mypy/pytest/ruff/sphinx/mypyc) on Py3.13 across OSes. |
| .github/CODEOWNERS | Sets default code owners for the repo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1
to
+16
| [project] | ||
| name = "decent-array" | ||
| version = "0.1.0" | ||
| authors = [{name = "Elias Ram"}, {name = "Simon Granström"}, {name = "Adriana Rodriguez"}, {name = "Nicola Bastianello"}] | ||
| maintainers = [{name = "Team Decent"}] | ||
| description = "A library of array operations and linear algebra primitives for interoperability across ML frameworks." | ||
| readme = "README.md" | ||
| requires-python = ">=3.13" | ||
| classifiers = [ | ||
| "Programming Language :: Python :: 3.13", | ||
| "Operating System :: OS Independent", | ||
| ] | ||
| license = "AGPL-3.0-only" | ||
| dependencies = [ | ||
| "numpy", | ||
| ] |
Collaborator
Author
|
I will try to remember to upload benchmark results tomorrow evening |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initial upload of array + interoperability modules, including tests, docs, type-checking and compilation. Better docs and a README is needed.