Skip to content
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

Implement EqualityMapping and use for relevant dtype helpers #112

Merged
merged 6 commits into from
Apr 20, 2022

Conversation

honno
Copy link
Member

@honno honno commented Apr 13, 2022

Resolves #111 by implementing a dict-like class EqualityMapping that uses equality for indexing, as opposed to hashing.

The test suite would work again with NumPy-proper, except another issue now persists if you use newer versions of Hypothesis (specifically after HypothesisWorks/hypothesis#3156)—an internal check assumes floats are being returned for xp.finfo(), which is not the case with NumPy-proper and so an unrelated error occurs for any test using xps.from_dtype()... so any test using xps.arrays() 😅 I wrote a quick hack which now bypasses this internal check in __init__.py)... it's certainly not ideal, along with my original st.floats() monkey patching, so will mull it over.

@honno honno requested a review from asmeurer April 13, 2022 12:22
@honno
Copy link
Member Author

honno commented Apr 13, 2022

If you'd like to try this with the #110 changes, see https://github.com/honno/array-api-tests/tree/try-inspect-sig-eq-map (it's not a clean rebase otherwise). outdated

@honno honno mentioned this pull request Apr 14, 2022
Drops internal use of hashing via dicts for dtype helpers
@honno
Copy link
Member Author

honno commented Apr 20, 2022

I'll merge this tomorrow unless any blockers are identified.

@asmeurer asmeurer merged commit 63ebadb into data-apis:master Apr 20, 2022
@honno honno deleted the use-dtype-eq branch February 28, 2024 13:22
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.

Use equality instead of hasing for dtype helpers
2 participants