Skip to content

Migrate SCRAAMP tests to assert_allclose - #1234

Merged
seanlaw merged 1 commit into
stumpy-dev:mainfrom
austinchennn:codex/migrate-scraamp-assert-allclose-20261118
Nov 19, 2026
Merged

seanlaw merged 1 commit into
stumpy-dev:mainfrom
austinchennn:codex/migrate-scraamp-assert-allclose-20261118

Conversation

@austinchennn

Copy link
Copy Markdown
Contributor

Related to #1175, following Sean's explicit invitation for SCRUMP and SCRAAMP and the detailed file-scope discussion. This PR covers only tests/test_scraamp.py; SCRUMP was merged in #1225. All current open PR file lists were checked for overlap.

Migrate 96 active almost-equal comparisons to assert_allclose, computed values first and numeric references second. Use the requested atol=1.5e-07 without adding an explicit rtol; preserve the existing explicit precision-derived absolute tolerance where present. Rename comparison temporaries from comp to cmp. For 36 reference columns coming from heterogeneous object matrices, convert only the numeric profile/index columns to their intended float64/int64 dtype, including both naive and real AAMP references.

An AST audit confirms that inputs, random-state contexts, test scenarios, algorithm calls, existing duplicate comparisons and disabled assertions remain unchanged. No production code changes. The default relative tolerance is part of the project's migration convention; exact mathematical equivalence to old decimal assertions is not claimed.

Validation on macOS arm64, Python 3.11.15, on this exact patch and current main dcdeeb1:

  • Original target file: 74 passed. A direct assertion-only migration produced 15 TypeError failures / 59 passed on object-typed numeric references; after the 36 narrow numeric reference casts, 74 passed.
  • ./setup.sh dev && ./test.sh completed, exit 0:
    • JIT: 2,363 passed, 32 skipped across 49 files.
    • Coverage/simulated CUDA: 2,510 passed, 17 skipped across 49 files.
    • 100% coverage, 15,109 statements, 0 missing.
  • Repository-wide Black, flake8, structural scope audit and git diff --check: passed.

The full run used the repository's macOS OpenMP runtime setup, normal RNG configuration and unchanged warnings/coverage exclusions. Ray and pyFFTW were unavailable; CUDA was simulated. Linux, Windows and physical GPU execution were not performed locally. This is test maintenance, not a production defect repair or performance improvement. The umbrella migration remains open. OpenAI Codex assisted with implementation, validation and PR text.

Pull Request Checklist

Below is a simple checklist but please do not hesitate to ask for assistance!

  • 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 (explicit SCRAAMP and SCRAAMP invitation linked above)
  • 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 (also with --check)
  • 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
    • less than 25% of the code in this pull request
    • 25-50% of the code in this pull request
    • more than 50% 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!

The local checklist is complete; review and merge consideration are welcome when the approach and upstream checks are satisfactory.

@gitnotebooks

gitnotebooks Bot commented Nov 18, 2026

Copy link
Copy Markdown

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

@seanlaw
seanlaw merged commit a42ca40 into stumpy-dev:main Nov 19, 2026
89 of 94 checks passed
@seanlaw

seanlaw commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

@austinchennn Thanks for the PR

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