Skip to content

Commit

Permalink
STY: Fix flake8 warnings (#3044)
Browse files Browse the repository at this point in the history
Except E501 (lines too long).
  • Loading branch information
DimitriPapadopoulos committed Jun 24, 2023
1 parent 4a9ea0c commit 349e3be
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .maint/update_authors.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def get_git_lines(fname="line-contributors.txt"):
if not lines and git_line_summary_path:
print("Running git-line-summary on repo")
lines = sp.check_output([git_line_summary_path]).decode().splitlines()
lines = [l for l in lines if "Not Committed Yet" not in l]
lines = [line for line in lines if "Not Committed Yet" not in line]
contrib_file.write_text("\n".join(lines))

if not lines:
Expand Down
2 changes: 1 addition & 1 deletion .maint/update_zenodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def get_git_lines(fname='line-contributors.txt'):
if not lines and cmd[0]:
print(f"Running {' '.join(cmd)!r} on repo")
lines = sp.check_output(cmd).decode().splitlines()
lines = [l for l in lines if "Not Committed Yet" not in l]
lines = [line for line in lines if "Not Committed Yet" not in line]
contrib_file.write_text('\n'.join(lines))

if not lines:
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
sys.path.append(os.path.abspath("sphinxext"))
sys.path.insert(0, os.path.abspath("../wrapper"))

from github_link import make_linkcode_resolve
from github_link import make_linkcode_resolve # noqa: E402

# -- General configuration ------------------------------------------------

Expand Down
2 changes: 0 additions & 2 deletions fmriprep/interfaces/confounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@
"""
import os
import re
import shutil

import nibabel as nb
import numpy as np
import pandas as pd
from nipype import logging
from nipype.interfaces.base import (
BaseInterfaceInputSpec,
Directory,
File,
InputMultiObject,
OutputMultiObject,
Expand Down
1 change: 0 additions & 1 deletion fmriprep/interfaces/gifti.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import nibabel as nb
import numpy as np
from nipype.interfaces.base import File, SimpleInterface, TraitedSpec, isdefined, traits
from nipype.utils.filemanip import fname_presuffix


class CreateROIInputSpec(TraitedSpec):
Expand Down
2 changes: 1 addition & 1 deletion fmriprep/workflows/bold/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False):
from niworkflows.interfaces.reportlets.registration import (
SimpleBeforeAfterRPT as SimpleBeforeAfter,
)
from niworkflows.interfaces.utility import DictMerge, KeySelect
from niworkflows.interfaces.utility import KeySelect

img = nb.load(bold_file[0] if isinstance(bold_file, (list, tuple)) else bold_file)
nvols = 1 if img.ndim < 4 else img.shape[3]
Expand Down
5 changes: 0 additions & 5 deletions fmriprep/workflows/bold/confounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,11 @@
.. autofunction:: init_bold_confs_wf
"""
from os import getenv

from nipype.algorithms import confounds as nac
from nipype.interfaces import fsl
from nipype.interfaces import utility as niu
from nipype.pipeline import engine as pe
from templateflow.api import get as get_template

from fmriprep import config

from ...config import DEFAULT_MEMORY_MIN_GB
from ...interfaces import DerivativesDataSink
from ...interfaces.confounds import (
Expand Down
7 changes: 3 additions & 4 deletions fmriprep/workflows/bold/tests/test_base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from copy import deepcopy

import bids
import pytest
from niworkflows.utils.testing import generate_bids_skeleton
from sdcflows.fieldmaps import clear_registry
from sdcflows.utils.wrangler import find_estimators
Expand Down Expand Up @@ -64,7 +63,7 @@ def test_get_estimator_b0field_and_intendedfor(tmp_path):

generate_bids_skeleton(bids_dir, spec)
layout = bids.BIDSLayout(bids_dir)
estimators = find_estimators(layout=layout, subject='01')
_ = find_estimators(layout=layout, subject='01')

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

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

generate_bids_skeleton(bids_dir, spec)
layout = bids.BIDSLayout(bids_dir)
estimators = find_estimators(layout=layout, subject='01')
_ = find_estimators(layout=layout, subject='01')

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

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

generate_bids_skeleton(bids_dir, spec)
layout = bids.BIDSLayout(bids_dir)
estimators = find_estimators(layout=layout, subject='01')
_ = find_estimators(layout=layout, subject='01')

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

Expand Down

0 comments on commit 349e3be

Please sign in to comment.