Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STY: Apply ruff/flake8-implicit-str-concat rules (ISC) #3679

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -668,7 +668,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 @@ -1468,9 +1468,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 @@ -2644,20 +2644,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 @@ -3166,8 +3166,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 @@ -3285,9 +3285,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 @@ -2093,7 +2093,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 @@ -2482,8 +2482,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 @@ -2736,9 +2735,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 @@ -3011,9 +3009,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 @@ -3236,7 +3233,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 @@ -3256,12 +3253,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 @@ -3430,9 +3426,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 @@ -3622,9 +3617,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 @@ -2365,8 +2365,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 @@ -2380,7 +2380,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 @@

"""
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)

Check warning on line 90 in nipype/pipeline/engine/base.py

View check run for this annotation

Codecov / codecov/patch

nipype/pipeline/engine/base.py#L90

Added line #L90 was not covered by tests
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 @@ -1049,7 +1049,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
Loading