Repository navigation
Adapt multitaper power spectrum engines to changing window lengths - #1055
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1055 +/- ##
==========================================
+ Coverage 75.19% 75.28% +0.08%
==========================================
Files 185 185
Lines 38176 38185 +9
Branches 2587 2587
==========================================
+ Hits 28706 28746 +40
+ Misses 8544 8516 -28
+ Partials 926 923 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
pavlis
approved these changes
Oct 23, 2026
pavlis
left a comment
Collaborator
There was a problem hiding this comment.
This looks like a pretty straightforward fix. The new tests it adds indicate it solves the problem.
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.
Reusing the Prieto MTPowerSpectrumEngine with a slightly different window length raised ValueError and could make broadband_snr_QC discard otherwise valid data. Resize the operator and rebuild its length-specific tapers, retaining a sufficiently large explicit FFT size or selecting an automatic size when necessary. Failed numerical construction preserves the previous cached state.
Regression coverage checks all three input types, repeated length changes against freshly constructed engines, FFT sizing, invalid inputs, and broadband SNR using the existing waveform fixture. Native tests verify that the C++ TimeSeries overload pads/truncates while its vector overload remains strict.
Validation: 24 targeted tests passed with the real Prieto numerical backend. Black 25.1.0 and static syntax checks passed. GitHub Actions rebuilt the current native code and passed the complete test suite on Python 3.10 and 3.13, including the native-length behavior and broadband SNR regressions. CMake, Docker, formatting, static, and dependency checks also passed.
Fixes #1044.