ndstrides: [4] Implement np_array() #514

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

4 Commits

Author SHA1 Message Date
lyken 8f0084ac8a core/ndstrides: implement np_array()
It also checks for inconsistent dimensions if the input is a list.
e.g., rejecting `[[1.0, 2.0], [3.0]]`.

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, NAC3's `np_array(<input>, copy=False)` behaves like NumPy's `np.array(<input>, copy=None)`.
2024-10-18 14:21:50 +08:00
lyken b8190ccc87 core/irrt: add List
Needed for implementing np_array()
2024-10-18 14:21:50 +08:00
lyken 9cfa2622ca core/ndstrides: add NDArrayObject::atleast_nd 2024-10-18 14:21:50 +08:00
lyken b6980c3a39 core/ndstrides: add NDArrayObject::make_copy 2024-10-18 14:21:50 +08:00