Skip to content

Commit

Permalink
Stricter tolerance in property tests
Browse files Browse the repository at this point in the history
now that ml31415/numpy-groupies#90 was merged
  • Loading branch information
dcherian committed Jul 31, 2024
1 parent 8e522b5 commit a19b501
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 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 @@ -130,8 +128,8 @@ def test_scans(data, array: dask.array.Array, func: str) -> None:
axis = array.ndim - 1

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

Expand Down

0 comments on commit a19b501

Please sign in to comment.