Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Raise error if unknown kwargs are given to first_level_from_bids #4414

Merged
merged 7 commits into from
May 23, 2024

Conversation

michellewang
Copy link
Contributor

Changes proposed in this pull request:

  • Make _check_kwargs_load_confounds return unused remaining_kwargs in addition to kwargs_load_confounds
  • Throw an error in first_level_from_bids if there are any remaining kwargs after the confound ones are extracted
    • Not sure if this is too strong, we could also raise a warning instead

Copy link
Contributor

👋 @michellewang Thanks for creating a PR!

Until this PR is ready for review, you can include the [WIP] tag in its title, or leave it as a github draft.

Please make sure it is compliant with our contributing guidelines. In particular, be sure it checks the boxes listed below.

  • PR has an interpretable title.
  • PR links to Github issue with mention Closes #XXXX (see our documentation on PR structure)
  • Code is PEP8-compliant (see our documentation on coding style)
  • Changelog or what's new entry in doc/changes/latest.rst (see our documentation on PR structure)

For new features:

  • There is at least one unit test per new function / class (see our documentation on testing)
  • The new feature is demoed in at least one relevant example.

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

We will review it as quick as possible, feel free to ping us with questions if needed.

Copy link

codecov bot commented May 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.95%. Comparing base (abb80ff) to head (8a42ebf).
Report is 72 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4414      +/-   ##
==========================================
+ Coverage   91.85%   91.95%   +0.09%     
==========================================
  Files         144      143       -1     
  Lines       16419    16646     +227     
  Branches     3434     3531      +97     
==========================================
+ Hits        15082    15307     +225     
+ Misses        792      769      -23     
- Partials      545      570      +25     
Flag Coverage Δ
macos-latest_3.11_test_plotting ?
ubuntu-latest_3.10_test_plotting ?
ubuntu-latest_3.12_test_plotting 91.81% <100.00%> (?)
ubuntu-latest_3.12_test_pre 91.81% <100.00%> (?)
ubuntu-latest_3.8_test_min 68.74% <100.00%> (?)
windows-latest_3.10_test_plotting 91.79% <100.00%> (?)
windows-latest_3.11_test_plotting 91.79% <100.00%> (?)
windows-latest_3.12_test_plotting 91.79% <100.00%> (?)
windows-latest_3.8_test_plotting 91.75% <100.00%> (?)
windows-latest_3.9_test_plotting 91.76% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@man-shu
Copy link
Contributor

man-shu commented May 21, 2024

Thanks for the contribution, @michellewang!
Is this ready for review?

@michellewang
Copy link
Contributor Author

@man-shu it is now!

Copy link
Contributor

@man-shu man-shu left a comment

Choose a reason for hiding this comment

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

LGTM otherwise. Thanks!

nilearn/glm/first_level/first_level.py Outdated Show resolved Hide resolved
nilearn/glm/tests/test_first_level.py Show resolved Hide resolved
@man-shu man-shu requested review from bthirion and Remi-Gau May 21, 2024 14:38
Co-authored-by: Himanshu Aggarwal <himanshuaggarwal1997@gmail.com>
michellewang and others added 3 commits May 21, 2024 11:19
Co-authored-by: Himanshu Aggarwal <himanshuaggarwal1997@gmail.com>
Copy link
Member

@bthirion bthirion left a comment

Choose a reason for hiding this comment

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

Thx.
I'm not sure I undertsand the behavior of the function. Please correct me if I'm wrong.

nilearn/glm/first_level/first_level.py Show resolved Hide resolved
Copy link
Member

@bthirion bthirion left a comment

Choose a reason for hiding this comment

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

LGTM, thx.

@man-shu man-shu merged commit 8295ffa into nilearn:main May 23, 2024
30 checks passed
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.

[ENH] Throw error when extra kwargs are given to glm.first_level.first_level_from_bids
3 participants