-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Labels
API extensionAdds new functions or objects to the API.Adds new functions or objects to the API.Needs DiscussionNeeds further discussion.Needs further discussion.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.
Description
In trying to adapt xarray
to numpy>=2
(and thus switching testing code from numpy.array_api
to array-api-strict
), I noticed that the array API does not require the nbytes
property on arrays, nor the itemsize
property on dtypes.
Thus, the only way to figure out the size of an array we could find was to create a function that dispatches to finfo
/ iinfo
(and returns a hard-coded 1 byte for booleans), then use that and arr.size
to compute the size of the array. This feels like more work than should be necessary, so I wonder if you would be open to extending the array API with arr.nbytes
or arr.dtype.itemsize
(or both)?
Metadata
Metadata
Assignees
Labels
API extensionAdds new functions or objects to the API.Adds new functions or objects to the API.Needs DiscussionNeeds further discussion.Needs further discussion.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.