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

Pull from main #203

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
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
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion element_array_ephys/ephys_no_curation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions element_array_ephys/readers/kilosort.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions element_array_ephys/readers/kilosort_triggering.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion element_array_ephys/readers/spikeglx.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def __init__(self, meta_filepath):
self.probe_PN = self.meta.get("imDatPrb_pn", "3A")

# Infer npx probe model (e.g. 1.0 (3A, 3B) or 2.0)
probe_model = self.meta.get("imDatPrb_type", 1)
probe_model = self.meta.get("imDatPrb_type", 0)
if probe_model < 1:
if "typeEnabled" in self.meta and self.probe_PN == "3A":
self.probe_model = "neuropixels 1.0 - 3A"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"plotly",
"seaborn",
"spikeinterface",
"scikit-image",
"scikit-image>=0.20",
"nbformat>=4.2.0",
"pyopenephys>=1.1.6",
],
Expand Down
Loading