Skip to content

IntracellularElectrode.resistance and initial_access_resistance should be float, not text #702

Description

@ehennestad

Summary

IntracellularElectrode.resistance and IntracellularElectrode.initial_access_resistance in nwb.icephys.yaml are declared as dtype: text, making them inconsistent with ElectrodesTable.imp in nwb.ecephys.yaml (dtype: float32), which represents the same physical quantity (electrode impedance in ohms).

Current state

# nwb.icephys.yaml
- name: resistance
  dtype: text
  doc: Electrode resistance, in ohms.

- name: initial_access_resistance
  dtype: text
  doc: Initial access resistance, in ohms.
# nwb.ecephys.yaml — ElectrodesTable
- name: imp
  dtype: float32
  doc: Impedance of the channel, in ohms.

Problems

  1. resistance and initial_access_resistance are physical quantities (ohms) but stored as free text, preventing numerical use.
  2. initial_access_resistance has no unit information anywhere — not even in the doc string.
  3. Inconsistent with ElectrodesTable.imp, which stores the same kind of value as float32.

Proposed fix

Change both fields to dtype: float32 and add a unit attribute with value: ohms:

- name: resistance
  dtype: float32
  doc: Electrode resistance, in ohms.
  quantity: '?'
  attributes:
  - name: unit
    dtype: text
    value: ohms
    doc: Unit of measurement for resistance, which is fixed to 'ohms'.

- name: initial_access_resistance
  dtype: float32
  doc: Initial access resistance, in ohms.
  quantity: '?'
  attributes:
  - name: unit
    dtype: text
    value: ohms
    doc: Unit of measurement for initial_access_resistance, which is fixed to 'ohms'.

Consideration

This is a breaking change for any existing files that stored these values as strings (e.g. "5 MOhm"). Prevalence should be assessed before merging.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions