Skip to content

Units.waveform_unit parameter has no effect on serialized waveform_mean unit attribute #2162

@h-mayorquin

Description

@h-mayorquin

The Units class accepts a waveform_unit parameter (pynwb misc.py L174-175) and pynwb stores it correctly on the container, but the value is never propagated to the HDF5 file. The NWB schema defines the unit attribute on waveform_mean with a fixed value (value: volts) in nwb-schema nwb.misc.yaml L259-262, and hdmf enforces this by short-circuiting attribute resolution when spec.value is set in hdmf objectmapper.py L1061-1062. This means the ObjectMapper code in pynwb that maps waveform_unit to the unit attribute is never reached, making the waveform_unit parameter effectively dead code.

My personal view is that the unit attribute should either be made configurable by changing value: volts to default: volts in the schema, or the fixed value should be changed to microvolts which is the natural unit for extracellular electrophysiology recordings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions