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 recommended np.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.
Also, all the instances of assert all(numpy_array == numpy_array)/assert np.allclose(numpy_array == numpy_array) (if we have any) should be replaced with numpy.testing calls.
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.