Skip to content

Commit a6804a0

Browse files
Apply ruff/pycodestyle rule E741
E741 Ambiguous variable name
1 parent c3b014f commit a6804a0

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

nipype/interfaces/minc/base.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,16 @@ def read_hdf5_version(s):
7878

7979
versions = {"minc": None, "libminc": None, "netcdf": None, "hdf5": None}
8080

81-
for l in out.split("\n"):
81+
for line in out.split("\n"):
8282
for name, f in [
8383
("minc", read_program_version),
8484
("libminc", read_libminc_version),
8585
("netcdf", read_netcdf_version),
8686
("hdf5", read_hdf5_version),
8787
]:
88-
if f(l) is not None:
89-
versions[name] = f(l)
88+
version = f(line)
89+
if version is not None:
90+
versions[name] = version
9091

9192
return versions
9293

nipype/utils/draw_gantt_chart.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def log_to_dict(logfile):
9999
# read file separating each line
100100
lines = content.readlines()
101101

102-
nodes_list = [json.loads(l) for l in lines]
102+
nodes_list = [json.loads(line) for line in lines]
103103

104104
def _convert_string_to_datetime(datestring):
105105
try:

nipype/utils/filemanip.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@ def _parse_mount_table(exit_code, output):
215215

216216
# Keep line and match for error reporting (match == None on failure)
217217
# Ignore empty lines
218-
matches = [(l, pattern.match(l)) for l in output.strip().splitlines() if l]
218+
matches = [
219+
(line, pattern.match(line)) for line in output.strip().splitlines() if line
220+
]
219221

220222
# (path, fstype) tuples, sorted by path length (longest first)
221223
mount_info = sorted(

nipype/utils/misc.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
import textwrap
1616

1717

18-
def human_order_sorted(l):
19-
"""Sorts string in human order (i.e. 'stat10' will go after 'stat2')"""
18+
def human_order_sorted(strings):
19+
"""Sorts strings in human order (i.e. 'stat10' will go after 'stat2')"""
2020

2121
def atoi(text):
2222
return int(text) if text.isdigit() else text
@@ -26,7 +26,7 @@ def natural_keys(text):
2626
text = text[0]
2727
return [atoi(c) for c in re.split(r"(\d+)", text)]
2828

29-
return sorted(l, key=natural_keys)
29+
return sorted(strings, key=natural_keys)
3030

3131

3232
def trim(docstring, marker=None):

0 commit comments

Comments
 (0)