test_from_bins_equals_from_bin_range() failing from time to time
Created by: rettigl
Describe the bug The test function test_from_bins_equals_from_bin_range() fails from time to time with an assetion error:
./sed/tests/test_binning.py::test_from_bins_equals_from_bin_range Failed: [undefined]AssertionError:
Not equal to tolerance rtol=1e-07, atol=0
Mismatched elements: 2 / 87210 (0.00229%)
Max absolute difference: 4294967295
Max relative difference: 4.2949673e+09
x: array([[[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],...
y: array([[[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],...
def test_from_bins_equals_from_bin_range():
H1 = _hist_from_bin_range(sample3d, bins3d, ranges3d)
H2 = _hist_from_bins(sample3d, arrays3d, tuple(b.size for b in arrays3d))
> np.testing.assert_allclose(H1, H2)
E AssertionError:
E Not equal to tolerance rtol=1e-07, atol=0
E
E Mismatched elements: 2 / 87210 (0.00229%)
E Max absolute difference: 4294967295
E Max relative difference: 4.2949673e+09
E x: array([[[0, 0, 0, ..., 0, 0, 0],
E [0, 0, 0, ..., 0, 0, 0],
E [0, 0, 0, ..., 0, 0, 0],...
E y: array([[[0, 0, 0, ..., 0, 0, 0],
E [0, 0, 0, ..., 0, 0, 0],
E [0, 0, 0, ..., 0, 0, 0],...
sed/tests/test_binning.py:47: AssertionError
The number looks like an overflow error. Is this related to the different histogram behavior reported in #66 (closed)? To Reproduce Execute the test mutliple times.
Expected behavior The test should run through always
Screenshots n/a
Additional context We should adopt the test function to restrict the