Add NumPy-compatible API layer for out-of-core matrix operations #35
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.
Provides familiar NumPy interface to enable user migration while leveraging Paper's out-of-core capabilities for datasets larger than memory.
Implementation
Core API (
paper/numpy_api.py)ndarrayclass: Lazy evaluation with NumPy-like operations (+,*,@), properties (shape,dtype,T), and publicto_numpy()methodarray(),zeros(),ones(),eye(),random_rand()load(),save()Bug Fix (
paper/plan.py)Fixed pre-existing scalar multiplication bug where EagerNode matrices were closed prematurely, causing segfaults on reuse:
Testing
26 new tests covering array creation, operations, error handling, I/O, and large array support. All 62 tests passing.
Usage
Limitations
Documentation
examples/numpy_api_example.py: 9 comprehensive examplesexamples/simple_demo.py: minimal demoNUMPY_API_SUMMARY.md: complete implementation detailsOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.