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

Refactor gscontrol module #1086

Merged
merged 15 commits into from
Aug 13, 2024
Merged

Refactor gscontrol module #1086

merged 15 commits into from
Aug 13, 2024

Conversation

tsalo
Copy link
Member

@tsalo tsalo commented Apr 21, 2024

Closes #1085 (but perhaps not optimally?)

Changes proposed in this pull request:

  • Add type hints to gscontrol.gscontrol_raw and gscontrol.minimum_image_regression.
  • Use the same variable names from metric calculation within these two functions as well. E.g., data_cat instead of catd.
  • Require function calls to use keyword arguments.
  • Add verbose parameter to gscontrol.minimum_image_regression. Only write out the accepted MIR outputs if verbose=True.
    • Note that these are only composed of non-low-variance components at the moment.
  • In minimum_image_regression, use classification tags to split up accepted components into BOLD-like and low-variance groups, to match the old "accepted" and "ignored" classifications.

@tsalo tsalo added the refactoring issues proposing/requesting changes to the code which do not impact behavior label Apr 21, 2024
@tsalo tsalo requested a review from handwerkerd April 21, 2024 15:11
Copy link

codecov bot commented Apr 21, 2024

Codecov Report

Attention: Patch coverage is 95.71429% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 89.87%. Comparing base (0f6cbe1) to head (c491cc3).

Files Patch % Lines
tedana/gscontrol.py 94.91% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1086      +/-   ##
==========================================
- Coverage   89.91%   89.87%   -0.05%     
==========================================
  Files          26       26              
  Lines        3621     3634      +13     
  Branches      629      632       +3     
==========================================
+ Hits         3256     3266      +10     
- Misses        214      216       +2     
- Partials      151      152       +1     

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

data_cat_nogs : (S x E x T) array_like
Input ``data_cat`` with global signal removed from time series.
data_optcom_nogs : (S x T) array_like
Input ``data_optcom`` with global signal removed from time series.
"""
LGR.info("Applying amplitude-based T1 equilibration correction")
Copy link
Member Author

Choose a reason for hiding this comment

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

Is this accurate?

Copy link
Member

Choose a reason for hiding this comment

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

I didn't write the original function, but this looks fine to me.

@tsalo tsalo merged commit 432b0fe into ME-ICA:main Aug 13, 2024
14 checks passed
@tsalo tsalo deleted the refactor-gscontrol branch August 13, 2024 16:09
@tsalo tsalo added the bug issues describing a bug or error found in the project label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues describing a bug or error found in the project refactoring issues proposing/requesting changes to the code which do not impact behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minimum image regression relies on distinction between "accepted" and "ignored" components
2 participants