Fixed #1175 Migrate tests/test_aampdist.py to npt.assert_allclose - #1184
Open
viknesh-ai wants to merge 1 commit into
Open
Fixed #1175 Migrate tests/test_aampdist.py to npt.assert_allclose#1184viknesh-ai wants to merge 1 commit into
viknesh-ai wants to merge 1 commit into
Conversation
|
Review these changes at https://app.gitnotebooks.com/stumpy-dev/stumpy/pull/1184 |
Contributor
Author
|
@seanlaw next file in the split — same conventions as the previous PRs. Ready for review whenever you have time. |
Contributor
|
@viknesh-ai From this point forward, we should stop using "Fixed #number" as all of the PRs will reference the original issue and auto-close the issue. Simply leave the issue number out of the title and cross reference the issue in the initial comment. For this PR, please update the title to omit the "Fixed #1175" part |
seanlaw
reviewed
Aug 16, 2026
seanlaw
left a comment
Contributor
There was a problem hiding this comment.
Everything looks good on my end @viknesh-ai. Ready to merge?
Also, feel free to submit 2-3 PRs at a time now (again, please omit the title cross reference to the original issue).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed #1175
Continuing the file-by-file split from #1178/#1181/#1182/#1183 — this one covers
tests/test_aampdist.py. Will open the next file's PR once this one merges.assert_almost_equalonly checks a fixed absolute tolerance and NumPy's docs recommendassert_allcloseinstead. 7 call sites, same two fixes as the earlier files:comp_aampdist_vect/comp_mpdisttocmp_aampdist_vect/cmp_mpdistper the standing convention.ref_X, comp_Xinstead ofcmp_X, ref_X) — flipped all 7.Checked the return dtypes from
_aampdist_vectandaampdistbefore touching anything — both come back plainfloat64, so no.astype()casting was needed here (unliketest_aamp.py/test_aamp_motifs.py/test_aamp_stimp.py, where the naive helper's mixed float/int output forced a cast). None of the original calls specifieddecimal=, so every site uses the defaultatol=1.5e-07.Ran the full file twice locally (normal mode and JIT-disabled/CUDA-simulated, matching
test.sh coverage) — 38/38 passing both times.To Do List
Standing checklist from @seanlaw for this migration, applies to every file in the split - status below is for
test_aampdist.py:npt.assert_almost_equalwith its equivalentnpt.assert_allclosertol=0fornpt.assert_allclose, simply omit this parameter and value since this is the defaultnpt.assert_allclose(actual, desired)always has the stumpy computed value asactualand the naive computation asdesiredatol=1.5e-07rather thanatol=1.5*10**-071.5*10**-config.STUMPY_TEST_PRECISIONwithconfig.STUMPY_TEST_PRECISION = 1.5e-07(inconfig.py) - tracked as a follow-up, not part of this per-file migrationcmpinstead ofcomp- this file usedcomp_aampdist_vect/comp_mpdist, both renamedref_and stumpy-computed outputs tocmp_(applies tonpt.assert_array_equaltoo) - this file already usedref_, noassert_array_equalcalls presentPull Request Checklist
Below is a simple checklist but please do not hesitate to ask for assistance!
black(i.e.,python -m pip install blackorconda install -c conda-forge black)flake8(i.e.,python -m pip install flake8orconda install -c conda-forge flake8)pytest-cov(i.e.,python -m pip install pytest-covorconda install -c conda-forge pytest-cov)black --exclude=".*\.ipynb" --extend-exclude=".venv" --diff ./in the root stumpy directoryflake8 --extend-exclude=.venv ./in the root stumpy directory./setup.sh dev && ./test.shin the root stumpy directory and ensured that all tests are passing locallyPlease do not commit any code to avoid/circumvent a failing test and, instead, engage in a discussion (below) to determine the best course of action.
Only request a review after the checklist above is fully completed!