Use numpy.testing.assert_allclose
for more consistent floating-point comparisons
#4488
Labels
difficulty: easy
A good issue for someone new. Can be done in a few hours
priority: low
No existing plans to resolve
Currently, we use
np.testing.assert_array_almost_equal
in 404 places across 41 files, but the NumPy authors no longer recommend it. We should switch to the recommendednp.testing.assert_allclose
testing method where we can (which can be in one PR or multiple PRs), across all our tests.Please note that there are a few differences in the number of arguments both functions take and in the default tolerance(s) set for them, so it's not a quick swap and some failures could be expected – but it should still be easy for someone to take it up in parts.
The text was updated successfully, but these errors were encountered: