Skip to content

Commit 4ebdbe8

Browse files
STY: Apply ruff preview rule RUF039
RUF039 First argument is not raw string
1 parent 7b8dec2 commit 4ebdbe8

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

fmriprep/interfaces/confounds.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,8 @@ def less_breakable(a_string):
429429
# Taken from https://stackoverflow.com/questions/1175208/
430430
# If we end up using it more than just here, probably worth pulling in a well-tested package
431431
def camel_to_snake(name):
432-
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
433-
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
432+
s1 = re.sub(r'(.)([A-Z][a-z]+)', r'\1_\2', name)
433+
return re.sub(r'([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
434434

435435
def _adjust_indices(left_df, right_df):
436436
# This forces missing values to appear at the beginning of the DataFrame

fmriprep/interfaces/reports.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ def _run_interface(self, runtime):
131131
def _generate_segment(self):
132132
BIDS_NAME = re.compile(
133133
r'^(.*\/)?'
134-
'(?P<subject_id>sub-[a-zA-Z0-9]+)'
135-
'(_(?P<session_id>ses-[a-zA-Z0-9]+))?'
136-
'(_(?P<task_id>task-[a-zA-Z0-9]+))?'
137-
'(_(?P<acq_id>acq-[a-zA-Z0-9]+))?'
138-
'(_(?P<rec_id>rec-[a-zA-Z0-9]+))?'
139-
'(_(?P<run_id>run-[a-zA-Z0-9]+))?'
134+
r'(?P<subject_id>sub-[a-zA-Z0-9]+)'
135+
r'(_(?P<session_id>ses-[a-zA-Z0-9]+))?'
136+
r'(_(?P<task_id>task-[a-zA-Z0-9]+))?'
137+
r'(_(?P<acq_id>acq-[a-zA-Z0-9]+))?'
138+
r'(_(?P<rec_id>rec-[a-zA-Z0-9]+))?'
139+
r'(_(?P<run_id>run-[a-zA-Z0-9]+))?'
140140
)
141141

142142
if not isdefined(self.inputs.subjects_dir):

fmriprep/utils/telemetry.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def before_send(event, hints):
156156
return None
157157
if msg.startswith('Saving crash info to '):
158158
return None
159-
if re.match('Node .+ failed to run on host .+', msg):
159+
if re.match(r'Node .+ failed to run on host .+', msg):
160160
return None
161161

162162
if 'breadcrumbs' in event and isinstance(event['breadcrumbs'], list):

0 commit comments

Comments
 (0)