Summary
Implement zero-copy NumPy reads (get_array) and ship type stubs.
References
docs/05_api_python.md §1 (type mapping), §2.2 (get_array), §4 (stubs)
docs/01_requirements.md P02
Scope
Out of scope
- dtype/shape metadata in the payload (not part of wire v1)
Acceptance Criteria
get_array returns a view (no copy — verified via base pointer) with
writeable == False
- Array stays valid after the key is overwritten (keepalive)
- mypy is green against the stubs
Dependencies
For the implementer
- Copy the checklist above into your PR description and tick items as you
complete them. Do not edit the checklist in this issue.
- Follow
docs/development_workflow.md (branch issue/27-numpy-zero-copy,
Conventional Commits per §2.1, TDD RED first).
- This issue is closed automatically by the PR via
Closes #27.
Summary
Implement zero-copy NumPy reads (
get_array) and ship type stubs.References
docs/05_api_python.md§1 (type mapping), §2.2 (get_array), §4 (stubs)docs/01_requirements.mdP02Scope
python/bindings/numpy.cpp:ParamCache.get_array(key, dtype=...)returning a read-only ndarray over the cached buffer
(buffer protocol;
writeable=False; keepalive holds theshared_ptr<const ParamValue>)TypeMismatchError(one copy at encode time)
python/sitos/py.typed+.pyistubs for the whole public API;mypy runs in CI
tests/python/test_numpy_zero_copy.py: base-pointer identity(no copy), writeable flag, keepalive under value overwrite
(Python-side
SpanHandleSurvivesOverwriteequivalent)Out of scope
Acceptance Criteria
get_arrayreturns a view (no copy — verified via base pointer) withwriteable == FalseDependencies
For the implementer
complete them. Do not edit the checklist in this issue.
docs/development_workflow.md(branchissue/27-numpy-zero-copy,Conventional Commits per §2.1, TDD RED first).
Closes #27.