Skip to content
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
6 changes: 3 additions & 3 deletions resources/postprocess_neuropixels_probe_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
def _parse_type_values_from_val_def(val_def: str) -> list[str]:
"""Extract IMRO type code(s) from a val_def string.

Two patterns in ProbeTable:
Two patterns in ProbeTable, each optionally prefixed with "pn|":
type:{0,1020,1030,...} -> set of values
type:1110 -> single value
"""
match = re.match(r"type:\{([^}]+)\}", val_def)
match = re.match(r"type:(?:pn\|)?\{([^}]+)\}", val_def)
if match:
return [v.strip() for v in match.group(1).split(",")]

match = re.match(r"type:(\d+)", val_def)
match = re.match(r"type:(?:pn\|)?(\d+)", val_def)
if match:
return [match.group(1)]

Expand Down
Loading