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

[MAINT] Store 1 timepoint for 4D generating a report with the maskers #3935

Merged
merged 28 commits into from Nov 16, 2023

Conversation

ymzayek
Copy link
Member

@ymzayek ymzayek commented Aug 29, 2023

Changes proposed in this pull request:

@github-actions
Copy link
Contributor

👋 @ymzayek 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.

@ymzayek
Copy link
Member Author

ymzayek commented Sep 11, 2023

This fails because the multi subject maskers don't support report generation. The same failure can be seen on main if calling generate_report on a multi masker object. So the question is do we want to support this for the multi subject maskers? Either way I think the error needs to be improved so I can do that in this PR and can open another issue to see if we would want to support this.

@bthirion
Copy link
Member

Indeed, we should have report generation for multi subject maskers.

@ymzayek
Copy link
Member Author

ymzayek commented Sep 11, 2023

Ok I tried a few things to make this PR work and not break anything but I think a better strategy might be to better support report generation for the multi subject maskers before doing this. This is because the user could subscript the 5D list and generate_report will work as intended and trying to add a warning message about reports in fit will probably seem weird to users

@bthirion
Copy link
Member

Ok I tried a few things to make this PR work and not break anything but I think a better strategy might be to better support report generation for the multi subject maskers before doing this. This is because the user could subscript the 5D list and generate_report will work as intended and trying to add a warning message about reports in fit will probably seem weird to users

Makes sense.

@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a24bf42) 91.64% compared to head (c3bad58) 91.69%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3935      +/-   ##
==========================================
+ Coverage   91.64%   91.69%   +0.05%     
==========================================
  Files         143      144       +1     
  Lines       16113    16150      +37     
  Branches     3353     3359       +6     
==========================================
+ Hits        14767    14809      +42     
+ Misses        798      796       -2     
+ Partials      548      545       -3     
Flag Coverage Δ
macos-latest_3.10 91.60% <100.00%> (?)
macos-latest_3.11 91.60% <100.00%> (?)
macos-latest_3.12 91.60% <100.00%> (?)
macos-latest_3.9 91.57% <100.00%> (?)
ubuntu-latest_3.10 91.60% <100.00%> (?)
ubuntu-latest_3.11 91.60% <100.00%> (?)
ubuntu-latest_3.12 91.60% <100.00%> (?)
ubuntu-latest_3.9 91.57% <100.00%> (+0.05%) ⬆️
windows-latest_3.10 91.56% <100.00%> (?)
windows-latest_3.11 91.56% <100.00%> (+0.05%) ⬆️
windows-latest_3.12 91.56% <100.00%> (?)
windows-latest_3.9 91.53% <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.

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.

Technically, the PR looks good.

nilearn/maskers/multi_nifti_masker.py Outdated Show resolved Hide resolved
nilearn/maskers/tests/test_multi_nifti_labels_masker.py Outdated Show resolved Hide resolved
nilearn/maskers/tests/test_multi_nifti_maps_masker.py Outdated Show resolved Hide resolved
@ymzayek
Copy link
Member Author

ymzayek commented Oct 13, 2023

I definitely still need to add tests to this but I think it is finally in good shape for what it's intended to do

@ymzayek
Copy link
Member Author

ymzayek commented Oct 25, 2023

@Remi-Gau have you seen similar failures to the ones on windows here? I can't easily see how they are related but they are consistently failing so there is definitely something there

@Remi-Gau
Copy link
Collaborator

All of those are related to the use of the write_tmp_imgs context manager?

@Remi-Gau
Copy link
Collaborator

I think that we should probably start removing this context manager in the tests and replace it with a just creating the files in the tmp_path.

@ymzayek
Copy link
Member Author

ymzayek commented Oct 25, 2023

Seems to also happen with write_fake_fmri_data_and_design. Ok I'll see if rewriting the tests without the context manager resolves this

@Remi-Gau
Copy link
Collaborator

I am struggling to see what in the PR would start triggering those failures though.

@ymzayek
Copy link
Member Author

ymzayek commented Nov 13, 2023

Ok tests related to write_tmp_imgs are not failing anymore with the refactoring. write_fake_fmri_data_and_design seems to still be causing issues

@ymzayek ymzayek marked this pull request as ready for review November 14, 2023 16:16
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.

Copy link
Collaborator

@Remi-Gau Remi-Gau left a comment

Choose a reason for hiding this comment

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

good with me

@ymzayek ymzayek merged commit b8053f1 into nilearn:main Nov 16, 2023
29 checks passed
@ymzayek ymzayek deleted the generate_report_followup branch November 16, 2023 10:56
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.

Store one time point for reporting that uses 4D images
3 participants