Skip to content

Commit 5e3c132

Browse files
authored
Merge pull request #1649 from FCP-INDI/style/noqa-specificity
🚨 Fix ` # noqa` specificity
2 parents 0070f8c + 4cd043d commit 5e3c132

File tree

16 files changed

+61
-49
lines changed

16 files changed

+61
-49
lines changed

CPAC/cwas/tests/test_cwas.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ def run_cwas(self):
7878

7979
# Read in list of subject functionals
8080
subjects_list = [
81-
l.strip().strip('"') for l in open(sfile).readlines() # noqa E741
81+
l.strip().strip('"') for # noqa: E741
82+
l in open(sfile).readlines() # pylint: disable=consider-using-with
8283
]
8384

8485
# Read in design/regressor file
@@ -93,7 +94,7 @@ def run_cwas(self):
9394
c.inputs.inputspec.f_samples = nperms
9495
c.inputs.inputspec.parallel_nodes = 4
9596
# c.base_dir = op.join(obase, 'results_fs%i_pn%i' % \
96-
# (c.inputs.inputspec.f_samples, c.inputs.inputspec.parallel_nodes)) # noqa E501
97+
# (c.inputs.inputspec.f_samples, c.inputs.inputspec.parallel_nodes)) # noqa: E501 # pylint: disable=line-too-long
9798
c.base_dir = op.join(self.base, "results_%s.py" % self.name)
9899

99100
# export MKL_NUM_THREADS=X # in command line

