Fix scipy.stats.mode usage for keepdims=False default (scipy>=1.11) - #3409
Merged
C-Achard merged 1 commit intoJul 16, 2026
Merged
Conversation
SORTEllipse.track indexed mode(identities[i])[0][0]. Since scipy 1.11 mode defaults to keepdims=False, so mode(1d)[0] is already a scalar and the second [0] raises IndexError. Pass keepdims=False explicitly and take a single [0], matching the pattern already used in refine_training_dataset/stitch.py. These sites are in the identity-aware branch of SORTEllipse.track, which is currently only reached when 'identities' is passed to track() (no in-tree caller does), so this is a latent fix rather than a live regression.
9 tasks
deruyter92
approved these changes
Jul 16, 2026
C-Achard
merged commit Jul 16, 2026
e0f4abf
into
DeepLabCut:external/hwang-misc-fixes
10 checks passed
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.
SORTEllipse.track indexed mode(identities[i])[0][0]. Since scipy 1.11 mode defaults to keepdims=False, so mode(1d)[0] is already a scalar and the second [0] raises IndexError. Pass keepdims=False explicitly and take a single [0], matching the pattern already used in refine_training_dataset/stitch.py.
These sites are in the identity-aware branch of SORTEllipse.track, which is currently only reached when 'identities' is passed to track() (no in-tree caller does), so this is a latent fix rather than a live regression.