Skip to content

Migrate tests/test_gpu_aamp.py to npt.assert_allclose - #1190

Open
viknesh-ai wants to merge 1 commit into
stumpy-dev:mainfrom
viknesh-ai:fix/1175-migrate-test-gpu-aamp
Open

Migrate tests/test_gpu_aamp.py to npt.assert_allclose#1190
viknesh-ai wants to merge 1 commit into
stumpy-dev:mainfrom
viknesh-ai:fix/1175-migrate-test-gpu-aamp

Conversation

@viknesh-ai

Copy link
Copy Markdown
Contributor

Related to #1175

Covers tests/test_gpu_aamp.py (34 call sites, this file's tests only actually run under CUDA — locally it's a single module-level skip, so I verified with NUMBA_ENABLE_CUDASIM=1 instead). Renamed comp_mp to cmp_mp, flipped every call to (cmp, ref) order.

Same object-dtype situation as test_aamp.py: naive.aamp(...) mixes a float distance column with an int index column, so full-array and [:, 0]-sliced comparisons both needed a float64 cast. A few call sites use decimal=config.STUMPY_TEST_PRECISION — kept those as a config reference rather than the 1.5e-07 literal. Several pd.Series variants are commented out in the original file; updated their syntax too but left them commented.

37/37 passing under CUDA simulation (matches how test.sh coverage actually exercises this file).

To Do List

  • assert_almost_equal -> assert_allclose
  • no rtol=0
  • actual, desired order
  • atol=1.5e-07 literal where no decimal= was set; config.STUMPY_TEST_PRECISION reference kept where it was
  • cmp not comp
  • ref_/cmp_ naming, .astype(np.float64) cast 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

Please 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!

@viknesh-ai
viknesh-ai requested a review from seanlaw as a code owner August 17, 2026 15:32
@gitnotebooks

gitnotebooks Bot commented Aug 17, 2026

Copy link
Copy Markdown

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

@viknesh-ai

Copy link
Copy Markdown
Contributor Author

@seanlaw next file in the split — same conventions as the previous PRs. Ready for review whenever you have time.

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.

1 participant