Repository navigation
Fix ISI histogram bins for constant intervals - #656
Merged
Merged
Conversation
gviejo
approved these changes
Sep 16, 2026
Contributor
|
Merging it. Thanks @viranovskaya |
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.
I traced the intermittent ISI test failure in #640 to the existing bin-edge calculation. When all intervals are equal,
linspace(min_isi, max_isi, bins + 1)produces repeated edges. This puts every observation in the last bin and gives duplicate output indices.This uses
np.histogram_bin_edgesfor integer bins, matching NumPy's handling of a constant range while retaining shared edges for a TsGroup. Explicit bin edges are unchanged.The regression tests cover a single interval and repeated equal intervals across Ts, Tsd, TsdFrame, TsdTensor and TsGroup, with linear and log scales. The grouped test reference now uses NumPy's histogram edges too.
Checked locally on current dev: 5,390 unit tests passed, 274 skipped; Black, isort and flake8 passed. The failing implementation was identical in the base and head of #640, so I have kept this fix separate from that feature.