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 readme to default data locations #4037

Merged
merged 4 commits into from Oct 13, 2023
Merged

Conversation

Remi-Gau
Copy link
Collaborator

@Remi-Gau Remi-Gau commented Oct 7, 2023

Changes proposed in this pull request:

  • add readme in default data location to let user know it is sage to remove this folder

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2023

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

@codecov
Copy link

codecov bot commented Oct 7, 2023

Codecov Report

Merging #4037 (4aa7a0c) into main (7739f95) will decrease coverage by 0.18%.
Report is 10 commits behind head on main.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #4037      +/-   ##
==========================================
- Coverage   91.75%   91.57%   -0.18%     
==========================================
  Files         145      143       -2     
  Lines       16222    16066     -156     
  Branches     3370     3336      -34     
==========================================
- Hits        14884    14712     -172     
- Misses        795      811      +16     
  Partials      543      543              
Flag Coverage Δ
macos-latest_3.10 91.49% <100.00%> (-0.19%) ⬇️
macos-latest_3.11 91.49% <100.00%> (-0.19%) ⬇️
macos-latest_3.12 91.49% <100.00%> (-0.19%) ⬇️
macos-latest_3.8 91.45% <100.00%> (-0.19%) ⬇️
macos-latest_3.9 91.45% <100.00%> (-0.19%) ⬇️
ubuntu-latest_3.10 91.49% <100.00%> (?)
ubuntu-latest_3.11 91.49% <100.00%> (?)
ubuntu-latest_3.12 91.49% <100.00%> (-0.19%) ⬇️
ubuntu-latest_3.8 91.45% <100.00%> (-0.19%) ⬇️
ubuntu-latest_3.9 91.45% <100.00%> (-0.19%) ⬇️
windows-latest_3.10 91.43% <100.00%> (-0.19%) ⬇️
windows-latest_3.11 91.43% <100.00%> (-0.19%) ⬇️
windows-latest_3.12 91.43% <100.00%> (-0.19%) ⬇️
windows-latest_3.8 91.39% <100.00%> (-0.19%) ⬇️
windows-latest_3.9 91.40% <100.00%> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
nilearn/datasets/utils.py 76.38% <100.00%> (+0.52%) ⬆️

... and 10 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Remi-Gau Remi-Gau marked this pull request as ready for review October 8, 2023 11:53
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 otherwise.

nilearn/datasets/utils.py Outdated Show resolved Hide resolved
Co-authored-by: bthirion <bertrand.thirion@inria.fr>
@Remi-Gau
Copy link
Collaborator Author

Remi-Gau commented Oct 9, 2023

@bthirion @ymzayek
Does this need a test? I am leaning that this is a bit of an overkill but happy to add one if you feel otherwise.

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.

LGTM! Maybe not necessary but it would be good to just test that the file is created in the right location.

Comment on lines -19 to -21
from nilearn import datasets
from nilearn.datasets import utils
from nilearn.datasets.utils import _get_dataset_descr
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

unrelated but simplified the imports a bit

Comment on lines +125 to +128
def test_add_readme_to_default_data_locations(tmp_path):
assert not (tmp_path / "README.md").exists()
utils._get_dataset_dir(dataset_name="test", verbose=0, data_dir=tmp_path)
assert (tmp_path / "README.md").exists()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

simple test added

@Remi-Gau Remi-Gau merged commit fb061fc into nilearn:main Oct 13, 2023
31 checks passed
@Remi-Gau Remi-Gau deleted the add_readme branch October 13, 2023 08:05
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.

Add a README.txt file in the nilearn_data folder
3 participants