Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regex patterns and add minimum version for scikit-image #198

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion element_array_ephys/ephys_acute.py
Original file line number Diff line number Diff line change
@@ -185,7 +185,7 @@ def auto_generate_entries(cls, session_key):

probe_dir = meta_filepath.parent
try:
probe_number = re.search("(imec)?\d{1}$", probe_dir.name).group()
probe_number = re.search(r"(imec)?\d{1}$", probe_dir.name).group()
probe_number = int(probe_number.replace("imec", ""))
except AttributeError:
probe_number = meta_fp_idx
2 changes: 1 addition & 1 deletion element_array_ephys/ephys_no_curation.py
Original file line number Diff line number Diff line change
@@ -190,7 +190,7 @@ def auto_generate_entries(cls, session_key):

probe_dir = meta_filepath.parent
try:
probe_number = re.search("(imec)?\d{1}$", probe_dir.name).group()
probe_number = re.search(r"(imec)?\d{1}$", probe_dir.name).group()
probe_number = int(probe_number.replace("imec", ""))
except AttributeError:
probe_number = meta_fp_idx
4 changes: 2 additions & 2 deletions element_array_ephys/readers/kilosort.py
Original file line number Diff line number Diff line change
@@ -201,14 +201,14 @@ def extract_clustering_info(cluster_output_dir):
is_curated = bool(np.any(curation_row))
if creation_time is None and is_curated:
row_meta = phylog.meta[np.where(curation_row)[0].max()]
datetime_str = re.search("\d{2}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}", row_meta)
datetime_str = re.search(r"\d{2}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}", row_meta)
if datetime_str:
creation_time = datetime.strptime(
datetime_str.group(), "%Y-%m-%d %H:%M:%S"
)
else:
creation_time = datetime.fromtimestamp(phylog_filepath.stat().st_ctime)
time_str = re.search("\d{2}:\d{2}:\d{2}", row_meta)
time_str = re.search(r"\d{2}:\d{2}:\d{2}", row_meta)
if time_str:
creation_time = datetime.combine(
creation_time.date(),
4 changes: 2 additions & 2 deletions element_array_ephys/readers/kilosort_triggering.py
Original file line number Diff line number Diff line change
@@ -98,7 +98,7 @@ def __init__(

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

@@ -719,7 +719,7 @@ def _get_median_subtraction_duration_from_log(self):
) and previous_line.startswith("Total processing time:"):
# regex to search for the processing duration - a float value
duration = int(
re.search("\d+\.?\d+", previous_line).group()
re.search(r"\d+\.?\d+", previous_line).group()
)
return duration
previous_line = line
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@
"plotly",
"seaborn",
"spikeinterface",
"scikit-image",
"scikit-image>=0.20",
"nbformat>=4.2.0",
"pyopenephys>=1.1.6",
],