Skip to content

Commit

Permalink
Merge pull request #3679 from DimitriPapadopoulos/ISC
Browse files Browse the repository at this point in the history
 STY: Apply ruff/flake8-implicit-str-concat rules (ISC)
  • Loading branch information
effigies authored Oct 6, 2024
2 parents 72a944e + 535d160 commit 8553b39
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 46 deletions.
4 changes: 2 additions & 2 deletions nipype/algorithms/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,13 +478,13 @@ def _run_interface(self, runtime):

if np.any(refdata > 1.0):
iflogger.warning(
'Values greater than 1.0 found in "in_ref" input, ' "scaling values."
'Values greater than 1.0 found in "in_ref" input, scaling values.'
)
refdata /= refdata.max()

if np.any(tstdata > 1.0):
iflogger.warning(
'Values greater than 1.0 found in "in_tst" input, ' "scaling values."
'Values greater than 1.0 found in "in_tst" input, scaling values.'
)
tstdata /= tstdata.max()

Expand Down
2 changes: 1 addition & 1 deletion nipype/algorithms/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ def _run_interface(self, runtime):

if isdefined(self.inputs.row_headings):
iflogger.info(
'Row headings have been provided. Adding "labels"' "column header."
'Row headings have been provided. Adding "labels" column header.'
)
prefix = f'"{self.inputs.row_heading_title}","'
csv_headings = prefix + '","'.join(itertools.chain(headings)) + '"\n'
Expand Down
2 changes: 1 addition & 1 deletion nipype/interfaces/camino/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ImageStatsInputSpec(CommandLineInputSpec):
"double",
argstr="-outputdatatype %s",
usedefault=True,
desc=('A Camino data type string, default is "float". ' "Type must be signed."),
desc=('A Camino data type string, default is "float". Type must be signed.'),
)
output_root = File(
argstr="-outputroot %s",
Expand Down
5 changes: 2 additions & 3 deletions nipype/interfaces/freesurfer/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1469,9 +1469,8 @@ class Label2LabelInputSpec(FSTraitedSpec):
desc="Registration method",
)
copy_inputs = traits.Bool(
desc="If running as a node, set this to True."
+ "This will copy the input files to the node "
+ "directory."
desc="If running as a node, set this to True. "
"This will copy the input files to the node directory."
)


Expand Down
17 changes: 8 additions & 9 deletions nipype/interfaces/freesurfer/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -2645,20 +2645,20 @@ class MNIBiasCorrectionInputSpec(FSTraitedSpec):
hash_files=False,
keep_extension=True,
desc="output volume. Output can be any format accepted by mri_convert. "
+ "If the output format is COR, then the directory must exist.",
"If the output format is COR, then the directory must exist.",
)
iterations = traits.Int(
4,
usedefault=True,
argstr="--n %d",
desc="Number of iterations to run nu_correct. Default is 4. This is the number of times "
+ "that nu_correct is repeated (ie, using the output from the previous run as the input for "
+ "the next). This is different than the -iterations option to nu_correct.",
"that nu_correct is repeated (ie, using the output from the previous run as the input for "
"the next). This is different than the -iterations option to nu_correct.",
)
protocol_iterations = traits.Int(
argstr="--proto-iters %d",
desc="Passes Np as argument of the -iterations flag of nu_correct. This is different "
+ "than the --n flag above. Default is not to pass nu_correct the -iterations flag.",
"than the --n flag above. Default is not to pass nu_correct the -iterations flag.",
)
distance = traits.Int(argstr="--distance %d", desc="N3 -distance option")
no_rescale = traits.Bool(
Expand Down Expand Up @@ -3167,8 +3167,8 @@ class MRIsCALabelInputSpec(FSTraitedSpecOpenMP):
seed = traits.Int(argstr="-seed %d", desc="")
copy_inputs = traits.Bool(
desc="Copies implicit inputs to node directory "
+ "and creates a temp subjects_directory. "
+ "Use this when running as a node"
"and creates a temp subjects_directory. "
"Use this when running as a node"
)


Expand Down Expand Up @@ -3286,9 +3286,8 @@ class SegmentCCInputSpec(FSTraitedSpec):
desc="Subject name",
)
copy_inputs = traits.Bool(
desc="If running as a node, set this to True."
+ "This will copy the input files to the node "
+ "directory."
desc="If running as a node, set this to True. "
"This will copy the input files to the node directory."
)


Expand Down
6 changes: 3 additions & 3 deletions nipype/interfaces/freesurfer/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class RegisterInputSpec(FSTraitedSpec):
mandatory=True,
position=-2,
desc="The data to register to. In normal recon-all usage, "
+ "this is a template file for average surface.",
"this is a template file for average surface.",
)
in_sulc = File(
exists=True,
Expand Down Expand Up @@ -331,7 +331,7 @@ class PaintInputSpec(FSTraitedSpec):
mandatory=True,
position=-2,
desc="Surface file with grid (vertices) onto which the "
+ "template data is to be sampled or 'painted'",
"template data is to be sampled or 'painted'",
)
template = File(
argstr="%s", exists=True, mandatory=True, position=-3, desc="Template file"
Expand All @@ -348,7 +348,7 @@ class PaintInputSpec(FSTraitedSpec):
name_source=["in_surf"],
keep_extension=False,
desc="File containing a surface-worth of per-vertex values, "
+ "saved in 'curvature' format.",
"saved in 'curvature' format.",
)


