SpikeInterface / SpikeInterface/probeinterface

Discussion: deprecate `read_imro`

Open
#351 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
85
Forks
49
Avg merge
13h 47m
Merged PRs (30d)
3

Description

When discussing this pull request with @chrishalcrow, I’ve been thinking about the following:

Why do we expose read_imro directly?

The private function _read_imro_string is the one actually used by SpikeGLX and Open Ephys, while read_imro is just a wrapper around it that, for a reason that I can't remember, is exposed.

To make read_imro work, we need quite a bit of logic to infer the imDatPrb_pn (probe model number) from imDatPrb_type (probe type). This code is complex and since it was determined through trial and error when we did not have a general table, maybe not very reliable:

https://github.com/SpikeInterface/probeinterface/blob/27137e99bd31a65d058d34820803ca7be3b2bfa5/src/probeinterface/neuropixels_tools.py#L633-L651

This was necessary when our probe descriptions were based on the probe type. However, now that the official metadata table is organized around imDatPrb_pn (probe part number), this complexity is no longer needed. In other words, this logic doesn’t serve the key functionality anymore, which is reading neuropixel metadata.

Additionally, I’m not sure exposing the functionality to read IMRO tables on their own makes sense. These tables are embedded in the meta file, and trying to read them independently seems like a feature no one has asked for.

Proposed solution:

  1. Move the logic for inferring imDatPrb_pn from imDatPrb_type out of the core function (_read_imro_string) and into the wrapper (read_imro), keeping the complexity at the periphery.
  2. If there is no use for stand-alone reading of imro tables then deprecate read_imro and eventually remove it. This will allow us to eliminate code that is no longer needed now that we can rely on the metadata table.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/probeinterface/neuropixels_tools.py at read_imro and _read_imro_string, then inspect pull request #349 and callers to determine whether standalone IMRO reading is used. Done means the project has a settled decision on moving the inference logic and deprecating or retaining read_imro, with the resulting scope documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.