Skip to content

Commit b0ce2e1

Browse files
authored
Merge pull request #2849 from nipy/satra-doc-s3grab
DOC: Add S3DataGrabber example
2 parents 80dfc86 + bd1ab8a commit b0ce2e1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

nipype/interfaces/io.py

+17
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,24 @@ class S3DataGrabber(LibraryBaseInterface, IOBase):
829829
"template" uses regex style formatting, rather than the
830830
glob-style found in the original DataGrabber.
831831
832+
Examples
833+
--------
834+
835+
>>> s3grab = S3DataGrabber(infields=['subj_id'], outfields=["func", "anat"])
836+
>>> s3grab.inputs.bucket = 'openneuro'
837+
>>> s3grab.inputs.sort_filelist = True
838+
>>> s3grab.inputs.template = '*'
839+
>>> s3grab.inputs.anon = True
840+
>>> s3grab.inputs.bucket_path = 'ds000101/ds000101_R2.0.0/uncompressed/'
841+
>>> s3grab.inputs.local_directory = '/tmp'
842+
>>> s3grab.inputs.field_template = {'anat': '%s/anat/%s_T1w.nii.gz',
843+
... 'func': '%s/func/%s_task-simon_run-1_bold.nii.gz'}
844+
>>> s3grab.inputs.template_args = {'anat': [['subj_id', 'subj_id']],
845+
... 'func': [['subj_id', 'subj_id']]}
846+
>>> s3grab.inputs.subj_id = 'sub-01'
847+
>>> s3grab.run() # doctest: +SKIP
832848
"""
849+
833850
input_spec = S3DataGrabberInputSpec
834851
output_spec = DynamicTraitedSpec
835852
_always_run = True

0 commit comments

Comments
 (0)