Skip to content

Commit 934f8d0

Browse files
committed
merge JSON interfaces
1 parent ac59a94 commit 934f8d0

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

nipype/interfaces/io.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,14 +1802,17 @@ def _get_ssh_client(self):
18021802
client.connect(host['hostname'], username=host['user'], sock=proxy)
18031803
return client
18041804

1805+
18051806
class JSONFileGrabberInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec):
18061807
in_file = File(exists=True, mandatory=True,
18071808
desc='JSON source file')
18081809

1810+
18091811
class JSONFileGrabber(IOBase):
1812+
18101813
"""
1811-
Datagrabber module that loads a json file and generates an output for every
1812-
first-level object
1814+
Datagrabber interface that loads a json file and generates an output for
1815+
every first-level object
18131816
18141817
Example
18151818
-------
@@ -1828,7 +1831,6 @@ class JSONFileGrabber(IOBase):
18281831
output_spec = DynamicTraitedSpec
18291832
_always_run = True
18301833

1831-
18321834
def _list_outputs(self):
18331835
import json
18341836

@@ -1854,6 +1856,7 @@ class JSONFileSinkOutputSpec(TraitedSpec):
18541856

18551857

18561858
class JSONFileSink(IOBase):
1859+
18571860
""" Very simple frontend for storing values into a JSON file.
18581861
18591862
.. warning::
@@ -1864,7 +1867,8 @@ class JSONFileSink(IOBase):
18641867
Examples
18651868
--------
18661869
1867-
>>> jsonsink = JSONFileSink(input_names=['subject_id', 'some_measurement'])
1870+
>>> jsonsink = JSONFileSink(input_names=['subject_id',
1871+
... 'some_measurement'])
18681872
>>> jsonsink.inputs.subject_id = 's1'
18691873
>>> jsonsink.inputs.some_measurement = 11.4
18701874
>>> jsonsink.run() # doctest: +SKIP
@@ -1897,3 +1901,4 @@ def _list_outputs(self):
18971901
outputs = self.output_spec().get()
18981902
outputs['out_file'] = out_file
18991903
return outputs
1904+

0 commit comments

Comments
 (0)