Skip to content

Commit 349e3be

Browse files
STY: Fix flake8 warnings (#3044)
Except E501 (lines too long).
1 parent 4a9ea0c commit 349e3be

File tree

8 files changed

+7
-16
lines changed

8 files changed

+7
-16
lines changed

.maint/update_authors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def get_git_lines(fname="line-contributors.txt"):
121121
if not lines and git_line_summary_path:
122122
print("Running git-line-summary on repo")
123123
lines = sp.check_output([git_line_summary_path]).decode().splitlines()
124-
lines = [l for l in lines if "Not Committed Yet" not in l]
124+
lines = [line for line in lines if "Not Committed Yet" not in line]
125125
contrib_file.write_text("\n".join(lines))
126126

127127
if not lines:

.maint/update_zenodo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def get_git_lines(fname='line-contributors.txt'):
7575
if not lines and cmd[0]:
7676
print(f"Running {' '.join(cmd)!r} on repo")
7777
lines = sp.check_output(cmd).decode().splitlines()
78-
lines = [l for l in lines if "Not Committed Yet" not in l]
78+
lines = [line for line in lines if "Not Committed Yet" not in line]
7979
contrib_file.write_text('\n'.join(lines))
8080

8181
if not lines:

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
sys.path.append(os.path.abspath("sphinxext"))
2323
sys.path.insert(0, os.path.abspath("../wrapper"))
2424

25-
from github_link import make_linkcode_resolve
25+
from github_link import make_linkcode_resolve # noqa: E402
2626

2727
# -- General configuration ------------------------------------------------
2828

fmriprep/interfaces/confounds.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@
3131
"""
3232
import os
3333
import re
34-
import shutil
3534

3635
import nibabel as nb
3736
import numpy as np
3837
import pandas as pd
3938
from nipype import logging
4039
from nipype.interfaces.base import (
4140
BaseInterfaceInputSpec,
42-
Directory,
4341
File,
4442
InputMultiObject,
4543
OutputMultiObject,

fmriprep/interfaces/gifti.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import nibabel as nb
77
import numpy as np
88
from nipype.interfaces.base import File, SimpleInterface, TraitedSpec, isdefined, traits
9-
from nipype.utils.filemanip import fname_presuffix
109

1110

1211
class CreateROIInputSpec(TraitedSpec):

fmriprep/workflows/bold/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False):
192192
from niworkflows.interfaces.reportlets.registration import (
193193
SimpleBeforeAfterRPT as SimpleBeforeAfter,
194194
)
195-
from niworkflows.interfaces.utility import DictMerge, KeySelect
195+
from niworkflows.interfaces.utility import KeySelect
196196

197197
img = nb.load(bold_file[0] if isinstance(bold_file, (list, tuple)) else bold_file)
198198
nvols = 1 if img.ndim < 4 else img.shape[3]

fmriprep/workflows/bold/confounds.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,11 @@
2727
.. autofunction:: init_bold_confs_wf
2828
2929
"""
30-
from os import getenv
31-
3230
from nipype.algorithms import confounds as nac
33-
from nipype.interfaces import fsl
3431
from nipype.interfaces import utility as niu
3532
from nipype.pipeline import engine as pe
3633
from templateflow.api import get as get_template
3734

38-
from fmriprep import config
39-
4035
from ...config import DEFAULT_MEMORY_MIN_GB
4136
from ...interfaces import DerivativesDataSink
4237
from ...interfaces.confounds import (

fmriprep/workflows/bold/tests/test_base.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from copy import deepcopy
22

33
import bids
4-
import pytest
54
from niworkflows.utils.testing import generate_bids_skeleton
65
from sdcflows.fieldmaps import clear_registry
76
from sdcflows.utils.wrangler import find_estimators
@@ -64,7 +63,7 @@ def test_get_estimator_b0field_and_intendedfor(tmp_path):
6463

6564
generate_bids_skeleton(bids_dir, spec)
6665
layout = bids.BIDSLayout(bids_dir)
67-
estimators = find_estimators(layout=layout, subject='01')
66+
_ = find_estimators(layout=layout, subject='01')
6867

6968
bold_files = sorted(layout.get(suffix='bold', extension='.nii.gz', return_type='file'))
7069

@@ -91,7 +90,7 @@ def test_get_estimator_overlapping_specs(tmp_path):
9190

9291
generate_bids_skeleton(bids_dir, spec)
9392
layout = bids.BIDSLayout(bids_dir)
94-
estimators = find_estimators(layout=layout, subject='01')
93+
_ = find_estimators(layout=layout, subject='01')
9594

9695
bold_files = sorted(layout.get(suffix='bold', extension='.nii.gz', return_type='file'))
9796

@@ -115,7 +114,7 @@ def test_get_estimator_multiple_b0fields(tmp_path):
115114

116115
generate_bids_skeleton(bids_dir, spec)
117116
layout = bids.BIDSLayout(bids_dir)
118-
estimators = find_estimators(layout=layout, subject='01')
117+
_ = find_estimators(layout=layout, subject='01')
119118

120119
bold_files = sorted(layout.get(suffix='bold', extension='.nii.gz', return_type='file'))
121120

0 commit comments

Comments
 (0)