CPAC/pipeline/cpac_pipeline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def run_workflow(sub_dict, c, run, pipeline_timing_info=None, p_name=None,
352352
Setting ANTS/ITK thread usage to {ants_threads}
353353
Maximum potential number of cores that might be used during this run: {max_cores}
354354
{random_seed}
355-
""" # noqa E501
355+
""" # noqa: E501
356356

357357
execution_info = """
358358
@@ -367,7 +367,7 @@ def run_workflow(sub_dict, c, run, pipeline_timing_info=None, p_name=None,
367367
System time of start: {run_start}
368368
System time of completion: {run_finish}
369369
370-
""" # noqa E501
370+
""" # noqa: E501
371371

372372
logger.info('%s', information.format(
373373
run_command=' '.join(['run', *sys.argv[1:]]),

CPAC/pipeline/nipype_pipeline_engine/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
See https://fcp-indi.github.io/docs/developer/nodes
33
for C-PAC-specific documentation.
44
See https://nipype.readthedocs.io/en/latest/api/generated/nipype.pipeline.engine.html
5-
for Nipype's documentation.''' # noqa E501
5+
for Nipype's documentation.''' # noqa: E501
66
from nipype.pipeline import engine as pe
77
# import everything in nipype.pipeline.engine.__all__
8-
from nipype.pipeline.engine import * # noqa F401
8+
from nipype.pipeline.engine import * # noqa: F401,F403
99
# import our DEFAULT_MEM_GB and override Node, MapNode
1010
from .engine import DEFAULT_MEM_GB, get_data_size, Node, MapNode, \
1111
UNDEFINED_SIZE, Workflow

CPAC/pipeline/nipype_pipeline_engine/engine.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
for C-PAC-specific documentation.
44
See https://nipype.readthedocs.io/en/latest/api/generated/nipype.pipeline.engine.html
55
for Nipype's documentation.
6-
''' # noqa E501
6+
''' # noqa: E501
77
import os
88
import re
99
import warnings
@@ -140,7 +140,7 @@ def __init__(self, *args, mem_gb=DEFAULT_MEM_GB, **kwargs):
140140
``mode`` can be any one of
141141
* 'xyzt' (spatial * temporal) (default if not specified)
142142
* 'xyz' (spatial)
143-
* 't' (temporal)'''])) # noqa E501
143+
* 't' (temporal)'''])) # noqa: E501
144144

145145
def _add_flags(self, flags):
146146
r'''
@@ -415,7 +415,7 @@ def _handle_just_in_time_exception(self, node):
415415
self._local_func_scans) # pylint: disable=no-member
416416
else:
417417
# TODO: handle S3 files
418-
node._apply_mem_x(UNDEFINED_SIZE) # noqa W0212
418+
node._apply_mem_x(UNDEFINED_SIZE) # noqa: W0212
419419

420420

421421
def get_data_size(filepath, mode='xyzt'):
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Import Nipype's pipeline plugins and selectively override"""
2-
from nipype.pipeline.plugins import * # noqa F401,F403
2+
from nipype.pipeline.plugins import * # noqa: F401,F403
33
# Override LegacyMultiProc
4-
from .legacymultiproc import LegacyMultiProcPlugin # noqa F401
4+
from .legacymultiproc import LegacyMultiProcPlugin # noqa: F401
55
# Override MultiProc
6-
from .multiproc import MultiProcPlugin # noqa F401
6+
from .multiproc import MultiProcPlugin # noqa: F401

CPAC/pipeline/nipype_pipeline_engine/plugins/cpac_nipype_custom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def _send_procs_to_workers(self, updatehash=False, graph=None):
130130
Sends jobs to workers when system resources are available.
131131
Customized from https://github.com/nipy/nipype/commit/79e2fdfc38759bc0853e4051b99ba4c37587d65f
132132
to catch overhead deadlocks
133-
""" # noqa E501 # pylint: disable=line-too-long
133+
""" # noqa: E501 # pylint: disable=line-too-long
134134
# pylint: disable=too-many-branches, too-many-statements
135135
# Check to see if a job is available (jobs with all dependencies run)
136136
# See https://github.com/nipy/nipype/pull/2200#discussion_r141605722

CPAC/pipeline/random_state/seed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def set_up_random_state(seed):
162162
ValueError: Valid random seeds are positive integers up to 2147483647, "random", or None, not 0
163163
>>> set_up_random_state(None)
164164
165-
''' # noqa E501 # pylint: disable=line-too-long
165+
''' # noqa: E501 # pylint: disable=line-too-long
166166
if seed is not None:
167167
if seed == 'random':
168168
seed = random_random_seed()

CPAC/pipeline/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def permutation_message(key, options):
173173
174174
Returns
175175
-------
176-
msg: str''' # noqa E501
176+
msg: str''' # noqa: E501
177177
return f'''
178178
179179
\'{key}\' takes a dictionary with paths to region-of-interest (ROI)

CPAC/qc/xcp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"Normalization of T1w/Functional to Template:[…] cross correlation" :cite:`cite-Ciri19` :cite:`cite-Penn19`
5050
normCoverage : float
5151
"Normalization of T1w/Functional to Template:[…] Coverage index" :cite:`cite-Ciri19` :cite:`cite-Penn19`
52-
""" # noqa E501 # pylint: disable=line-too-long
52+
""" # noqa: E501 # pylint: disable=line-too-long
5353
import os
5454
import re
5555
from io import BufferedReader
@@ -103,7 +103,7 @@ def calculate_overlap(image_pair):
103103
(1.0, 1.0, 0.9999999999999998, 1.0)
104104
>>> tuple(calculate_overlap((a2, a2)).values())
105105
(1.0, 1.0, 0.9999999999999998, 1.0)
106-
''' # noqa E501 # pylint: disable=line-too-long
106+
''' # noqa: E501 # pylint: disable=line-too-long
107107
if len(image_pair) != 2:
108108
raise IndexError('`calculate_overlap` requires 2 images, but '
109109
f'{len(image_pair)} were provided')

CPAC/seg_preproc/seg_preproc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ def process_segment_map(wf_name, use_priors, use_custom_threshold, reg_tool):
136136
:width: 1100
137137
:height: 480
138138
139-
""" # noqa
139+
"""
140+
# pylint: disable=import-outside-toplevel,redefined-outer-name,reimported
140141
import nipype.interfaces.utility as util
141142

142143
preproc = pe.Workflow(name=wf_name)
@@ -457,7 +458,7 @@ def create_seg_preproc_freesurfer(config=None,
457458
458459
outputspec.wm_mask : string (nifti file)
459460
outputs White Matter mask
460-
""" # noqa
461+
"""
461462
preproc = pe.Workflow(name=wf_name)
462463

463464
inputnode = pe.Node(util.IdentityInterface(fields=['subject_dir']),

0 commit comments

Comments
 (0)