Repository navigation
Fix discord subspace dimension ordering - #1226
Merged
Merged
Conversation
|
❌ This pull request has been automatically closed because the mandatory PR template was removed or not filled out. Please reopen or recreate this PR with the required information. |
Contributor
|
@AryanRG All tests are now passing. Isit ready to be merged? |
Contributor
Author
|
Yes, ready from my side. Hosted CI is green and I’ve updated the checklist. I left the full local run unchecked because the Dask failure also reproduced on main. Thanks for rerunning it! |
Contributor
|
@AryanRG Thanks for the PR! |
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.
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!
Fixes #1227. The approach was confirmed there before this PR was reopened.
With
discords=True, subspace selection should return the dimensions with the largest distances first. For distances[1, 3, 2], it currently returns[2, 0, 1]. The expected order is[1, 2, 0].D[::-1].argsort()returns positions in the reversed array. Sorting-Dgives descending distances with the original dimension indices and stable tie ordering.The two naive test helpers contained the same expression, which masked the bug. This fixes those helpers and adds one hand-computed regression. Existing discord tests fail against the original source with the corrected helpers.
The five affected test modules pass with 349 passed and 1 skipped. Independent public-API checks cover subspace, non-normalized subspace, MDL, ties and
include. Formatting on the three changed files and the static checks fromtest.shpass. All 31 jobs in the hosted run passed on this head, including the unit and coverage matrix. The full local run hit a Dask cancellation that also reproduced on unmodified main, so its checklist item is still unchecked.Prepared with AI assistance.