Skip to content

fix: replace regex probe model check with ProbeType lookup in ephys_precluster - #3

Merged
tabedzki merged 1 commit into
mainfrom
tabedzki/fix/np2014-precluster-probe-check
Aug 11, 2026
Merged

fix: replace regex probe model check with ProbeType lookup in ephys_precluster#3
tabedzki merged 1 commit into
mainfrom
tabedzki/fix/np2014-precluster-probe-check

Conversation

@tabedzki

Copy link
Copy Markdown

🤖 Human guided, AI assisted PR (using this skill). AI text below. 🤖

Summary

Follow-up to #2. A NP2014 probe (imDatPrb_pn=NP2014, imDatPrb_type=2013) failed automation with:

NotImplementedError: Processing for neuropixels probe model NP2014 not yet implemented

raised from element_array_ephys/ephys_precluster.py.

Unlike ephys_acute.py, ephys_no_curation.py, and ephys_chronic.py — which all check spikeglx_meta.probe_model in supported_probe_types (a ProbeType table membership check) — ephys_precluster.py used re.search("(1.0|2.0|2013)", spikeglx_meta.probe_model) (and re.search("(1.0|2.0)", probe_data.probe_model) for Open Ephys). This regex only matches probe model strings containing the literal substrings "1.0", "2.0", or "2013". Part-number-style names such as "NP2004" or "NP2014" don't contain any of those substrings, so this check always fails for them — independent of whether a matching ProbeType row is registered.

This regex does not exist upstream; ephys_precluster.py itself doesn't exist in the upstream datajoint/element-array-ephys repo (it was consolidated into a single ephys.py, which has always used the ProbeType membership check, matching the pattern already used in this fork's other ephys_*.py files).

Changes

  • element_array_ephys/ephys_precluster.py: replace both regex checks with probe_model in supported_probe_types, matching ephys_acute.py/ephys_no_curation.py/ephys_chronic.py. Removed the now-unused import re.
  • element_array_ephys/probe.py: register "NP2014" in create_neuropixels_probe_types() (geometry already defined in probe_geometry.M, mapped to the 4-shank np2_4s layout).

Test plan

  • Re-run ingestion for a session with the failing NP2014 metadata (imDatPrb_pn=NP2014, imDatPrb_type=2013) through the precluster pipeline and confirm EphysRecording populates without error
  • Confirm existing 1.0/2.0/2013 probes still ingest correctly through ephys_precluster.py (regression check on the regex-to-membership-check change)

Assisted-by: ClaudeCode:claude-sonnet-5

…recluster

ephys_precluster.py used re.search("(1.0|2.0|2013)", probe_model) to
gate probe type support, unlike ephys_acute/ephys_no_curation/
ephys_chronic which check membership against the registered
ProbeType table. Part-number-style probe_model values (e.g. NP2004,
NP2014) don't contain the substrings the regex looks for, so they
always failed with NotImplementedError regardless of whether a
matching ProbeType row existed.

Replace both regex checks (SpikeGLX and Open Ephys branches) with
the same supported_probe_types membership check used elsewhere, and
register NP2014 in create_neuropixels_probe_types().

Assisted-by: ClaudeCode:claude-sonnet-5
@tabedzki
tabedzki merged commit 35ea564 into main Aug 11, 2026
2 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant