Skip to content

Commit a9ce9b7

Browse files
committed
STY: black [ignore-rev]
1 parent bfa37d7 commit a9ce9b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+7
-136
lines changed

nipype/algorithms/misc.py

-1
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,6 @@ class CalculateNormalizedMoments(BaseInterface):
968968
output_spec = CalculateNormalizedMomentsOutputSpec
969969

970970
def _run_interface(self, runtime):
971-
972971
self._moments = calc_moments(self.inputs.timeseries_file, self.inputs.moment)
973972
return runtime
974973

nipype/algorithms/tests/test_ErrorMap.py

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
def test_errormap(tmpdir):
13-
1413
# Single-Spectual
1514
# Make two fake 2*2*2 voxel volumes
1615
# John von Neumann's birthday

nipype/algorithms/tests/test_misc.py

-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414

1515
def test_CreateNifti(create_analyze_pair_file_in_directory):
16-
1716
filelist, outdir = create_analyze_pair_file_in_directory
1817

1918
create_nifti = misc.CreateNifti()
@@ -35,7 +34,6 @@ def test_CreateNifti(create_analyze_pair_file_in_directory):
3534

3635

3736
def test_CalculateMedian(create_analyze_pair_file_in_directory):
38-
3937
mean = misc.CalculateMedian()
4038

4139
with pytest.raises(TypeError):

nipype/algorithms/tests/test_normalize_tpms.py

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717

1818
def test_normalize_tpms(tmpdir):
19-
2019
in_mask = example_data("tpms_msk.nii.gz")
2120
mskdata = np.asanyarray(nb.load(in_mask).dataobj)
2221
mskdata[mskdata > 0.0] = 1.0

nipype/conftest.py

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def _docdir(request):
2727
# Trigger ONLY for the doctests.
2828
doctest_plugin = request.config.pluginmanager.getplugin("doctest")
2929
if isinstance(request.node, doctest_plugin.DoctestItem):
30-
3130
# Get the fixture dynamically by its name.
3231
tmpdir = pp.local(data_dir)
3332

nipype/external/cloghandler.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ def __init__(
151151
)
152152
try:
153153
BaseRotatingHandler.__init__(self, filename, mode, encoding)
154-
except TypeError: # Due to a different logging release without encoding support (Python 2.4.1 and earlier?)
154+
except (
155+
TypeError
156+
): # Due to a different logging release without encoding support (Python 2.4.1 and earlier?)
155157
BaseRotatingHandler.__init__(self, filename, mode)
156158
self.encoding = encoding
157159

nipype/interfaces/afni/preprocess.py

-2
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,6 @@ class ClipLevel(AFNICommandBase):
11331133
output_spec = ClipLevelOutputSpec
11341134

11351135
def aggregate_outputs(self, runtime=None, needed_outputs=None):
1136-
11371136
outputs = self._outputs()
11381137

11391138
outfile = os.path.join(os.getcwd(), "stat_result.json")
@@ -2295,7 +2294,6 @@ class Seg(AFNICommandBase):
22952294
output_spec = AFNICommandOutputSpec
22962295

22972296
def aggregate_outputs(self, runtime=None, needed_outputs=None):
2298-
22992297
import glob
23002298

23012299
outputs = self._outputs()

nipype/interfaces/afni/utils.py

-2
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ class BrickStat(AFNICommandBase):
302302
output_spec = BrickStatOutputSpec
303303

304304
def aggregate_outputs(self, runtime=None, needed_outputs=None):
305-
306305
outputs = self._outputs()
307306

308307
outfile = os.path.join(os.getcwd(), "stat_result.json")
@@ -2595,7 +2594,6 @@ def _format_arg(self, name, spec, value):
25952594

25962595

