Skip to content

Migrate tests/test_maamp.py to npt.assert_allclose - #1198

Merged
seanlaw merged 1 commit into
stumpy-dev:mainfrom
viknesh-ai:fix/1175-migrate-test-maamp
Aug 25, 2026
Merged

Migrate tests/test_maamp.py to npt.assert_allclose#1198
seanlaw merged 1 commit into
stumpy-dev:mainfrom
viknesh-ai:fix/1175-migrate-test-maamp

Conversation

@viknesh-ai

Copy link
Copy Markdown
Contributor

Related to #1175

tests/test_maamp.py (34 sites). Renamed comp to cmp, flipped order. maamp() returns (P, I) as two separate arrays rather than one combined one, so most sites are already clean float64/int64 — only test_naive_maamp needed a cast, since its ref side comes from naive.aamp() (same object-dtype issue as test_aamp.py). A couple of sites keep the config.STUMPY_TEST_PRECISION reference. Left the one npt.assert_equal call untouched, it's an exact-equality check on indices, not assert_almost_equal.

41/41 passing locally in both normal and CI-equivalent modes.

To Do List

  • assert_allclose, cmp first
  • atol=1.5e-07 / config reference where it was
  • cmp not comp
  • ref_/cmp_ naming, cast only where the source is dtype=object

Pull Request Checklist

  • Read our Contributing Guide
  • Referenced a Github issue (or create one if one doesn't already exist)
  • Read and reviewed all of the comments in the Github issue that you've referenced (along with cross-referenced issues/pull requests) to ensure that the issue still requires a pull request
  • Checked that the issue has not already been assigned to anybody else or is already being addressed in another pull request
  • Left a meaningful comment on the original Github issue to discuss the detailed approach for your contribution and received confirmation from the maintainers before proceeding with this pull request
  • Forked, cloned, and checked out the newest version of the code
  • Created a new branch
  • Made necessary code changes
  • Installed black (i.e., python -m pip install black or conda install -c conda-forge black)
  • Installed flake8 (i.e., python -m pip install flake8 or conda install -c conda-forge flake8)
  • Installed pytest-cov (i.e., python -m pip install pytest-cov or conda install -c conda-forge pytest-cov)
  • Ran black --exclude=".*\.ipynb" --extend-exclude=".venv" --diff ./ in the root stumpy directory
  • Ran flake8 --extend-exclude=.venv ./ in the root stumpy directory
  • Ran ./setup.sh dev && ./test.sh in the root stumpy directory and ensured that all tests are passing locally
  • Check this box if AI code assistance was used to generate 15%+ of the code in this pull request

Only request a review after the checklist above is fully completed!

@viknesh-ai
viknesh-ai requested a review from seanlaw as a code owner August 24, 2026 16:50
@gitnotebooks

gitnotebooks Bot commented Aug 24, 2026

Copy link
Copy Markdown

Review these changes at https://app.gitnotebooks.com/stumpy-dev/stumpy/pull/1198

@viknesh-ai

Copy link
Copy Markdown
Contributor Author

@seanlaw next one — same conventions as before.

@seanlaw
seanlaw merged commit 83f352c into stumpy-dev:main Aug 25, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants