Skip to content

Add missing unit attributes for physical quantity fields across core schema #699

Description

@ehennestad

Summary

Many fields representing physical quantities across the NWB core schema document their units only in prose doc: strings, while equivalent fields in the same schema enforce units via a unit attribute with a fixed value:.

Unit string convention

The existing enforced value: fields are consistently full lowercase SI names: volts, amperes, ohms, farads, hertz, seconds, meters, watts. No symbols (V, A, Ω, Hz) appear in any value: field. New unit attributes should follow the same pattern.

Pattern

Fields that already do this correctly (reference):

  • TimeSeries.timestampsunit attribute, value: seconds
  • TimestampVectorDataunit attribute, value: seconds
  • EventDetection.timesunit attribute, value: seconds
  • VoltageClampSeries scalar measurement fields → unit attributes with fixed SI values

Affected fields

nwb.epoch.yamlTimeIntervals

  • start_time, stop_time — doc says "in seconds", no unit attribute

nwb.ecephys.yaml

  • ElectrodeGroup.position (x/y/z) — no unit stated anywhere
  • ElectrodesTable.x, y, z, rel_x, rel_y, rel_z — units in doc only (DynamicTable columns — confirm what is structurally possible)
  • FeatureExtraction.times — no unit attribute; EventDetection.times already enforces unit: seconds

nwb.misc.yaml

  • Units.spike_times, obs_intervals — doc says "in seconds", no unit attribute
  • DecompositionSeries.data.unit — uses sentinel 'no unit'; should be standardised to 'n/a' (used by AnnotationSeries and IntervalSeries)
  • IndexSeries.data.unit — uses 'N/A' (uppercase); should be standardised to 'n/a'

nwb.icephys.yaml

  • PatchClampSeries.gain — doc says "Volt/Amp or Volt/Volt"; no unit attribute in base or subtypes
  • CurrentClampSeries.bias_current — doc says "in amps"; no unit attribute
  • CurrentClampSeries.bridge_balance — doc says "in ohms"; no unit attribute
  • CurrentClampSeries.capacitance_compensation — doc says "in farads"; no unit attribute
  • IntracellularElectrode.resistance — dtype text, doc says "in ohms"; should be float32 with unit: ohms
  • IntracellularElectrode.initial_access_resistance — dtype text, no unit stated anywhere; should be float32 with unit: ohms

nwb.ophys.yaml

  • OnePhotonSeries.power — doc says "in mW"; no unit attribute
  • OnePhotonSeries.intensity — doc says "in mW/mm^2"; no unit attribute
  • ImagingPlane.excitation_lambda — doc says "in nm"; no unit attribute
  • ImagingPlane.imaging_rate — doc says "in Hz"; no unit attribute
  • OpticalChannel.emission_lambda — doc says "in nm"; no unit attribute

nwb.ogen.yaml

  • OptogeneticSeries.data.unit — free text with no fixed value; doc says "in watts"

Open questions

  • DynamicTable columns (ElectrodesTable, Units) may not support a schema-enforced unit attribute the same way datasets do. What is the correct approach for these?

Metadata

Metadata

Assignees

No one assigned

    Labels

    category: proposalproposed enhancements or new features

    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