-
-
Notifications
You must be signed in to change notification settings - Fork 12k
Open
Labels
00 - Bug40 - array API standardPRs and issues related to support for the array API standardPRs and issues related to support for the array API standard
Milestone
Description
Describe the issue:
I keep getting stuck trying to get tests in https://github.com/data-apis/array-api-tests to pass and the final errors are often due to numpy arrays having turned into scalars and the tests not expecting that, (https://data-apis.org/array-api/draft/API_specification/array_object.html)
Reading #26850 it seems the intention is that the scalars should support the array api spec?
Reproduce the code example:
import numpy as np
import array_api_strict as xps
# Some examples:
xps.mean(xps.asarray(4, dtype=xps.float32)).__iadd__(1)
np.mean(np.asarray(4, dtype=np.float32)).__iadd__(1) # AttributeError: 'numpy.float32' object has no attribute '__iadd__'
xps.all(xps.asarray(True, dtype=xps.bool)).__ior__(False)
np.all(np.asarray(True, dtype=np.bool)).__ior__(False) # AttributeError: 'numpy.bool' object has no attribute '__ior__'
xps.mean(xps.asarray(4, dtype=xps.float32)).__complex__()
np.mean(np.asarray(4, dtype=np.float32)).__complex__() # AttributeError: 'numpy.float32' object has no attribute '__complex__'Error message:
No response
Python and NumPy Versions:
import sys, numpy; print(numpy.version); print(sys.version)
2.1.0
3.12.2 | packaged by conda-forge | (main, Feb 16 2024, 20:42:31) [MSC v.1937 64 bit (AMD64)]
Runtime Environment:
No response
Context for the issue:
No response
Metadata
Metadata
Assignees
Labels
00 - Bug40 - array API standardPRs and issues related to support for the array API standardPRs and issues related to support for the array API standard