Skip to content

TST: skip tests that convert MPArray to NumPy array - #966

Merged
lucascolley merged 1 commit into
data-apis:mainfrom
mdhaber:mparray_skip_as_numpy_true
Sep 5, 2026
Merged

TST: skip tests that convert MPArray to NumPy array#966
lucascolley merged 1 commit into
data-apis:mainfrom
mdhaber:mparray_skip_as_numpy_true

Conversation

@mdhaber

@mdhaber mdhaber commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Reference issue

https://github.com/data-apis/array-api-extra/pull/963/files/2b92ac1821678dbc6317d338937c7f94fc9082bf#diff-c50543e3908e94354bdcf5dc26eca11c2889ac795f4bb43bff052c457994afd1

What does this implement/fix?

This skips tests that convert MPArray to NumPy array. They passed before because np.asarray(my_mparray) produces an object array with a single element, and simple operations (e.g. arithmetic) will work just fine with this object array because it performs the operations on each element. But I don't think that should be relied on; really, as_numpy=True and similar should raise for MPArrays due to precision loss.

AI Generation Disclosure

I added __array__ to MPArray and had GPT-6 run array-api-extra tests with this change. We found those three failures and I told it to apply the skips similarly to GPU backends but citing precision loss as the reason.

@lucascolley lucascolley added this to the 0.11.3 milestone Sep 5, 2026
@lucascolley
lucascolley merged commit a6ae6de into data-apis:main Sep 5, 2026
34 checks passed
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