Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable wrapping unconditionally for NumPy #170

Merged
merged 4 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
numpy-version: ['1.21', '1.26', 'dev']
numpy-version: ['1.21', '1.26', '2.0', 'dev']
exclude:
- python-version: '3.11'
numpy-version: '1.21'
Expand Down
9 changes: 3 additions & 6 deletions array_api_compat/common/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def is_ndonnx_array(x):

import ndonnx as ndx

return isinstance(x, ndx.Array)
return isinstance(x, ndx.Array)

def is_dask_array(x):
"""
Expand Down Expand Up @@ -340,12 +340,9 @@ def your_function(x, y):
elif use_compat is False:
namespaces.add(np)
else:
# numpy 2.0 has __array_namespace__ and is fully array API
# numpy 2.0+ have __array_namespace__, however, they are not yet fully array API
# compatible.
if hasattr(np.empty(0), '__array_namespace__'):
namespaces.add(np.empty(0).__array_namespace__(api_version=api_version))
else:
namespaces.add(numpy_namespace)
namespaces.add(numpy_namespace)
elif is_cupy_array(x):
if _use_compat:
_check_api_version(api_version)
Expand Down
Loading