fix: replace regex probe model check with ProbeType lookup in ephys_precluster - #3
Merged
Merged
Conversation
…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
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Human guided, AI assisted PR (using this skill). AI text below. 🤖
Summary
Follow-up to #2. A
NP2014probe (imDatPrb_pn=NP2014,imDatPrb_type=2013) failed automation with:raised from
element_array_ephys/ephys_precluster.py.Unlike
ephys_acute.py,ephys_no_curation.py, andephys_chronic.py— which all checkspikeglx_meta.probe_model in supported_probe_types(aProbeTypetable membership check) —ephys_precluster.pyusedre.search("(1.0|2.0|2013)", spikeglx_meta.probe_model)(andre.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 matchingProbeTyperow is registered.This regex does not exist upstream;
ephys_precluster.pyitself doesn't exist in the upstreamdatajoint/element-array-ephysrepo (it was consolidated into a singleephys.py, which has always used theProbeTypemembership check, matching the pattern already used in this fork's otherephys_*.pyfiles).Changes
element_array_ephys/ephys_precluster.py: replace both regex checks withprobe_model in supported_probe_types, matchingephys_acute.py/ephys_no_curation.py/ephys_chronic.py. Removed the now-unusedimport re.element_array_ephys/probe.py: register"NP2014"increate_neuropixels_probe_types()(geometry already defined inprobe_geometry.M, mapped to the 4-shanknp2_4slayout).Test plan
NP2014metadata (imDatPrb_pn=NP2014,imDatPrb_type=2013) through the precluster pipeline and confirmEphysRecordingpopulates without errorephys_precluster.py(regression check on the regex-to-membership-check change)Assisted-by: ClaudeCode:claude-sonnet-5