Skip to content

Commit f6171b9

Browse files
STY: Apply ruff/flake8-comprehensions rule C414
C414 Unnecessary `list` call
1 parent f9ac9d9 commit f6171b9

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

nipype/interfaces/base/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ def load_inputs_from_json(self, json_file, overwrite=True):
486486
if not overwrite:
487487
def_inputs = list(self.inputs.get_traitsfree().keys())
488488

489-
new_inputs = list(set(list(inputs_dict.keys())) - set(def_inputs))
489+
new_inputs = list(set(inputs_dict.keys()) - set(def_inputs))
490490
for key in new_inputs:
491491
if hasattr(self.inputs, key):
492492
setattr(self.inputs, key, inputs_dict[key])

nipype/pipeline/engine/nodes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def needed_outputs(self):
240240
@needed_outputs.setter
241241
def needed_outputs(self, new_outputs):
242242
"""Needed outputs changes the hash, refresh if changed"""
243-
new_outputs = sorted(list(set(new_outputs or [])))
243+
new_outputs = sorted(set(new_outputs or []))
244244
if new_outputs != self._needed_outputs:
245245
# Reset hash
246246
self._hashvalue = None

nipype/scripts/instance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def list_interfaces(module):
3939
the given module.
4040
"""
4141
iface_names = []
42-
for k, v in sorted(list(module.__dict__.items())):
42+
for k, v in sorted(module.__dict__.items()):
4343
if inspect.isclass(v) and issubclass(v, Interface):
4444
iface_names.append(k)
4545
return iface_names

nipype/utils/nipype_cmd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def listClasses(module=None):
1313
__import__(module)
1414
pkg = sys.modules[module]
1515
print("Available Interfaces:")
16-
for k, v in sorted(list(pkg.__dict__.items())):
16+
for k, v in sorted(pkg.__dict__.items()):
1717
if inspect.isclass(v) and issubclass(v, Interface):
1818
print("\t%s" % k)
1919

0 commit comments

Comments
 (0)