Fixed #1175 Migrate tests/test_aamp_ostinato.py to npt.assert_allclose - #1182
Open
viknesh-ai wants to merge 1 commit into
Open
Fixed #1175 Migrate tests/test_aamp_ostinato.py to npt.assert_allclose#1182viknesh-ai wants to merge 1 commit into
viknesh-ai wants to merge 1 commit into
Conversation
…pt.assert_allclose
|
Review these changes at https://app.gitnotebooks.com/stumpy-dev/stumpy/pull/1182 |
Contributor
Author
|
@seanlaw next file in the split .Ready for review whenever you have time. |
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 — this one covers
tests/test_aamp_ostinato.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. 16 call sites in this file, all following the same two fixes established in the previous two PRs:ref_x, cmp_xinstead ofcmp_x, ref_x) — flipped every one to put the stumpy-computed value first.ref_/comp_naming (radius/Ts_idx/subseq_idx, plusT_comp/Ts_compin the overwrite-safety tests) — renamed everycomptocmpper the standing convention.Checked the actual return dtypes from
aamp_ostinatobefore touching anything (radiusisfloat64,Ts_idx/subseq_idxare plain int/int64) — none of them come backdtype=objectthe way the mixed distance/index arrays intest_aamp.py/test_aamp_motifs.pydid, so no.astype(np.float64)casting was needed here. 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) — 74/74 passing both times. The dask-backed tests (test_random_ostinatoed,test_deterministic_ostinatoed, etc.) spin up a realLocalCluster, so this one takes noticeably longer than the previous two files (~30-50s locally).To Do List
Standing checklist from @seanlaw for this migration, applies to every file in the split - status below is for
test_aamp_ostinato.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_radius/comp_Ts_idx/comp_subseq_idx/T_comp/Ts_comp, all renamedref_and stumpy-computed outputs tocmp_(applies tonpt.assert_array_equaltoo) - this file already usedref_/comp_, 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!