25972596
class ResampleInputSpec(AFNICommandInputSpec):
2598-
25992597
in_file = File(
26002598
desc="input file to 3dresample",
26012599
argstr="-inset %s",

nipype/interfaces/base/core.py

-1
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ def run(self, cwd=None, ignore_exception=None, **inputs):
389389
self._check_version_requirements(self.inputs)
390390

391391
with rtc(self, cwd=cwd, redirect_x=self._redirect_x) as runtime:
392-
393392
# Grab inputs now, as they should not change during execution
394393
inputs = self.inputs.get_traitsfree()
395394
outputs = None

nipype/interfaces/base/traits_extension.py

-1
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,6 @@ class MultiObject(traits.List):
405405
"""Abstract class - shared functionality of input and output MultiObject"""
406406

407407
def validate(self, objekt, name, value):
408-
409408
# want to treat range and other sequences (except str) as list
410409
if not isinstance(value, (str, bytes)) and isinstance(value, Sequence):
411410
value = list(value)

nipype/interfaces/brainsuite/brainsuite.py

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020

2121
class BseInputSpec(CommandLineInputSpec):
22-
2322
inputMRIFile = File(mandatory=True, argstr="-i %s", desc="input MRI volume")
2423
outputMRIVolume = File(
2524
desc="output brain-masked MRI volume. If unspecified, output file name will be auto generated.",

nipype/interfaces/cat12/preprocess.py

-3
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,6 @@ def _list_outputs(self):
537537
]
538538

539539
for tidx, tissue in enumerate(["gm", "wm", "csf"]):
540-
541540
for image, prefix in [("modulated", "mw"), ("dartel", "r"), ("native", "")]:
542541
outtype = f"{tissue}_output_{image}"
543542
if isdefined(getattr(self.inputs, outtype)) and getattr(
@@ -594,7 +593,6 @@ def _list_outputs(self):
594593

595594

596595
class CAT12SANLMDenoisingInputSpec(SPMCommandInputSpec):
597-
598596
in_files = InputMultiPath(
599597
ImageFileSPM(exists=True),
600598
field="data",
@@ -679,7 +677,6 @@ class CAT12SANLMDenoisingInputSpec(SPMCommandInputSpec):
679677

680678

681679
class CAT12SANLMDenoisingOutputSpec(TraitedSpec):
682-
683680
out_file = File(desc="out file")
684681

685682

nipype/interfaces/cmtk/cmtk.py

-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ def cmat(
272272

273273
dis = 0
274274
for i in range(endpoints.shape[0]):
275-
276275
# ROI start => ROI end
277276
try:
278277
startROI = int(

nipype/interfaces/dcm2nii.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ class Dcm2nii(CommandLine):
119119
>>> converter.inputs.gzip_output = True
120120
>>> converter.inputs.output_dir = '.'
121121
>>> converter.cmdline # doctest: +ELLIPSIS
122-
'dcm2nii -a y -c y -b config.ini -v y -d y -e y -g y -i n -n y -o . -p y -x n -f n functional_1.dcm'"""
122+
'dcm2nii -a y -c y -b config.ini -v y -d y -e y -g y -i n -n y -o . -p y -x n -f n functional_1.dcm'
123+
"""
123124

124125
input_spec = Dcm2niiInputSpec
125126
output_spec = Dcm2niiOutputSpec

nipype/interfaces/freesurfer/model.py

-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,6 @@ class GLMFitInputSpec(FSTraitedSpec):
449449

450450

451451
class GLMFitOutputSpec(TraitedSpec):
452-
453452
glm_dir = Directory(exists=True, desc="output directory")
454453
beta_file = File(exists=True, desc="map of regression coefficients")
455454
error_file = File(desc="map of residual error")

nipype/interfaces/freesurfer/petsurfer.py

-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525

2626
class GTMSegInputSpec(FSTraitedSpec):
27-
2827
subject_id = traits.String(argstr="--s %s", desc="subject id", mandatory=True)
2928

3029
xcerseg = traits.Bool(
@@ -136,7 +135,6 @@ def _list_outputs(self):
136135

137136

138137
class GTMPVCInputSpec(FSTraitedSpec):
139-
140138
in_file = File(
141139
exists=True,
142140
argstr="--i %s",
@@ -422,7 +420,6 @@ class GTMPVCInputSpec(FSTraitedSpec):
422420

423421

424422
class GTMPVCOutputSpec(TraitedSpec):
425-
426423
pvc_dir = Directory(desc="output directory")
427424
ref_file = File(desc="Reference TAC in .dat")
428425
hb_nifti = File(desc="High-binding TAC in nifti")

nipype/interfaces/freesurfer/preprocess.py

-8
Original file line numberDiff line numberDiff line change
@@ -1833,7 +1833,6 @@ class BBRegister(FSCommand):
18331833
output_spec = BBRegisterOutputSpec
18341834

18351835
def _list_outputs(self):
1836-
18371836
outputs = self.output_spec().get()
18381837
_in = self.inputs
18391838

@@ -1893,7 +1892,6 @@ def _format_arg(self, name, spec, value):
18931892
return super(BBRegister, self)._format_arg(name, spec, value)
18941893

18951894
def _gen_filename(self, name):
1896-
18971895
if name == "out_reg_file":
18981896
return self._list_outputs()[name]
18991897
return None
@@ -2180,7 +2178,6 @@ def _gen_filename(self, name):
21802178

21812179

21822180
class RobustRegisterInputSpec(FSTraitedSpec):
2183-
21842181
source_file = File(
21852182
exists=True, mandatory=True, argstr="--mov %s", desc="volume to be registered"
21862183
)
@@ -2302,7 +2299,6 @@ class RobustRegisterInputSpec(FSTraitedSpec):
23022299

23032300

23042301
class RobustRegisterOutputSpec(TraitedSpec):
2305-
23062302
out_reg_file = File(exists=True, desc="output registration file")
23072303
registered_file = File(exists=True, desc="output image with registration applied")
23082304
weights_file = File(exists=True, desc="image of weights used")
@@ -2388,7 +2384,6 @@ def _list_outputs(self):
23882384

23892385

23902386
class FitMSParamsInputSpec(FSTraitedSpec):
2391-
23922387
in_files = traits.List(
23932388
File(exists=True),
23942389
argstr="%s",
@@ -2408,7 +2403,6 @@ class FitMSParamsInputSpec(FSTraitedSpec):
24082403

24092404

24102405
class FitMSParamsOutputSpec(TraitedSpec):
2411-
24122406
t1_image = File(exists=True, desc="image of estimated T1 relaxation values")
24132407
pd_image = File(exists=True, desc="image of estimated proton density values")
24142408
t2star_image = File(exists=True, desc="image of estimated T2* values")
@@ -2466,7 +2460,6 @@ def _gen_filename(self, name):
24662460

24672461

24682462
class SynthesizeFLASHInputSpec(FSTraitedSpec):
2469-
24702463
fixed_weighting = traits.Bool(
24712464
position=1,
24722465
argstr="-w",
@@ -2495,7 +2488,6 @@ class SynthesizeFLASHInputSpec(FSTraitedSpec):
24952488

24962489

24972490
class SynthesizeFLASHOutputSpec(TraitedSpec):
2498-
24992491
out_file = File(exists=True, desc="synthesized FLASH acquisition")
25002492

25012493

nipype/interfaces/freesurfer/tests/test_FSSurfaceCommand.py

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def test_associated_file(tmpdir):
3535
("./lh.white", "./lh.pial"),
3636
(fsavginfo["white"], fsavginfo["pial"]),
3737
]:
38-
3938
# Unspecified paths, possibly with missing hemisphere information,
4039
# are equivalent to using the same directory and hemisphere
4140
for name in ("pial", "lh.pial", pial):

nipype/interfaces/freesurfer/tests/test_utils.py

-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
@pytest.mark.skipif(fs.no_freesurfer(), reason="freesurfer is not installed")
1919
def test_sample2surf(create_files_in_directory_plus_dummy_file):
20-
2120
s2s = fs.SampleToSurface()
2221
# Test underlying command
2322
assert s2s.cmd == "mri_vol2surf"
@@ -65,7 +64,6 @@ def set_illegal_range():
6564

6665
@pytest.mark.skipif(fs.no_freesurfer(), reason="freesurfer is not installed")
6766
def test_surfsmooth(create_surf_file_in_directory):
68-
6967
smooth = fs.SurfaceSmooth()
7068

7169
# Test underlying command
@@ -104,7 +102,6 @@ def test_surfsmooth(create_surf_file_in_directory):
104102

105103
@pytest.mark.skipif(fs.no_freesurfer(), reason="freesurfer is not installed")
106104
def test_surfxfm(create_surf_file_in_directory):
107-
108105
xfm = fs.SurfaceTransform()
109106

110107
# Test underlying command
@@ -141,7 +138,6 @@ def test_surfxfm(create_surf_file_in_directory):
141138

142139
@pytest.mark.skipif(fs.no_freesurfer(), reason="freesurfer is not installed")
143140
def test_surfshots(create_files_in_directory_plus_dummy_file):
144-
145141
fotos = fs.SurfaceSnapshots()
146142

147143
# Test underlying command

nipype/interfaces/freesurfer/utils.py

-13
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ def createoutputdirs(outputs):
116116

117117

118118
class SampleToSurfaceInputSpec(FSTraitedSpec):
119-
120119
source_file = File(
121120
exists=True,
122121
mandatory=True,
@@ -289,7 +288,6 @@ class SampleToSurfaceInputSpec(FSTraitedSpec):
289288

290289

291290
class SampleToSurfaceOutputSpec(TraitedSpec):
292-
293291
out_file = File(exists=True, desc="surface file")
294292
hits_file = File(exists=True, desc="image with number of hits at each voxel")
295293
vox_file = File(
@@ -426,7 +424,6 @@ def _gen_filename(self, name):
426424

427425

428426
class SurfaceSmoothInputSpec(FSTraitedSpec):
429-
430427
in_file = File(mandatory=True, argstr="--sval %s", desc="source surface file")
431428
subject_id = traits.String(
432429
mandatory=True, argstr="--s %s", desc="subject id of surface file"
@@ -455,7 +452,6 @@ class SurfaceSmoothInputSpec(FSTraitedSpec):
455452

456453

457454
class SurfaceSmoothOutputSpec(TraitedSpec):
458-
459455
out_file = File(exists=True, desc="smoothed surface file")
460456

461457

@@ -753,7 +749,6 @@ class Surface2VolTransform(FSCommand):
753749

754750

755751
class ApplyMaskInputSpec(FSTraitedSpec):
756-
757752
in_file = File(
758753
exists=True,
759754
mandatory=True,
@@ -803,7 +798,6 @@ class ApplyMaskInputSpec(FSTraitedSpec):
803798

804799

805800
class ApplyMaskOutputSpec(TraitedSpec):
806-
807801
out_file = File(exists=True, desc="masked image")
808802

809803

@@ -822,7 +816,6 @@ class ApplyMask(FSCommand):
822816

823817

824818
class SurfaceSnapshotsInputSpec(FSTraitedSpec):
825-
826819
subject_id = traits.String(
827820
position=1, argstr="%s", mandatory=True, desc="subject to visualize"
828821
)
@@ -956,7 +949,6 @@ class SurfaceSnapshotsInputSpec(FSTraitedSpec):
956949

957950

958951
class SurfaceSnapshotsOutputSpec(TraitedSpec):
959-
960952
snapshots = OutputMultiPath(
961953
File(exists=True), desc="tiff images of the surface from different perspectives"
962954
)
@@ -1118,12 +1110,10 @@ def _gen_filename(self, name):
11181110

11191111

11201112
class ImageInfoInputSpec(FSTraitedSpec):
1121-
11221113
in_file = File(exists=True, position=1, argstr="%s", desc="image to query")
11231114

11241115

11251116
class ImageInfoOutputSpec(TraitedSpec):
1126-
11271117
info = traits.Any(desc="output of mri_info")
11281118
out_file = File(exists=True, desc="text file with image information")
11291119
data_type = traits.String(desc="image data type")
@@ -1138,7 +1128,6 @@ class ImageInfoOutputSpec(TraitedSpec):
11381128

11391129

11401130
class ImageInfo(FSCommand):
1141-
11421131
_cmd = "mri_info"
11431132
input_spec = ImageInfoInputSpec
11441133
output_spec = ImageInfoOutputSpec
@@ -2015,7 +2004,6 @@ def _gen_outfilename(self):
20152004

20162005

20172006
class AddXFormToHeaderInputSpec(FSTraitedSpec):
2018-
20192007
# required
20202008
in_file = File(
20212009
exists=True, mandatory=True, position=-2, argstr="%s", desc="input volume"
@@ -2035,7 +2023,6 @@ class AddXFormToHeaderInputSpec(FSTraitedSpec):
20352023

20362024

20372025
class AddXFormToHeaderOutputSpec(TraitedSpec):
2038-
20392026
out_file = File(exists=True, desc="output volume")
20402027

20412028

0 commit comments

Comments
 (0)