Skip to content

Commit

Permalink
Stricter tolerance in property tests (#377)
Browse files Browse the repository at this point in the history
* Stricter tolerance in property tests

now that ml31415/numpy-groupies#90 was merged

* skip float32 with cumsum
  • Loading branch information
dcherian authored Aug 2, 2024
1 parent 8d54c9b commit 4d03d70
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/test_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ def test_groupby_reduce(data, array, func: str) -> None:
actual = actual.astype(cast_to)

note(("expected: ", expected, "actual: ", actual))
tolerance = (
{"rtol": 1e-13, "atol": 1e-15} if "var" in func or "std" in func else {"atol": 1e-15}
)
tolerance = {"atol": 1e-15}
assert_equal(expected, actual, tolerance)


Expand All @@ -131,7 +129,7 @@ def test_scans(data, array: dask.array.Array, func: str) -> None:

# Too many float32 edge-cases!
if "cum" in func and array.dtype.kind == "f" and array.dtype.itemsize == 4:
array = array.astype(np.float64)
assume(False)
numpy_array = array.compute()
assume((np.abs(numpy_array) < 2**53).all())

Expand Down

0 comments on commit 4d03d70

Please sign in to comment.