Fix: cbt() and dlmos() now support batch trajectories#54
Open
ftavella wants to merge 1 commit into
Open
Conversation
Add _cbt_single() helper that detects CBT minima from a 1-D signal. Update cbt() for all models (Forger99, Hannay19, Hannay19TP, Jewett99, Hilaire07, Breslow13, Skeldon23) to loop over batches when batch_size > 1, returning a list of arrays. Single-trajectory calls return a plain array as before (backward compatible). dlmos() is unaffected since it delegates to cbt(). Also fix pkg_resources import in setup.py for setuptools >= 82. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
Fixes #38
cbt()anddlmos()previously failed with aValueErrorwhen the trajectory had multiple initial conditions (batch size > 1), becausefind_peaksrequires a 1-D array.Changes
_cbt_single()private helper that runs peak detection on a single 1-D signalcbt()for all 7 models (Forger99, Hannay19, Hannay19TP, Jewett99, Hilaire07, Breslow13, Skeldon23) to detect batch trajectories and return a list of arrays — one per batchnp.ndarrayas before (fully backward compatible)dlmos()gains batch support automatically since it delegates tocbt()Tests
Added batch tests to
test_models.ipynbforForger99.cbt()andForger99.dlmos()verifying:listfor batch trajectoriescbt()of the corresponding individual trajectory