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

[ENH] Add warning for future change of the default of force_resample to True #4412

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

Conversation

ajoshiusc
Copy link

@ajoshiusc ajoshiusc commented May 13, 2024

The force_resample=False which is currently default, the code is not implemented correctly. There are several of #TODO flags in the code for force_resample=False case. Therefore, changed the default option to force_resample=True.

changed  force_resample=True to be default for the functions resample_img and resample_to_img.
Copy link
Contributor

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

@ajoshiusc ajoshiusc changed the title Update resampling.py Update resampling.py The default was changed to force_resample=True May 13, 2024
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 for opening this !

nilearn/image/resampling.py Outdated Show resolved Hide resolved
@Remi-Gau Remi-Gau changed the title Update resampling.py The default was changed to force_resample=True [CODE] Add warning for future change of the default of force_resample to True Jun 4, 2024
@Remi-Gau Remi-Gau changed the title [CODE] Add warning for future change of the default of force_resample to True [ENH] Add warning for future change of the default of force_resample to True Jun 4, 2024
@Remi-Gau
Copy link
Collaborator

Remi-Gau commented Jun 4, 2024

@ajoshiusc I went ahead and added the required changes to implement the deprecation and make the old default value explicit in the tests.

@Remi-Gau
Copy link
Collaborator

Remi-Gau commented Jun 4, 2024

Can you add your contributor information in the CITATION.CFF

See our contributing guidelines
https://nilearn.github.io/stable/development.html#changelog

For example

  - given-names: Dimitri Papadopoulos
    family-names: Orfanos
    website: https://github.com/DimitriPapadopoulos
    affiliation: NeuroSpin, C.E.A., Université Paris-Saclay, Gif-sur-Yvette, France
    orcid: https://orcid.org/0000-0002-1242-8990

@Remi-Gau Remi-Gau requested review from bthirion and man-shu June 4, 2024 08:55
Copy link

codecov bot commented Jun 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.99%. Comparing base (abb80ff) to head (cc7bbfe).
Report is 82 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4412      +/-   ##
==========================================
+ Coverage   91.85%   91.99%   +0.13%     
==========================================
  Files         144      145       +1     
  Lines       16419    16716     +297     
  Branches     3434     3552     +118     
==========================================
+ Hits        15082    15378     +296     
+ Misses        792      767      -25     
- Partials      545      571      +26     
Flag Coverage Δ
macos-latest_3.10_test_plotting 91.78% <100.00%> (?)
macos-latest_3.11_test_plotting ?
macos-latest_3.8_test_plotting 91.74% <100.00%> (?)
macos-latest_3.9_test_plotting 91.74% <100.00%> (?)
ubuntu-latest_3.10_test_plotting 91.78% <100.00%> (-0.08%) ⬇️
ubuntu-latest_3.11_test_plotting 91.78% <100.00%> (?)
ubuntu-latest_3.12_test_plotting 91.78% <100.00%> (?)
ubuntu-latest_3.12_test_pre 91.78% <100.00%> (?)
ubuntu-latest_3.8_test_min 68.76% <100.00%> (?)
ubuntu-latest_3.8_test_plot_min 91.44% <100.00%> (?)
ubuntu-latest_3.8_test_plotting 91.74% <100.00%> (?)
ubuntu-latest_3.9_test_plotting 91.74% <100.00%> (?)
windows-latest_3.10_test_plotting 91.77% <100.00%> (?)
windows-latest_3.11_test_plotting 91.77% <100.00%> (?)
windows-latest_3.12_test_plotting 91.77% <100.00%> (?)
windows-latest_3.8_test_plotting 91.73% <100.00%> (?)
windows-latest_3.9_test_plotting 91.73% <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
Contributor

Choose a reason for hiding this comment

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

I see that all the tests are for the force_resample=False case.
Would it make sense to have one for the True case?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah that makes sense

Copy link
Member

Choose a reason for hiding this comment

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

Please do it.

@Remi-Gau Remi-Gau mentioned this pull request Jun 5, 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.

Different results when using resample_to_img function
4 participants