Skip to content

Conversation

crusaderky
Copy link
Contributor

No description provided.

@lucascolley lucascolley self-requested a review January 15, 2025 13:34
x = xp.asarray([1, 2, 3], device=device)
assert get_device(cov(x)) == device

@pytest.mark.skip_xp_backend(Backend.NUMPY_READONLY)
Copy link
Contributor Author

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)

def test_no_invert_assume_unique(self, xp: ModuleType, n: int):
x1 = xp.asarray([3, 8, 20])
x2 = xp.asarray(x2)
x2 = xp.arange(n)
Copy link
Contributor Author

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.

Copy link
Member

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

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

seems good, thanks!

@lucascolley lucascolley merged commit 5f4fa99 into data-apis:main Jan 15, 2025
10 checks passed
@crusaderky crusaderky deleted the numpy_ro branch January 15, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants