Skip to content

Fix way to determine default_complex #283

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

Merged
merged 4 commits into from
Aug 23, 2024

Conversation

cbourjau
Copy link
Contributor

The current test suite crashes during the collection time if the implementation in question does not support complex data types. This PR changes the way in which the default_complex type is determined to avoid the issue. Further discussion and context can be found here.

@@ -322,15 +322,16 @@ def accumulation_result_dtype(x_dtype, dtype_kwarg):
default_float = xp.asarray(float()).dtype
if default_float not in real_float_dtypes:
warn(f"inferred default float is {default_float!r}, which is not a float")
if api_version > "2021.12":
Copy link
Member

Choose a reason for hiding this comment

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

I don't know about removing this. This is the check that's currently done throughout the suite to check for complex support.

Maybe we should instead make sure that ARRAY_API_TESTS_SKIP_DTYPES works correctly for complex dtypes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I readded the version check and added a check that no complex types are requested to be skipped.

@asmeurer asmeurer merged commit 4caff28 into data-apis:master Aug 23, 2024
4 checks passed
@cbourjau cbourjau deleted the fix-default-complex branch September 3, 2024 06:15
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.

2 participants