Skip to content

Conversation

@TomDonoghue
Copy link
Member

@TomDonoghue TomDonoghue commented Mar 7, 2025

In recent neurodsp updates, we got a bit stricter about filter parameters & inputs here

In the bycycle find_extrema function, it takes filter kwargs, and then uses any given arguments to compute the length of the filter for doing some extra padding. Because we are now stricter, some inputs can now fail (for example, as done in tutorial # 2), if trying to pass in a specified n_seconds filter kwarg:

peaks, troughs = find_extrema(sig, fs, range, filter_kwargs={'n_seconds':n_seconds})

This is because the function also default n_cycles to 3, leading to both inputs being defined and passed in, and while this used to work, neurodsp no longer allows this kind of inconsistent input.

To address this, this PR updates the filter_kwargs management, to only default to setting n_cycles to the default value of 3 if there are no specified filter kwargs.

@bycycle-tools bycycle-tools deleted a comment from codecov bot Mar 7, 2025
@TomDonoghue TomDonoghue requested a review from ryanhammonds March 7, 2025 06:01
@bycycle-tools bycycle-tools deleted a comment from codecov bot Mar 7, 2025
@bycycle-tools bycycle-tools deleted a comment from codecov bot Mar 7, 2025
Copy link
Member

@ryanhammonds ryanhammonds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, looks good to me

@ryanhammonds ryanhammonds merged commit 4fa78a0 into main Mar 9, 2025
10 checks passed
@codecov
Copy link

codecov bot commented Mar 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.21%. Comparing base (13b4223) to head (01d1d70).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #153   +/-   ##
=======================================
  Coverage   95.20%   95.21%           
=======================================
  Files          23       23           
  Lines         918      919    +1     
=======================================
+ Hits          874      875    +1     
  Misses         44       44           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants