Skip to content

Commit 27c56ea

Browse files
authored
Merge pull request #198 from BrainCOGS/adding-raw-strings-and-package-minimum
Fix regex patterns and add minimum version for scikit-image
2 parents 9299142 + 711dd48 commit 27c56ea

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

element_array_ephys/ephys_acute.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def auto_generate_entries(cls, session_key):
185185

186186
probe_dir = meta_filepath.parent
187187
try:
188-
probe_number = re.search("(imec)?\d{1}$", probe_dir.name).group()
188+
probe_number = re.search(r"(imec)?\d{1}$", probe_dir.name).group()
189189
probe_number = int(probe_number.replace("imec", ""))
190190
except AttributeError:
191191
probe_number = meta_fp_idx

element_array_ephys/ephys_no_curation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def auto_generate_entries(cls, session_key):
190190

191191
probe_dir = meta_filepath.parent
192192
try:
193-
probe_number = re.search("(imec)?\d{1}$", probe_dir.name).group()
193+
probe_number = re.search(r"(imec)?\d{1}$", probe_dir.name).group()
194194
probe_number = int(probe_number.replace("imec", ""))
195195
except AttributeError:
196196
probe_number = meta_fp_idx

element_array_ephys/readers/kilosort.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,14 @@ def extract_clustering_info(cluster_output_dir):
201201
is_curated = bool(np.any(curation_row))
202202
if creation_time is None and is_curated:
203203
row_meta = phylog.meta[np.where(curation_row)[0].max()]
204-
datetime_str = re.search("\d{2}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}", row_meta)
204+
datetime_str = re.search(r"\d{2}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}", row_meta)
205205
if datetime_str:
206206
creation_time = datetime.strptime(
207207
datetime_str.group(), "%Y-%m-%d %H:%M:%S"
208208
)
209209
else:
210210
creation_time = datetime.fromtimestamp(phylog_filepath.stat().st_ctime)
211-
time_str = re.search("\d{2}:\d{2}:\d{2}", row_meta)
211+
time_str = re.search(r"\d{2}:\d{2}:\d{2}", row_meta)
212212
if time_str:
213213
creation_time = datetime.combine(
214214
creation_time.date(),

element_array_ephys/readers/kilosort_triggering.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __init__(
9898

9999
def parse_input_filename(self):
100100
meta_filename = next(self._npx_input_dir.glob("*.ap.meta")).name
101-
match = re.search("(.*)_g(\d)_t(\d+|cat)\.imec(\d?)\.ap\.meta", meta_filename)
101+
match = re.search(r"(.*)_g(\d)_t(\d+|cat)\.imec(\d?)\.ap\.meta", meta_filename)
102102
session_str, gate_str, trigger_str, probe_str = match.groups()
103103
return session_str, gate_str, trigger_str, probe_str or "0"
104104

@@ -719,7 +719,7 @@ def _get_median_subtraction_duration_from_log(self):
719719
) and previous_line.startswith("Total processing time:"):
720720
# regex to search for the processing duration - a float value
721721
duration = int(
722-
re.search("\d+\.?\d+", previous_line).group()
722+
re.search(r"\d+\.?\d+", previous_line).group()
723723
)
724724
return duration
725725
previous_line = line

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"plotly",
3636
"seaborn",
3737
"spikeinterface",
38-
"scikit-image",
38+
"scikit-image>=0.20",
3939
"nbformat>=4.2.0",
4040
"pyopenephys>=1.1.6",
4141
],

0 commit comments

Comments
 (0)