Skip to content

Commit fe8e830

Browse files
STY: Apply ruff rule RUF010
RUF010 Use explicit conversion flag
1 parent e03ab6f commit fe8e830

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

nipype/interfaces/slicer/generate_classes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ def generate_class(
431431
output_spec = %module_name%OutputSpec
432432
_cmd = "%launcher% %name% "
433433
%output_filenames_code%\n"""
434-
template += f" _redirect_x = {str(redirect_x)}\n"
434+
template += f" _redirect_x = {redirect_x}\n"
435435

436436
main_class = (
437437
template.replace("%class_str%", class_string)

nipype/interfaces/spm/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ def _generate_job(self, prefix="", contents=None):
523523
if isinstance(contents, (str, bytes)):
524524
jobstring += f"{prefix} = '{contents}';\n"
525525
return jobstring
526-
jobstring += f"{prefix} = {str(contents)};\n"
526+
jobstring += f"{prefix} = {contents};\n"
527527
return jobstring
528528

529529
def _make_matlab_command(self, contents, postscript=None):

nipype/pipeline/plugins/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def report_crash(node, traceback=None, hostname=None):
5555
login_name = getpass.getuser()
5656
except KeyError:
5757
login_name = f"UID{os.getuid():d}"
58-
crashfile = f"crash-{timeofcrash}-{login_name}-{name}-{str(uuid.uuid4())}"
58+
crashfile = f"crash-{timeofcrash}-{login_name}-{name}-{uuid.uuid4()}"
5959
crashdir = node.config["execution"].get("crashdump_dir", os.getcwd())
6060

6161
os.makedirs(crashdir, exist_ok=True)

nipype/utils/filemanip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,14 +716,14 @@ def write_rst_header(header, level=0):
716716
def write_rst_list(items, prefix=""):
717717
out = []
718718
for item in ensure_list(items):
719-
out.append(f"{prefix} {str(item)}")
719+
out.append(f"{prefix} {item}")
720720
return "\n".join(out) + "\n\n"
721721

722722

723723
def write_rst_dict(info, prefix=""):
724724
out = []
725725
for key, value in sorted(info.items()):
726-
out.append(f"{prefix}* {key} : {str(value)}")
726+
out.append(f"{prefix}* {key} : {value}")
727727
return "\n".join(out) + "\n\n"
728728

729729

nipype/utils/nipype_cmd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def run_instance(interface, options):
5252
try:
5353
setattr(interface.inputs, input_name, value)
5454
except ValueError as e:
55-
print(f"Error when setting the value of {input_name}: '{str(e)}'")
55+
print(f"Error when setting the value of {input_name}: '{e}'")
5656

5757
print(interface.inputs)
5858
res = interface.run()

0 commit comments

Comments
 (0)