Skip to content

Commit b841310

Browse files
committed
PEP8
1 parent 4e8e419 commit b841310

File tree

2 files changed

+106
-96
lines changed

2 files changed

+106
-96
lines changed

nipype/interfaces/afni/base.py

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
import warnings
88

99
from ...utils.filemanip import fname_presuffix, split_filename
10-
from ..base import (CommandLine, traits, CommandLineInputSpec, isdefined, File, TraitedSpec)
10+
from ..base import (
11+
CommandLine, traits, CommandLineInputSpec, isdefined, File, TraitedSpec)
1112

1213
warn = warnings.warn
1314
warnings.filterwarnings('always', category=UserWarning)
@@ -18,6 +19,7 @@
1819
#
1920
###################################
2021

22+
2123
class Info(object):
2224
"""Handle afni output type and version information.
2325
"""
@@ -80,7 +82,6 @@ def outputtype(cls):
8082
# 'Nipype uses NIFTI_GZ as default'))
8183
return 'AFNI'
8284

83-
8485
@staticmethod
8586
def standard_image(img_name):
8687
'''Grab an image from the standard location.
@@ -96,11 +97,8 @@ def standard_image(img_name):
9697

9798

9899
class AFNITraitedSpec(CommandLineInputSpec):
99-
outputtype = traits.Enum('AFNI', Info.ftypes.keys(),
100-
desc = 'AFNI output filetype')
101-
102-
103-
100+
outputtype = traits.Enum('AFNI', Info.ftypes.keys(),
101+
desc='AFNI output filetype')
104102

105103

106104
class AFNICommand(CommandLine):
@@ -130,7 +128,6 @@ def _output_update(self):
130128
"""
131129
self._outputtype = self.inputs.outputtype
132130

133-
134131
@classmethod
135132
def set_default_outputtype(cls, outputtype):
136133
"""Set the default output type for AFNI classes.
@@ -184,39 +181,44 @@ def _gen_fname(self, basename, cwd=None, suffix='_afni', change_ext=True, prefix
184181
suffix = ''.join((suffix, ext))
185182
else:
186183
suffix = ext
187-
fname = fname_presuffix(basename, suffix = suffix,
188-
use_ext = False, newpath = cwd, prefix=prefix)
184+
fname = fname_presuffix(basename, suffix=suffix,
185+
use_ext=False, newpath=cwd, prefix=prefix)
189186
return fname
190187

188+
191189
class AFNIPrefixInputSpec(AFNITraitedSpec):
192190
out_file = File("%s_afni", desc='output image file name',
193-
argstr='-prefix %s', xor=['out_file', 'prefix', 'suffix'], name_source="in_file", usedefault=True)
194-
prefix = traits.Str(desc='output image prefix', deprecated=0.8, new_name="out_file")
195-
suffix = traits.Str(desc='output image suffix', deprecated=0.8, new_name="out_file")
196-
191+
argstr='-prefix %s', xor=['out_file', 'prefix', 'suffix'], name_source="in_file", usedefault=True)
192+
prefix = traits.Str(
193+
desc='output image prefix', deprecated=0.8, new_name="out_file")
194+
suffix = traits.Str(
195+
desc='output image suffix', deprecated=0.8, new_name="out_file")
196+
197+
197198
class AFNIPrefixCommand(AFNICommand):
198199
input_spec = AFNIPrefixInputSpec
199-
200+
200201
def _gen_filename(self, name):
201202
trait_spec = self.inputs.trait(name)
202-
value = getattr(self.inputs, name)
203203
if name == "out_file" and (isdefined(self.inputs.prefix) or isdefined(self.inputs.suffix)):
204204
suffix = ''
205205
prefix = ''
206206
if isdefined(self.inputs.prefix):
207207
prefix = self.inputs.prefix
208208
if isdefined(self.inputs.suffix):
209209
suffix = self.inputs.suffix
210-
211-
_, base, _ = split_filename(getattr(self.inputs,trait_spec.name_source))
210+
211+
_, base, _ = split_filename(
212+
getattr(self.inputs, trait_spec.name_source))
212213
return self._gen_fname(basename=base, prefix=prefix, suffix=suffix, cwd='')
213214
else:
214215
return super(AFNIPrefixCommand, self)._gen_filename(name)
215-
216+
216217
def _overload_extension(self, value):
217218
path, base, _ = split_filename(value)
218219
return os.path.join(path, base + Info.outputtype_to_ext(self.inputs.outputtype))
219-
220+
221+
220222
class AFNIPrefixOutputSpec(TraitedSpec):
221223
out_file = File(desc='output file',
222-
exists=True)
224+
exists=True)

0 commit comments

Comments
 (0)