Skip to content

Commit

Permalink
only fetch tarfile if it doesn't exist already
Browse files Browse the repository at this point in the history
  • Loading branch information
sappelhoff authored and jasmainak committed Aug 19, 2019
1 parent 3da5e3a commit 91b8fde
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mne_bids/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def fetch_faces_data(data_path=None, repo='ds000117', subject_ids=[1]):
src_url = ('http://openfmri.s3.amazonaws.com/tarballs/'
'ds117_R0.1.1_{}_raw.tgz'.format(sub_str))
tar_fname = op.join(data_path, repo, sub_str + '.tgz')
_fetch_file(url=src_url, file_name=tar_fname, print_destination=True)
if not op.exists(tar_fname):
_fetch_file(url=src_url, file_name=tar_fname,
print_destination=True)

# Unpack the downloaded archive to the correct location
tf = tarfile.open(tar_fname)
Expand Down

0 comments on commit 91b8fde

Please sign in to comment.