Repository navigation
Migrate tests/test_mmotifs.py to NumPy array comparisons - #1212
karthiksenv wants to merge 2 commits into
Conversation
|
Review these changes at https://app.gitnotebooks.com/stumpy-dev/stumpy/pull/1212 |
|
@karthiksenv I see a lot of inconsistencies in the PR. Please cross reference the To Do List as well as the other related |
|
Thanks, Sean. I missed those conventions in the first version. I checked the checklist and #1181/#1202 and pushed 9bbe330: all 28 comparisons now use The tighter tolerance exposed one stale fixture value. The second motif's self-match expected All seven tests pass on Windows and Ubuntu, with JIT enabled and disabled. Black and flake8 pass too. I updated the description to distinguish these reruns from the full-suite results on the earlier commit. Codex assisted with this follow-up and reply. |
Related to #1175. This covers
tests/test_mmotifs.py, as agreed in the issue.The seven multidimensional motif tests use
assert_allclosefor all 28 comparisons, withatol=1.5e-07and no explicitrtol. Each comparison puts the computed value first and uses thecmp_andref_prefixes from the other migrations.The two-motif fixture previously expected a self-match distance of
1.68587394e-07. It now expects zero:mmotifspasses the motif index throughmatchtocore.mass, which explicitly sets the query's self-match distance to zero. The tighter tolerance exposed this stale expectation. Other reference values are unchanged.After the review corrections, all seven changed tests passed on Windows with Numba JIT enabled and disabled, using Python 3.12.15, NumPy 2.5.4, Numba 0.68.1 and seed 1175. Each run reported the existing
wherewarning fromcore.z_norm. Black and flake8 passed for the changed file.The same seven tests also passed on Ubuntu with JIT enabled and disabled after these corrections, with the same existing warnings.
Before the review corrections, the full Ubuntu development setup and test script ran on commit
3501ed5with seed 1175. The JIT phase had 2,363 passes and 40 skips, and the coverage phase had 2,510 passes and 17 skips. The initial coverage report missed the default-seed initialization line because a seed was supplied. Running the existing two RNG tests withSTUMPY_SEEDunset and rerunning the project's report produced 100% coverage across 15,105 statements. Optional Ray and pyFFTW integrations were unavailable. Repository-wide formatting, import-order, lint, docstring and package checks passed. This full run has not been repeated after the comparison and fixture corrections.OpenAI Codex assisted with the migration, local validation and PR text.
This PR replaces #1211, which the checklist workflow closed before the template was added.
Pull 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!