-
Notifications
You must be signed in to change notification settings - Fork 580
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
do not fail if metadata cannot be updated for an image #2167
do not fail if metadata cannot be updated for an image #2167
Conversation
Add your opening comment into the error message. The current one does not explain what's really going on. |
nilearn/datasets/neurovault.py
Outdated
_write_metadata(image_info, metadata_file_path) | ||
except OSError: | ||
warnings.warn("could not update metadata for image {}".format( | ||
image_info["id"])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to only include the error generating step in the try block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all statements except the third can fail because of write permissions
Codecov Report
@@ Coverage Diff @@
## master #2167 +/- ##
=========================================
- Coverage 92.31% 92.3% -0.01%
=========================================
Files 149 149
Lines 18786 18789 +3
Branches 2291 2291
=========================================
+ Hits 17342 17343 +1
- Misses 922 924 +2
Partials 522 522
Continue to review full report at Codecov.
|
* 'master' of github.com:nilearn/nilearn: Fix cache mixin tests (nilearn#2161) Do not fail if metadata cannot be updated for an image (nilearn#2167) [MRG] Nans in view connectome (nilearn#2166)
…nt_modify_fetch_dev * 'master' of https://github.com/nilearn/nilearn: ENH: add connectome strength plot (nilearn#2028) Fix cache mixin tests (nilearn#2161) Do not fail if metadata cannot be updated for an image (nilearn#2167)
…ecomposition * 'master' of https://github.com/nilearn/nilearn: Fix Flake8 errors overlooked when merging PR nilearn#2028 (Plot connectome strength) (nilearn#2174) ENH: add connectome strength plot (nilearn#2028) Fix cache mixin tests (nilearn#2161) Do not fail if metadata cannot be updated for an image (nilearn#2167) [MRG] Nans in view connectome (nilearn#2166)
…smooth-image * 'master' of https://github.com/nilearn/nilearn: (114 commits) [DOC] Update whats_new to reference nilearn#2013 (Merging of several examples) (nilearn#2183) Removed sub-example due to unfit for lasso dataset - unstable float values (nilearn#2177) Fix Flake8 errors overlooked when merging PR nilearn#2028 (Plot connectome strength) (nilearn#2174) ENH: add connectome strength plot (nilearn#2028) Fix cache mixin tests (nilearn#2161) Do not fail if metadata cannot be updated for an image (nilearn#2167) [MRG] Nans in view connectome (nilearn#2166) [MRG] FIX: orientation problem with plot_glass_brain (nilearn#1888) Import HTMLDocument in its original module to preserve backwards compatibility (nilearn#2162) Fixing malfunctioning allowed-failure section in Travis (nilearn#2160) Update Brainomics fetcher (nilearn#2097) Remove inplace modification in signal.clean (nilearn#2125) Iter age group prediction example (nilearn#2063) Expose bg_img, vmin and vmax in plot_img signature (nilearn#2157) Replac conda with pip in TravisCI setup (nilearn#2141) Core devs doc and add @emdupre (nilearn#2151) Add check for vmin, vmax in plot_surf_roi (nilearn#2052) [ENH] Initial visual reports (nilearn#2019) Renamed test to deduplicate name (nilearn#2144) Fixes nilearn#2029 Handle gzip files without extensions (nilearn#2126) ...
* Updated .mailmap * Updated contributors list * Removed unsupported python versions from PyPI tags * Added whats_new entry for PR #2167 * Updated Whats whats_new list of contributors
…te-req-dev * 'master' of https://github.com/nilearn/nilearn: (336 commits) Release Nilearn 0.6.0 alpha (nilearn#2164) Making fetch_localizer_button_task backwards compatibile (nilearn#2182) [DOC] Update whats_new to reference nilearn#2013 (Merging of several examples) (nilearn#2183) Removed sub-example due to unfit for lasso dataset - unstable float values (nilearn#2177) Fix Flake8 errors overlooked when merging PR nilearn#2028 (Plot connectome strength) (nilearn#2174) ENH: add connectome strength plot (nilearn#2028) Fix cache mixin tests (nilearn#2161) Do not fail if metadata cannot be updated for an image (nilearn#2167) [MRG] Nans in view connectome (nilearn#2166) [MRG] FIX: orientation problem with plot_glass_brain (nilearn#1888) Import HTMLDocument in its original module to preserve backwards compatibility (nilearn#2162) Fixing malfunctioning allowed-failure section in Travis (nilearn#2160) Update Brainomics fetcher (nilearn#2097) Remove inplace modification in signal.clean (nilearn#2125) Iter age group prediction example (nilearn#2063) Expose bg_img, vmin and vmax in plot_img signature (nilearn#2157) Replac conda with pip in TravisCI setup (nilearn#2141) Core devs doc and add @emdupre (nilearn#2151) Add check for vmin, vmax in plot_surf_roi (nilearn#2052) [ENH] Initial visual reports (nilearn#2019) ...
In some cases the neurovault fetcher tries to update the metadata. at the moment this can fail if the user has write permission for the neurovault data directory, but not for the metadata file of a particular image for some weird reason. this pr skips these updates with a warning