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] relocate functions from nilearn.datasets.utils #4154

Merged
merged 2 commits into from Dec 13, 2023

Conversation

Remi-Gau
Copy link
Collaborator

@Remi-Gau Remi-Gau commented Dec 12, 2023

Changes proposed in this pull request:

  • relocate load_sample_motor_activation_image
  • throw deprecation warning when imported from the older location

TODO

  • add test for deprecation warning
  • relocate get_data_dirs

Copy link
Contributor

👋 @Remi-Gau 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.

@Remi-Gau
Copy link
Collaborator Author

regarding

def get_data_dirs(data_dir=None):

If we still want to move it, maybe actually adding directly to
nilearn/datasets/__init__.py ? Not sure how pythonic that is.

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (af37456) 91.71% compared to head (2444d83) 91.84%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4154      +/-   ##
==========================================
+ Coverage   91.71%   91.84%   +0.13%     
==========================================
  Files         145      145              
  Lines       16337    16343       +6     
  Branches     3407     3407              
==========================================
+ Hits        14983    15010      +27     
+ Misses        810      788      -22     
- Partials      544      545       +1     
Flag Coverage Δ
macos-latest_3.10_test_plotting 91.70% <100.00%> (+<0.01%) ⬆️
macos-latest_3.11_test_plotting 91.70% <100.00%> (+<0.01%) ⬆️
macos-latest_3.12_test_plotting 91.70% <100.00%> (+<0.01%) ⬆️
macos-latest_3.8_test_plotting 91.66% <100.00%> (+<0.01%) ⬆️
macos-latest_3.9_test_plotting 91.66% <100.00%> (+<0.01%) ⬆️
ubuntu-latest_3.10_test_plotting 91.70% <100.00%> (+<0.01%) ⬆️
ubuntu-latest_3.11_test_plotting 91.70% <100.00%> (+<0.01%) ⬆️
ubuntu-latest_3.12_test_plotting 91.70% <100.00%> (+<0.01%) ⬆️
ubuntu-latest_3.12_test_pre ?
ubuntu-latest_3.8_test_min 68.87% <100.00%> (?)
ubuntu-latest_3.8_test_plotting 91.66% <100.00%> (+<0.01%) ⬆️
ubuntu-latest_3.9_test_plotting ?
windows-latest_3.10_test_plotting 91.67% <100.00%> (+<0.01%) ⬆️
windows-latest_3.11_test_plotting 91.67% <100.00%> (+<0.01%) ⬆️
windows-latest_3.12_test_plotting 91.67% <100.00%> (+<0.01%) ⬆️
windows-latest_3.8_test_plotting ?
windows-latest_3.9_test_plotting 91.64% <100.00%> (+<0.01%) ⬆️

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.

I guess you need to test the warnings but this looks good so far.

nilearn/datasets/utils.py Outdated Show resolved Hide resolved
@Remi-Gau
Copy link
Collaborator Author

Don't think it is worth relocating get_data_dirs unless we get active complaint from users (or our future selves) that having nilearn.datasets._utils and nilearn.datasets.utils is confusing.

Copy link
Member

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

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.

@Remi-Gau Remi-Gau merged commit be0ad56 into nilearn:main Dec 13, 2023
32 checks passed
@Remi-Gau Remi-Gau deleted the datasets_utils branch December 13, 2023 20:43
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.

Relocate functions from datasets.utils
3 participants