Expand Down
34 changes: 14 additions & 20 deletions nipype/interfaces/freesurfer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2094,7 +2094,7 @@ class CheckTalairachAlignmentInputSpec(FSTraitedSpec):
usedefault=True,
argstr="-T %.3f",
desc="Talairach transforms for subjects with p-values <= T "
+ "are considered as very unlikely default=0.010",
"are considered as very unlikely default=0.010",
)


Expand Down Expand Up @@ -2483,8 +2483,7 @@ class FixTopologyInputSpec(FSTraitedSpec):
copy_inputs = traits.Bool(
mandatory=True,
desc="If running as a node, set this to True "
+ "otherwise, the topology fixing will be done "
+ "in place.",
"otherwise, the topology fixing will be done in place.",
)

# optional
Expand Down Expand Up @@ -2737,9 +2736,8 @@ class MakeSurfacesInputSpec(FSTraitedSpec):
)
white = traits.String(argstr="-white %s", desc="White surface name")
copy_inputs = traits.Bool(
desc="If running as a node, set this to True."
+ "This will copy the input files to the node "
+ "directory."
desc="If running as a node, set this to True. "
"This will copy the input files to the node directory."
)


Expand Down Expand Up @@ -3012,9 +3010,8 @@ class CurvatureStatsInputSpec(FSTraitedSpec):
)
write = traits.Bool(argstr="--writeCurvatureFiles", desc="Write curvature files")
copy_inputs = traits.Bool(
desc="If running as a node, set this to True."
+ "This will copy the input files to the node "
+ "directory."
desc="If running as a node, set this to True. "
"This will copy the input files to the node directory."
)


Expand Down Expand Up @@ -3237,7 +3234,7 @@ class VolumeMaskInputSpec(FSTraitedSpec):
exists=True,
xor=["in_aseg"],
desc="Implicit aseg.mgz segmentation. "
+ "Specify a different aseg by using the 'in_aseg' input.",
"Specify a different aseg by using the 'in_aseg' input.",
)
subject_id = traits.String(
"subject_id",
Expand All @@ -3257,12 +3254,11 @@ class VolumeMaskInputSpec(FSTraitedSpec):
save_ribbon = traits.Bool(
argstr="--save_ribbon",
desc="option to save just the ribbon for the "
+ "hemispheres in the format ?h.ribbon.mgz",
"hemispheres in the format ?h.ribbon.mgz",
)
copy_inputs = traits.Bool(
desc="If running as a node, set this to True."
+ "This will copy the implicit input files to the "
+ "node directory."
desc="If running as a node, set this to True. "
"This will copy the implicit input files to the node directory."
)


Expand Down Expand Up @@ -3431,9 +3427,8 @@ class ParcellationStatsInputSpec(FSTraitedSpec):
desc="Output annotation files's colortable to text file",
)
copy_inputs = traits.Bool(
desc="If running as a node, set this to True."
+ "This will copy the input files to the node "
+ "directory."
desc="If running as a node, set this to True. "
"This will copy the input files to the node directory."
)
th3 = traits.Bool(
argstr="-th3",
Expand Down Expand Up @@ -3623,9 +3618,8 @@ class ContrastInputSpec(FSTraitedSpec):
exists=True, mandatory=True, desc="Implicit input file mri/rawavg.mgz"
)
copy_inputs = traits.Bool(
desc="If running as a node, set this to True."
+ "This will copy the input files to the node "
+ "directory."
desc="If running as a node, set this to True. "
"This will copy the input files to the node directory."
)


Expand Down
2 changes: 1 addition & 1 deletion nipype/interfaces/fsl/dti.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ class ProbTrackX2InputSpec(ProbTrackXBaseInputSpec):
"OR",
"AND",
argstr="--waycond=%s",
desc=('Waypoint condition. Either "AND" (default) ' 'or "OR"'),
desc=('Waypoint condition. Either "AND" (default) or "OR"'),
)
wayorder = traits.Bool(
desc=(
Expand Down
6 changes: 3 additions & 3 deletions nipype/interfaces/fsl/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2366,8 +2366,8 @@ class GLMInputSpec(FSLCommandInputSpec):
position=2,
desc=(
"file name of the GLM design matrix (text time"
+ " courses for temporal regression or an image"
+ " file for spatial regression)"
" courses for temporal regression or an image"
" file for spatial regression)"
),
)
contrasts = File(
Expand All @@ -2381,7 +2381,7 @@ class GLMInputSpec(FSLCommandInputSpec):
argstr="--des_norm",
desc=(
"switch on normalization of the design"
+ " matrix columns to unit std deviation"
" matrix columns to unit std deviation"
),
)
dat_norm = traits.Bool(
Expand Down
2 changes: 1 addition & 1 deletion nipype/pipeline/engine/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def clone(self, name):
"""
if name == self.name:
raise ValueError('Cloning requires a new name, "%s" is ' "in use." % name)
raise ValueError('Cloning requires a new name, "%s" is in use.' % name)
clone = deepcopy(self)
clone.name = name
if hasattr(clone, "_id"):
Expand Down
2 changes: 1 addition & 1 deletion nipype/pipeline/engine/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ def _get_dot(
else:
if colored:
dotlist.append(
('%s[label="%s", style=filled,' ' fillcolor="%s"];')
('%s[label="%s", style=filled, fillcolor="%s"];')
% (nodename, node_class_name, colorset[level])
)
else:
Expand Down
2 changes: 1 addition & 1 deletion tools/gitwash_dumper.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def make_link_targets(
have_gh_url = True
if not have_url or not have_ml_url:
raise RuntimeError(
"Need command line or known project " "and / or mailing list URLs"
"Need command line or known project and / or mailing list URLs"
)
lines = []
if url is not None:
Expand Down

0 comments on commit 8553b39

Please sign in to comment.