Skip to content

Increase coverage and other niceties for the operator/elementwise tests #89

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 35 commits into from
Feb 3, 2022
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f661a23
Updates to op/elwise tests
honno Jan 25, 2022
a590f8d
`sh.fmt_idx()` helper
honno Jan 25, 2022
d7e5e63
Better values testing in `test_not_equal`
honno Jan 26, 2022
1a54bd4
Better values testing for bitwise op/elwise tests
honno Jan 26, 2022
2f8492b
Context objects for unary/binary params
honno Jan 26, 2022
4623214
Apply `iter_indices()` logic to binary op/elwise tests
honno Jan 26, 2022
4b2c41e
Update `test_remainder`
honno Jan 27, 2022
1927c10
Move `broadcast_shapes()` to `shape_helpers.py`
honno Jan 27, 2022
bb836b7
Skip `sh.iter_indices()` generation for 0-sided shapes
honno Jan 27, 2022
f11a6d0
Values testing for `test_sign`
honno Jan 27, 2022
47424e8
Values testing for `test_add` and `test_subtract`
honno Jan 27, 2022
2077986
Rudimentary values testing refactor, updates to logical elwise tests
honno Jan 28, 2022
66a1fd4
Favour lists compared to tuples for `ph.assert_dtypes()`
honno Jan 28, 2022
b6d05da
Favour lists for `ph.assert_result_shape()`
honno Jan 28, 2022
af6d150
Remove `lru_cache` use in `sh.fmt_idx()`
honno Jan 28, 2022
799b4e6
Refactor parametrized unary tests
honno Jan 28, 2022
e2b69df
Op/elwise fixes and improvements
honno Jan 31, 2022
3dfd665
`binary_param_assert_against_refimpl()` to refactor elwise+op tests
honno Jan 31, 2022
a4a7e04
Refactor remaining parametrized elwise+op tests
honno Feb 1, 2022
4d849f1
Finish elwise TODOs
honno Feb 1, 2022
5a82a33
Fix typing issues with refimpl utils
honno Feb 1, 2022
7386615
Remove redundant `in_stype` arg in refimpl utils
honno Feb 1, 2022
80d2909
Skip when refimpl overflows
honno Feb 1, 2022
9521f6b
Values testing for remaining tests for elwise funcs starting with a
honno Feb 1, 2022
e50fc1a
Defaults for `expr_template` in refimpl utils
honno Feb 1, 2022
4a364a5
Refactor majority of elwise tests with refimpl utils
honno Feb 1, 2022
56aa06d
`strict_check` kwarg for refiml utils for testing integrals
honno Feb 1, 2022
dfda4f5
Pass but filter out-of-range values for trig function tests
honno Feb 1, 2022
9d1f4da
Extend note on refimpl utils
honno Feb 1, 2022
e72184e
Refactor remaining elwise/op tests
honno Feb 2, 2022
9edcfcc
Favour use of `operator` for `refimpl`
honno Feb 2, 2022
6e8cda6
Filter undefined dtypes in `hh.two_mutual_arrays()`
honno Feb 2, 2022
493f669
Generic type hint for `refimpl` args
honno Feb 2, 2022
d924ce4
Introduce `right_scalar_assert_against_refimpl()`
honno Feb 2, 2022
3c85cae
Note why you'd want to not strictly check int outputs
honno Feb 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Filter undefined dtypes in hh.two_mutual_arrays()
  • Loading branch information
honno committed Feb 2, 2022
commit 6e8cda6d979dea20f82a6b5e4ff0bfe1b7190b49
3 changes: 3 additions & 0 deletions array_api_tests/hypothesis_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@ def two_mutual_arrays(
) -> Tuple[SearchStrategy[Array], SearchStrategy[Array]]:
if not isinstance(dtypes, Sequence):
raise TypeError(f"{dtypes=} not a sequence")
if FILTER_UNDEFINED_DTYPES:
dtypes = [d for d in dtypes if not isinstance(d, _UndefinedStub)]
assert len(dtypes) > 0 # sanity check
mutual_dtypes = shared(mutually_promotable_dtypes(dtypes=dtypes))
mutual_shapes = shared(two_shapes)
arrays1 = xps.arrays(
Expand Down