Skip to content

Fix quad-base with custom names#413

Merged
chrishalcrow merged 1 commit intoSpikeInterface:mainfrom
alejoe91:quad-base-fix2
Mar 20, 2026
Merged

Fix quad-base with custom names#413
chrishalcrow merged 1 commit intoSpikeInterface:mainfrom
alejoe91:quad-base-fix2

Conversation

@alejoe91
Copy link
Member

@alejoe91 alejoe91 commented Mar 20, 2026

Update to deal with Quad Base when a custom name is used.

There are 3 different cases:

  1. (handled) The custom probe name corresponds to the serial number. In this case, the probe is assigned a name based on the stream name, which already containes the "-{shank_id}" suffix to identify the shank. (e.g. this probe)

  2. (handled) The custom probe name DOES NOT correspond to the serial number, but the shank id is part of the name, so the probe is unambiguously selected (e.g., this probe)

  3. (handled by this PR) The custom name DOES NOT correspond to the serial number and it DOES NOT have the shank id in its name. In this case (before this PR), multiple probes with the same name were generated, so the wrong probe could have been selected. This PR fixes it by appending the shank id from the probe attribute to the name (e.g., this probe)

The fix is simply this:

# For Quad Base probes, the stream name is the same for all 4 shanks,
# so we append the shank id to match the stream name (if not already present)
# and ensure consistency with stream names.
shank = np_probe.attrib.get("shank")
if shank is not None:
    shank_str = f"-{int(shank) + 1}"
    if shank_str not in name:
        name = f"{name}{shank_str}"
        # update the name in the probe_name_used so that the correct probe name
        # shows up in the list of available probe names
        probe_names_used[probe_idx] = name

Also updated tests to check that the correct shank is loaded using the contact x positions!

@alejoe91 alejoe91 requested a review from chrishalcrow March 20, 2026 09:31
Copy link
Member

@chrishalcrow chrishalcrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@chrishalcrow chrishalcrow merged commit 606d57e into SpikeInterface:main Mar 20, 2026
9 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.

2 participants