Skip to content

Allow changing of storage location - #195

Merged
sylvchev merged 8 commits into
NeuroTechX:masterfrom
Div12345:store_loc
Jun 12, 2021
Merged

sylvchev merged 8 commits into
NeuroTechX:masterfrom
Div12345:store_loc

Conversation

@Div12345

@Div12345 Div12345 commented Jun 7, 2021

Copy link
Copy Markdown
Contributor

A new storage location can be set by -
moabb.set_download_dir(new_path)

The problem was that the config for the new datasets were being set to ~/mne_data even before querying the mne config which is done in mne utils function _get_path in the line -
path = get_config(key, get_config('MNE_DATA'))

@sylvchev sylvchev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You need also to modify moabb/datasets/physionet_mi.py that have a specific download process.

Comment thread moabb/datasets/download.py Resolved
Comment thread moabb/datasets/download.py Resolved
Comment thread moabb/datasets/download.py Resolved
Location of where to look for the data storing location.
If None, the environment variable or config parameter
``MNE_DATASETS_(signifier)_PATH`` is used. If it doesn't exist, the
"~/mne_data" directory is used. If the dataset

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You could remove the update_path argument from the function in data_dl.

Usually when you change the signature of a function (the name or number of arguments), this is an API break and require a major update, like going from MOABB v0.3.0 to 1.0.0

Here, it is a special case, as we don't need to consider that API compatibility is broken as I just introduced this function, it is still in "dev branch".

For the data_path function just above, we need to keep the update_pathargument, as the code is released and stable and someone may have use this function. We could not break it without warning.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Has data_dl only been used in BNCI and SSVEPEXO?

Comment thread moabb/utils.py Resolved
Comment thread moabb/utils.py
)


def set_download_dir(path):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you create a new function, you will need to create a test, to verify that everything is working well.

I could help you, MOABB uses unitttest which is powerful but a little bit complicated.

@sylvchev

sylvchev commented Jun 12, 2021 •

Copy link
Copy Markdown
Member

Everything's good, merging!
We could add an example and some unittest in a next PR.

@sylvchev sylvchev added this to the 0.4.0 milestone Jun 12, 2021
@sylvchev
sylvchev merged commit 6776ea8 into NeuroTechX:master Jun 12, 2021
@Div12345
Div12345 deleted the store_loc branch June 12, 2021 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants