-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix pooch #9802
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
Fix pooch #9802
Conversation
This will conflict with #9800, but @alexrockhill is an expert merger at this point so I think it's okay :) |
mne/datasets/utils.py
Outdated
| # 2. get_config(key) | ||
| # 3. get_config('MNE_DATA') | ||
| path = get_config(key, get_config('MNE_DATA')) | ||
| path = get_config(key or 'MNE_DATA') |
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.
I don't quite get this one. It means that before if the config for the given key did not exist, we would use MNE_DATA, but now we only do so if key is None? This seems like an incorrect change in behavior?
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.
None is a sentinel value for get_config() that returns all config keys and their values that are defined in the config file. But here, key being None actually means something different (viz, "this dataset is MNE-external and is not kept track of in the config")
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.
so this change makes it so that, when key is None, we get the config value for "MNE_DATA" instead of a big dict of all defined config values.
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.
put another way, it updates the _get_path() function to gracefully handle key=None input, which previously it was not designed to handle.
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.
Ahh that makes sense, thanks!
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.
Actually you're right, maybe this should still include the fallback of get_config('MNE_DATA') for cases of non-empty strings that aren't valid config keys?
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.
Or valid ones that aren't set yet in the config, which is pretty common -- people just set MNE_DATA once then all downloads just automatically go to that location
This reverts commit 7ae8463.
|
@adam2392 can you review? |
@drammock can you force CIs to do some review work for us, too, by creating some new test that fails on Feel free to ignore if this does not make sense or you were going to do this anyway... |
done. |
adam2392
left a comment
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.
This LGTM.
Note: fatiando/pooch#266 will fix our issues with uncompressing members that are sub-directories.
did you test out fatiando/pooch#266 locally then? You should report back the result on that PR. |
|
CI fails are unrelated:
|
|
Thanks @drammock ! |
This reverts commit 32f4ee8.
|
@drammock we'll be pushing a new release of Pooch today that should fix this bug. Please feel free to reopen the issue linked above if the problem persists. |
Fixes a variety of problems with the implementation of
fetch_dataset(). Also updates the version number and hash of the MNE-misc dataset, which just got a new release today.