-
Notifications
You must be signed in to change notification settings - Fork 109
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
[WIP] Framework to download entities from Zenodo #675
[WIP] Framework to download entities from Zenodo #675
Conversation
Oh that is super simple: import pooch
files = pooch.retrieve(
url='doi:10.5281/zenodo.4263723/tvb_data.zip',
known_hash=None,
downloader=pooch.DOIDownloader(),
processor=pooch.Unzip()
) The download is cached, and you can also substitute the |
…l just focus on the downloading functionality. If required searching functionalities can be added
I will improve the docs and tests soon. an example how user can download and fetch the data. from tvb.datasets import TVB_Data
tvb_data = TVB_Data(version = "2.0.3")
connectivity_66_path = tvb_data.fetch_data("connectivity_66.zip")
print(connectivity_66_path, connectivity_66_path.is_file())
ql_bold_path = tvb_data.fetch_data("QL_BOLD_regiontimecourse.mat")
print(ql_bold_path, ql_bold_path.is_file())
output of the above script. file tvb_data.zip is downloaded at /home/abhijit/.cache/pooch/df068f14e199441033182c2ea36820e8-tvb_data.zip
/home/abhijit/oss/gsoc/tvb-root/tvb_library/tvb_data/connectivity/connectivity_66.zip True
/home/abhijit/oss/gsoc/tvb-root/tvb_library/tvb_data/berlinSubjects/QL_20120814/QL_BOLD_regiontimecourse.mat True
|
tvb_library/tvb/datasets/zenodo.py
Outdated
|
||
file_path = pooch.retrieve(url= url, known_hash= known_hash, progressbar=True) |
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.
as im using pooch.retrieve, the files are downloaded to ~/.cache/pooch
, I plan to change this to ~/.cache/tvb
.
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.
Can we use here the target_download param that we discussed earlier ?
… data using new method
Using Pyzenodo3 to download the repositories.
Still work in progress. Could think of using
Pooch
to handle the downloading and remove theutils.py
.