ndstrides: [4] Implement np_array() #514

Closed
lyken wants to merge 4 commits from ndstrides-4-nparray into ndstrides-3-indexing
Collaborator

Reimplemented np_array() + Proper assertions when the input is a list (e.g., raise an exception when the list has inhomogeneous dimensions).

However, currently only np_array(<input>, copy=False) and np_array(<input>, copy=True) are supported.In NumPy, copy could be false, true, or None. Right now with this PR, NAC3's np_array(<input>, copy=False) behaves like NumPy's np.array(<input>, copy=None). Fortunately this should be easy to implement.

Reimplemented `np_array()` + Proper assertions when the input is a list (e.g., raise an exception when the list has inhomogeneous dimensions). However, currently only `np_array(<input>, copy=False)` and `np_array(<input>, copy=True)` are supported.In NumPy, copy could be `false`, `true`, or `None`. Right now with this PR, NAC3's `np_array(<input>, copy=False)` behaves like NumPy's `np.array(<input>, copy=None)`. Fortunately this should be easy to implement.
lyken added 4 commits 2024-08-28 13:51:23 +08:00
Needed for implementing np_array()
It also checks for inconsistent dimensions if the input is a list.
e.g., rejecting `[[1.0, 2.0], [3.0]]`.
lyken added a new dependency 2024-08-28 13:52:09 +08:00
lyken force-pushed ndstrides-4-nparray from b158ec80b4 to 81e937db82 2024-08-30 14:26:13 +08:00 Compare
Author
Collaborator

Rebased.

Rebased.
lyken force-pushed ndstrides-4-nparray from 81e937db82 to f109c58da8 2024-08-30 14:38:34 +08:00 Compare
Author
Collaborator

Rebased to fix some formatting issues.

Rebased to fix some formatting issues.
lyken force-pushed ndstrides-4-nparray from f109c58da8 to d222236492 2024-08-30 14:40:19 +08:00 Compare
derppening force-pushed ndstrides-4-nparray from d222236492 to de732ba68e 2024-10-17 14:27:57 +08:00 Compare
derppening force-pushed ndstrides-4-nparray from de732ba68e to 2c3463c516 2024-10-17 16:10:37 +08:00 Compare
derppening force-pushed ndstrides-4-nparray from 2c3463c516 to 6234060e85 2024-10-17 16:31:18 +08:00 Compare
derppening force-pushed ndstrides-4-nparray from 6234060e85 to 8f0084ac8a 2024-10-18 14:23:46 +08:00 Compare
Collaborator

Superseded by #568.

Superseded by #568.
derppening closed this pull request 2025-01-06 16:50:15 +08:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: M-Labs/nac3#514
No description provided.