-
Notifications
You must be signed in to change notification settings - Fork 367
Migrate tests from npt.assert_almost_equal to npt.assert_allclose #1178
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -132,13 +132,17 @@ def test_aamp_identical_subsequence_self_join(): | |
| naive.replace_inf(ref_mp) | ||
| naive.replace_inf(comp_mp) | ||
| npt.assert_almost_equal( | ||
| ref_mp[:, 0], comp_mp[:, 0], decimal=config.STUMPY_TEST_PRECISION | ||
| ref_mp[:, 0], | ||
| comp_mp[:, 0], | ||
| decimal=config.STUMPY_TEST_PRECISION, | ||
| ) # ignore indices | ||
|
|
||
| comp_mp = aamp(pd.Series(T_A), m, ignore_trivial=True) | ||
| naive.replace_inf(comp_mp) | ||
| npt.assert_almost_equal( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is |
||
| ref_mp[:, 0], comp_mp[:, 0], decimal=config.STUMPY_TEST_PRECISION | ||
| ref_mp[:, 0], | ||
| comp_mp[:, 0], | ||
| decimal=config.STUMPY_TEST_PRECISION, | ||
| ) # ignore indices | ||
|
|
||
|
|
||
|
|
@@ -154,13 +158,17 @@ def test_aamp_identical_subsequence_A_B_join(): | |
| naive.replace_inf(ref_mp) | ||
| naive.replace_inf(comp_mp) | ||
| npt.assert_almost_equal( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is |
||
| ref_mp[:, 0], comp_mp[:, 0], config.STUMPY_TEST_PRECISION | ||
| ref_mp[:, 0], | ||
| comp_mp[:, 0], | ||
| decimal=config.STUMPY_TEST_PRECISION, | ||
| ) # ignore indices | ||
|
|
||
| comp_mp = aamp(pd.Series(T_A), m, pd.Series(T_B), ignore_trivial=False) | ||
| naive.replace_inf(comp_mp) | ||
| npt.assert_almost_equal( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is |
||
| ref_mp[:, 0], comp_mp[:, 0], config.STUMPY_TEST_PRECISION | ||
| ref_mp[:, 0], | ||
| comp_mp[:, 0], | ||
| decimal=config.STUMPY_TEST_PRECISION, | ||
| ) # ignore indices | ||
|
|
||
| # Swap inputs | ||
|
|
@@ -169,7 +177,9 @@ def test_aamp_identical_subsequence_A_B_join(): | |
| naive.replace_inf(ref_mp) | ||
| naive.replace_inf(comp_mp) | ||
| npt.assert_almost_equal( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is |
||
| ref_mp[:, 0], comp_mp[:, 0], config.STUMPY_TEST_PRECISION | ||
| ref_mp[:, 0], | ||
| comp_mp[:, 0], | ||
| decimal=config.STUMPY_TEST_PRECISION, | ||
| ) # ignore indices | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is
npt.assert_almost_equalstill being used here instead ofnpt.assert_allclose?