Skip to content

Commit ae12343

Browse files
authored
Merge pull request #3689 from DimitriPapadopoulos/E
STY: Apply ruff/pycodestyle rules (E)
2 parents d3cfb41 + e84ada2 commit ae12343

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

nipype/algorithms/modelgen.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
experiments.
88
"""
99
from copy import deepcopy
10-
import csv, math, os
10+
import csv
11+
import math
12+
import os
1113

1214
from nibabel import load
1315
import numpy as np

nipype/interfaces/base/tests/test_support.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_bunch_methods():
3535
assert b.get("a") == 3
3636
assert b.get("badkey", "otherthing") == "otherthing"
3737
assert b != newb
38-
assert type(dict()) == type(newb)
38+
assert type(newb) is dict
3939
assert newb["a"] == 3
4040

4141

nipype/interfaces/fsl/tests/test_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_FSLCommand():
3737
# testing the one item that is not.
3838
cmd = fsl.FSLCommand(command="ls")
3939
res = cmd.run()
40-
assert type(res) == InterfaceResult
40+
assert type(res) is InterfaceResult
4141

4242

4343
@pytest.mark.skipif(no_fsl(), reason="fsl is not installed")

nipype/pipeline/engine/tests/test_workflows.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_init():
2020
with pytest.raises(TypeError):
2121
pe.Workflow()
2222
pipe = pe.Workflow(name="pipe")
23-
assert type(pipe._graph) == nx.DiGraph
23+
assert type(pipe._graph) is nx.DiGraph
2424

2525

2626
def test_connect():

nipype/pipeline/plugins/dagman.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __init__(self, **kwargs):
7878
):
7979
if (
8080
"plugin_args" in kwargs
81-
and not kwargs["plugin_args"] is None
81+
and kwargs["plugin_args"] is not None
8282
and id_ in kwargs["plugin_args"]
8383
):
8484
if id_ == "wrapper_cmd":
@@ -89,7 +89,7 @@ def __init__(self, **kwargs):
8989
val = self._get_str_or_file(kwargs["plugin_args"][id_])
9090
setattr(self, var, val)
9191
# TODO remove after some time
92-
if "plugin_args" in kwargs and not kwargs["plugin_args"] is None:
92+
if "plugin_args" in kwargs and kwargs["plugin_args"] is not None:
9393
plugin_args = kwargs["plugin_args"]
9494
if "template" in plugin_args:
9595
warn(

nipype/scripts/utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ def add_args_options(arg_parser, interface):
7171
if not spec.is_trait_type(traits.TraitCompound):
7272
trait_type = type(spec.trait_type.default_value)
7373
if trait_type in (bytes, str, int, float):
74-
if trait_type == bytes:
74+
if trait_type is bytes:
7575
trait_type = str
7676
args["type"] = trait_type
7777
elif len(spec.inner_traits) == 1:
7878
trait_type = type(spec.inner_traits[0].trait_type.default_value)
79-
if trait_type == bytes:
79+
if trait_type is bytes:
8080
trait_type = str
8181
if trait_type in (bytes, bool, str, int, float):
8282
args["type"] = trait_type

tools/checkspecs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def test_specs(self, uri):
301301
bad_specs.append(
302302
[uri, c, "Inputs", traitname, "mandatory=False"]
303303
)
304-
if key == "usedefault" and trait.__dict__[key] == False:
304+
if key == "usedefault" and trait.__dict__[key] is False:
305305
bad_specs.append(
306306
[uri, c, "Inputs", traitname, "usedefault=False"]
307307
)

0 commit comments

Comments
 (0)