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

FIX: Don't print a progbar for downloading unless you need to. #2701

Merged
merged 1 commit into from
Dec 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 9 additions & 5 deletions dipy/data/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -1761,12 +1761,16 @@ def fetch_hcp(subjects,
f'sub-{subject}_aparc+aseg_seg.nii.gz')] =\
f'{study}/{subject}/T1w/aparc+aseg.nii.gz'

with tqdm(total=len(data_files.keys())) as pbar:
for k in data_files.keys():
pbar.set_description_str(f"Downloading {k}")
if not op.exists(k):
download_files = {}
for k in data_files.keys():
if not op.exists(k):
download_files[k] = data_files[k]
if len(download_files.keys()):
with tqdm(total=len(download_files.keys())) as pbar:
for k in download_files.keys():
pbar.set_description_str(f"Downloading {k}")
bucket.download_file(data_files[k], k)
pbar.update()
pbar.update()

# Create the BIDS dataset description file text
hcp_acknowledgements = """Data were provided by the Human Connectome Project, WU-Minn Consortium (Principal Investigators: David Van Essen and Kamil Ugurbil; 1U54MH091657) funded by the 16 NIH Institutes and Centers that support the NIH Blueprint for Neuroscience Research; and by the McDonnell Center for Systems Neuroscience at Washington University.""", # noqa
Expand Down