Filter undefined dtypes in hh.mutually_promotable_dtypes()
#34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If
max_size
is not its default value2
, thenhh.mutually_promotable_dtypes()
before returned undefined dtypes. This PR fixes that. Related to #33.I now bind
xps
to the underlying array modulemod
, instead of the top-level stubbed one. Hypothesis gives nice errors when it encounters erroneous situations due to partial/incorrect Array API adoption, and like with the dtype strategies inhypothesis_helpers.py
it will work even if not all dtypes are available.I also add two test cases, one mocking an array module with undefined dtypes, and one actually testing an array module with undefined dtypes in
test_partial_adopters.py
. Because of how the codebase is structured, it's pretty awkward to test partial adopters like I had done in Hypothesis, but a liberal use ofpytest.mark.skipif()
allows us to test how our own strategies work with different array modules.