You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
add array_namespace option to return wrapped if possible, else native #168
Since array_namespace(x, use_compat=None) now returns plain numpy, but released NumPy still has incompatibilities with the standard, we want to use use_compat=True in SciPy. However, since array-api-strict isn't wrapped, array_namespace throws a ValueError, so we have to use:
array-api-strict isn't special here, this goes for any standard-compliant library. It would be nice to have an option to do this without having to catch an exception. Alternatively, we could just wait until NumPy is fully compatible with the standard before making the native namespace the default, but I'm not sure how feasible that is as the standard continues to change.
Well I think we're going to have to get rid of the "numpy 2.0 doesn't get wrapped at all" logic because there actually are some differences from the standard in NumPy 2.0 and even NumPy 2.1 (which weren't caught for some reason #167). I thought it would simplify things to not wrap NumPy 2.0 at all, but I think instead we are going to just have a separate, simpler wrapper namespace for it.
Activity
asmeurer commentedon Jul 30, 2024
Well I think we're going to have to get rid of the "numpy 2.0 doesn't get wrapped at all" logic because there actually are some differences from the standard in NumPy 2.0 and even NumPy 2.1 (which weren't caught for some reason #167). I thought it would simplify things to not wrap NumPy 2.0 at all, but I think instead we are going to just have a separate, simpler wrapper namespace for it.
Re-enable wrapping unconditionally for NumPy
Re-enable wrapping unconditionally for NumPy
asmeurer commentedon Jul 30, 2024
If we do end up needing more control of this option we can update it, but for now I think this should solve your issue. #170