Skip to content

Commit a348684

Browse files
committed
fixed some PEP8 errors
1 parent 4547ff6 commit a348684

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

nipype/pipeline/engine.py

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,31 +1259,36 @@ class GraftWorkflow(InterfacedWorkflow):
12591259
_children = dict()
12601260
_outnodes = dict()
12611261

1262-
def __init__(self, name, base_dir=None, fields_from=None, input_names=[], output_names=[]):
1262+
def __init__(self, name, base_dir=None, fields_from=None,
1263+
input_names=[], output_names=[]):
12631264
"""
12641265
Initializes the workflow from an existing InterfacedWorkflow
12651266
"""
12661267
from nipype.interfaces.utility import IdentityInterface
12671268
fields_undefined = ((input_names is None) or (output_names is None))
12681269
wf_undefined = (fields_from is None)
12691270
if wf_undefined and fields_undefined:
1270-
raise ValueError(('An existing InterfacedWorkflow or the input/output_names are '
1271-
'required to initialize the GraftWorkflow'))
1271+
raise ValueError(('An existing InterfacedWorkflow or the in/output'
1272+
' names are required to initialize the '
1273+
'GraftWorkflow'))
12721274
if not wf_undefined:
12731275
if not isinstance(fields_from, InterfacedWorkflow):
1274-
raise TypeError('Reference workflow is not an InterfacedWorkflow.')
1276+
raise TypeError('Workflow is not an InterfacedWorkflow.')
12751277
input_names = fields_from.input_names
12761278
output_names = fields_from.output_names
12771279
if (((input_names is None) or (not input_names)) and
1278-
((output_names is None) or (not output_names))):
1279-
raise ValueError(('A GraftWorkflow cannot be initialized without specifying either a '
1280-
'fields_from workflow or i/o names lists'))
1280+
((output_names is None) or (not output_names))):
1281+
raise ValueError(('A GraftWorkflow cannot be initialized without '
1282+
'specifying either a fields_from workflow or i/o'
1283+
' names lists'))
12811284

12821285
super(GraftWorkflow, self).__init__(name=name, base_dir=base_dir,
12831286
input_names=input_names,
12841287
output_names=output_names)
12851288

1286-
self._outputnode = InputMultiNode(IdentityInterface(fields=output_names), name='outputnode')
1289+
self._outputnode = InputMultiNode(IdentityInterface(
1290+
fields=output_names),
1291+
name='outputnode')
12871292

12881293
def insert(self, workflow):
12891294
"""
@@ -1292,33 +1297,34 @@ def insert(self, workflow):
12921297
from nipype.interfaces.utility import IdentityInterface
12931298

12941299
if not isinstance(workflow, InterfacedWorkflow):
1295-
raise TypeError('Only InterfacedWorkflows can be inserted in a GraftWorkflow.')
1300+
raise TypeError(('Only InterfacedWorkflows can be inserted in '
1301+
'a GraftWorkflow.'))
12961302

12971303
ckey = workflow.name
12981304
cid = len(self._children)
12991305

13001306
if ckey in self._children.keys():
1301-
raise RuntimeError('Trying to add an existing workflow to GraftWorkflow')
1307+
raise RuntimeError(('Trying to add an existing workflow to '
1308+
'GraftWorkflow'))
13021309

13031310
self._children[ckey] = workflow
1304-
self._outnodes[ckey] = Node(IdentityInterface(fields=self.output_names),
1311+
self._outnodes[ckey] = Node(IdentityInterface(
1312+
fields=self.output_names),
13051313
name='out%02d' % cid)
13061314

1307-
13081315
# Check that interfaces are satisfied
13091316
if ((workflow.input_names != self.input_names) or
1310-
(workflow.output_names != self.output_names)):
1317+
(workflow.output_names != self.output_names)):
13111318
raise RuntimeError('Workflow does not meet the general interface')
13121319

13131320
self.connect([('in', workflow), (workflow, self._outnodes[ckey]),
13141321
(self._outnodes[ckey], 'out')])
13151322

1316-
13171323
def write_graph(self, *args, **kwargs):
1318-
return super(GraftWorkflow,self).write_graph(*args, **kwargs)
1324+
return super(GraftWorkflow, self).write_graph(*args, **kwargs)
13191325

13201326
def run(self, *args, **kwargs):
1321-
return super(GraftWorkflow,self).run(*args, **kwargs)
1327+
return super(GraftWorkflow, self).run(*args, **kwargs)
13221328

13231329

13241330
class Node(WorkflowBase):

0 commit comments

Comments
 (0)