Skip to content

Commit

Permalink
Apply ruff/refurb rule FURB188
Browse files Browse the repository at this point in the history
FURB188 Prefer `removeprefix` over conditionally replacing with slice.
  • Loading branch information
DimitriPapadopoulos committed Oct 31, 2024
1 parent e6bf105 commit e11bbf4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nireports/assembler/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit e11bbf4

Please sign in to comment.