Skip to content

Re-enable wrapping unconditionally for NumPy - #170

Merged
asmeurer merged 4 commits into
data-apis:mainfrom
asmeurer:numpy-rewrap
Aug 6, 2024
Merged

asmeurer merged 4 commits into
data-apis:mainfrom
asmeurer:numpy-rewrap

Conversation

@asmeurer

Copy link
Copy Markdown
Member

NumPy 2.0 and 2.1 both have some incompatibilities with the array API (see
#167 and #164).

Closes #168.

asmeurer added 2 commits July 30, 2024 12:44
NumPy 2.0 and 2.1 both have some incompatibilities with the array API (see data-apis#167 and data-apis#164).

Closes data-apis#168.
@asmeurer

Copy link
Copy Markdown
Member Author

For now I'm going to just use the full wrappers for all versions of NumPy. This is actually what the CI has been testing all along. However, we might consider using a much reduced wrapper for NumPy 2.0+, especially if it can make a difference for performance.

@lucascolley lucascolley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks Aaron, LGTM!

@lucascolley lucascolley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to adjust

wrapped_libraries = ["cupy", "torch", "dask.array"]
all_libraries = wrapped_libraries + ["numpy", "jax.numpy", "sparse"]
import numpy as np
if np.__version__[0] == '1':
wrapped_libraries.append("numpy")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add array_namespace option to return wrapped if possible, else native

2 participants