Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make reference, test argument ordering consistent in test assertions #635

Open
mcwitt opened this issue Feb 15, 2022 · 0 comments
Open

Make reference, test argument ordering consistent in test assertions #635

mcwitt opened this issue Feb 15, 2022 · 0 comments

Comments

@mcwitt
Copy link
Collaborator

mcwitt commented Feb 15, 2022

Originally discussed here.

Some test assertions flip the suggested ordering of the reference and test data.

E.g. cases returned by grep -R 'assert_\(allclose\|almost_equal\)(ref[^,]*, [^)]*)':

tests/common.py:                np.testing.assert_allclose(ref_u, test_u, rtol=rtol, atol=atol)
tests/common.py:                np.testing.assert_allclose(ref_du_dl, test_du_dl, rtol=rtol)
tests/common.py:                    np.testing.assert_allclose(ref_du_dp, test_du_dp, rtol=rtol, atol=atol)
tests/test_nblist.py:        np.testing.assert_almost_equal(ref_ctrs, test_ctrs)
tests/test_nblist.py:        np.testing.assert_almost_equal(ref_exts, test_exts)
tests/test_loss.py:    np.testing.assert_allclose(ref, test)
slow_tests/test_mtm.py:        np.testing.assert_almost_equal(ref_prob, test_prob)
slow_tests/test_determinism.py:                    np.testing.assert_almost_equal(ref_U, test_u, decimal=decimals)
slow_tests/test_determinism.py:                    np.testing.assert_almost_equal(ref_U, test_u_selective, decimal=decimals)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant