From e11bbf4d3240d789fc4cf798428ed0c0946b1bf0 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Thu, 31 Oct 2024 21:20:32 +0100 Subject: [PATCH] Apply ruff/refurb rule FURB188 FURB188 Prefer `removeprefix` over conditionally replacing with slice. --- nireports/assembler/report.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nireports/assembler/report.py b/nireports/assembler/report.py index 3a6f0549..9e7b5ccf 100644 --- a/nireports/assembler/report.py +++ b/nireports/assembler/report.py @@ -255,13 +255,13 @@ def __init__( if bids_filters.get("subject"): subject_id = bids_filters["subject"] bids_filters["subject"] = ( - subject_id[4:] if subject_id.startswith("sub-") else subject_id + subject_id.removeprefix("sub-") ) if bids_filters.get("session"): session_id = bids_filters["session"] bids_filters["session"] = ( - session_id[4:] if session_id.startswith("ses-") else session_id + session_id.removeprefix("ses-") ) if bids_filters and out_filename == "report.html":