Uh oh!
There was an error while loading. Please reload this page.
Fixed #1175 Migrate tests/test_aamp_stimp.py to npt.assert_allclose - #1183
Merged
seanlaw merged 1 commit intoAug 14, 2026
Merged
Conversation
viknesh-ai
commented
Aug 14, 2026
ContributorAuthor
@seanlaw next file in the split — same conventions as the previous PRs. Ready for review whenever you have time. |
Review these changes at https://app.gitnotebooks.com/stumpy-dev/stumpy/pull/1183 |
seanlaw
commented
Aug 14, 2026
Contributor
Looks good. I will merge it as soon as the tests pass. Feel free to submit the next PR @viknesh-ai |
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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 — this one covers
tests/test_aamp_stimp.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. 9 call sites, same recurring theme as the earlier files:ref_/cmp_naming, but the argument order was backwards everywhere (ref_X, cmp_Xinstead ofcmp_X, ref_X) — flipped all 9.test_stimp_raw_mp) comparesnaive.aamp(...)[:, 0]directly againstpan.P_[idx]. The naive side staysdtype=objecteven after slicing out the distance column (same root cause astest_aamp.py), so I cast both sides tofloat64there. The other 8 sites build theirref_PAN/ref_panarrays vianp.full(..., dtype)-backed assignment rather than a raw slice, so they were already plainfloat64and didn't need casting — checked each site's actual dtype before deciding, rather than assuming based on the earlier files.None of the original calls specified
decimal=, 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) — 10/10 passing both times. This file also spins up a real daskLocalClusterfor the_stimpedtests, so it's slower than the non-dask files.To Do List
Standing checklist from @seanlaw for this migration, applies to every file in the split - status below is for
test_aamp_stimp.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 already usedcmp_naming, nothing to renameref_and stumpy-computed outputs tocmp_(applies tonpt.assert_array_equaltoo) - this file already usedref_/cmp_, 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!