Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit 48c2de8

Browse files
committed
fix: downloading a subject from HBN works
1 parent a0711a4 commit 48c2de8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

dmriprep/data.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"""
55
from .base import InputFiles, InputFilesWithSession
66
import os
7+
import os.path as op
8+
from pathlib import Path
79

810

911
def get_dataset(output_dir, source='HBN'):
@@ -26,7 +28,7 @@ def get_hbn_data(output_dir):
2628
site='Site-{}'.format(site),
2729
raw_keys=raw_keys,
2830
deriv_keys=deriv_keys)
29-
download_register(register, directory=output_dir)
31+
download_register(register, s3_client=s3_client, directory=output_dir)
3032
# TODO: return a dict of subject ids and folder locations.
3133
return os.path.join(output_dir, subject)
3234

@@ -252,7 +254,8 @@ def get_subject_id(key):
252254
return s3_registers
253255

254256

255-
def download_register(subject_keys, bucket='fcp-indi', directory='./input',
257+
def download_register(subject_keys, s3_client,
258+
bucket='fcp-indi', directory='./input',
256259
overwrite=False):
257260
"""
258261
Parameters
@@ -306,7 +309,9 @@ def download_from_s3(fname_, bucket_, key_):
306309
# Download the file
307310
s3_client.download_file(Bucket=bucket_, Key=key_, Filename=fname_)
308311
except FileExistsError:
309-
mod_logger.info('File {fname:s} already exists. Continuing...')
312+
pass
313+
# TODO: add back logging
314+
# mod_logger.info('File {fname:s} already exists. Continuing...')
310315

311316
s3keys = subject_keys.files
312317
files = input_files.files

0 commit comments

Comments
 (0)