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

Example to demonstrate copy_header_from in math_img #4392

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

man-shu
Copy link
Contributor

@man-shu man-shu commented Apr 19, 2024

Changes proposed in this pull request:

  • create a new example to demonstrate the functionality

Copy link
Contributor

👋 @man-shu 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 Apr 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.94%. Comparing base (abb80ff) to head (cbba0af).
Report is 70 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4392      +/-   ##
==========================================
+ Coverage   91.85%   91.94%   +0.08%     
==========================================
  Files         144      143       -1     
  Lines       16419    16639     +220     
  Branches     3434     3529      +95     
==========================================
+ Hits        15082    15299     +217     
+ Misses        792      769      -23     
- Partials      545      571      +26     
Flag Coverage Δ
macos-latest_3.11_test_plotting ?
ubuntu-latest_3.10_test_plotting ?
ubuntu-latest_3.11_test_plotting 91.81% <ø> (?)
ubuntu-latest_3.8_test_min 68.72% <ø> (?)
windows-latest_3.10_test_plotting 91.79% <ø> (?)
windows-latest_3.11_test_plotting 91.79% <ø> (?)
windows-latest_3.9_test_plotting 91.75% <ø> (?)

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 Author

man-shu commented Apr 19, 2024

The same MSDL dataset download fails during building the docs.

So maybe first merging #4390 would be better.

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.

The example LGTM.
I'm still not 100% sure that this deserves a full example, but I find it quite pedagogical, so I'm +0 for this addition.
Indeed, it has to come after #4390.

@man-shu
Copy link
Contributor Author

man-shu commented Apr 23, 2024

I'm still not 100% sure that this deserves a full example, but I find it quite pedagogical, so I'm +0 for this addition.

Yes, maybe it doesn't make much sense to have it for just one function.

But as explained in #4393, I identified the same issue in several others under the image module. So maybe a more general example would be worthwhile to have across all of them (once I have fixed them).

@bthirion
Copy link
Member

Can you propose an enhanced example ?

@man-shu
Copy link
Contributor Author

man-shu commented Apr 24, 2024

Yes, but I should fix #4393 first.

@man-shu man-shu marked this pull request as draft April 24, 2024 07:56
@man-shu
Copy link
Contributor Author

man-shu commented Apr 24, 2024

So, all the other nilearn.image functions with the same issue do not need further explanation (see #4397, they can now simply copy the header by default).

math_img remains the most peculiar, with several use cases where the default behavior could be confusing/problematic and could use this explanation. But I don't think I can change much in the current example.

@bthirion
Copy link
Member

We should decide on this at a forthcoming coredev meeting.

@man-shu man-shu marked this pull request as ready for review April 24, 2024 19:23
@man-shu man-shu removed the Blocked label Apr 25, 2024
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.

[DOC] Add an example demonstrating header copying in math_img
3 participants