-
Notifications
You must be signed in to change notification settings - Fork 10
TST: Run all tests on read-only numpy arrays #92
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
Conversation
@@ -136,6 +136,7 @@ def test_device(self, xp: ModuleType, device: Device): | |||
x = xp.asarray([1, 2, 3], device=device) | |||
assert get_device(cov(x)) == device | |||
|
|||
@pytest.mark.skip_xp_backend(Backend.NUMPY_READONLY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notably, read-only numpy disallows __iadd__
etc., whereas jax and sparse simply don't define these methods, which causes them to fall back to a = a.__add__(b)
x1 = xp.asarray([3, 8, 20]) | ||
x2 = xp.asarray(x2) | ||
x2 = xp.arange(n) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NumPyReadOnly.asarray(x2, copy=None)
was tainting the globally defined x2, ruining it for the following iterations of the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems good, thanks!
No description provided.