Skip to content

Commit 565e021

Browse files
authored
Merge pull request #914 from DimitriPapadopoulos/PIE
STY: Apply ruff/flake8-pie rules (PIE)
2 parents d6d726e + 03cb3ed commit 565e021

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

niworkflows/interfaces/confounds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def _check_and_expand_derivative(expr, variables, data):
442442
6th only."""
443443
if re.search(r'^dd[0-9]+', expr):
444444
order = re.compile(r'^dd([0-9]+)').findall(expr)
445-
order = range(0, int(*order) + 1)
445+
order = range(int(*order) + 1)
446446
(variables, data) = temporal_derivatives(order, variables, data)
447447
elif re.search(r'^d[0-9]+[\-]?[0-9]*', expr):
448448
order = re.compile(r'^d([0-9]+[\-]?[0-9]*)').findall(expr)

niworkflows/interfaces/tests/test_bids.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ def test_DerivativesDataSink_build_path(
367367
for out, exp in zip(output, expectation):
368368
assert Path(out).relative_to(base_directory) == Path(base) / exp
369369
# Regression - some images were given nan scale factors
370-
if out.endswith('.nii') or out.endswith('.nii.gz'):
370+
if out.endswith(('.nii', '.nii.gz')):
371371
img = nb.load(out)
372372
if isinstance(img, nb.Nifti1Image):
373373
with nb.openers.ImageOpener(out) as fobj:

niworkflows/viz/plots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def spikesplot(
414414
# Handle X axis
415415
last = ntsteps - 1
416416
ax.set_xlim(0, last)
417-
xticks = list(range(0, last)[::20]) + [last] if not hide_x else []
417+
xticks = list(range(last)[::20]) + [last] if not hide_x else []
418418
ax.set_xticks(xticks)
419419

420420
if not hide_x:
@@ -564,7 +564,7 @@ def confoundplot(
564564

565565
# Set 10 frame markers in X axis
566566
interval = max((ntsteps // 10, ntsteps // 5, 1))
567-
xticks = list(range(0, ntsteps)[::interval])
567+
xticks = list(range(ntsteps)[::interval])
568568
ax_ts.set_xticks(xticks)
569569

570570
if not hide_x:

0 commit comments

Comments
 (0)