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.timestamps → unit attribute, value: seconds
TimestampVectorData → unit attribute, value: seconds
EventDetection.times → unit attribute, value: seconds
VoltageClampSeries scalar measurement fields → unit attributes with fixed SI values
Affected fields
nwb.epoch.yaml — TimeIntervals
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?
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 aunitattribute with a fixedvalue:.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 anyvalue:field. New unit attributes should follow the same pattern.Pattern
Fields that already do this correctly (reference):
TimeSeries.timestamps→unitattribute,value: secondsTimestampVectorData→unitattribute,value: secondsEventDetection.times→unitattribute,value: secondsVoltageClampSeriesscalar measurement fields →unitattributes with fixed SI valuesAffected fields
nwb.epoch.yaml—TimeIntervalsstart_time,stop_time— doc says "in seconds", nounitattributenwb.ecephys.yamlElectrodeGroup.position(x/y/z) — no unit stated anywhereElectrodesTable.x,y,z,rel_x,rel_y,rel_z— units in doc only (DynamicTable columns — confirm what is structurally possible)FeatureExtraction.times— nounitattribute;EventDetection.timesalready enforcesunit: secondsnwb.misc.yamlUnits.spike_times,obs_intervals— doc says "in seconds", nounitattributeDecompositionSeries.data.unit— uses sentinel'no unit'; should be standardised to'n/a'(used byAnnotationSeriesandIntervalSeries)IndexSeries.data.unit— uses'N/A'(uppercase); should be standardised to'n/a'nwb.icephys.yamlPatchClampSeries.gain— doc says "Volt/Amp or Volt/Volt"; nounitattribute in base or subtypesCurrentClampSeries.bias_current— doc says "in amps"; nounitattributeCurrentClampSeries.bridge_balance— doc says "in ohms"; nounitattributeCurrentClampSeries.capacitance_compensation— doc says "in farads"; nounitattributeIntracellularElectrode.resistance— dtypetext, doc says "in ohms"; should befloat32withunit: ohmsIntracellularElectrode.initial_access_resistance— dtypetext, no unit stated anywhere; should befloat32withunit: ohmsnwb.ophys.yamlOnePhotonSeries.power— doc says "in mW"; nounitattributeOnePhotonSeries.intensity— doc says "in mW/mm^2"; nounitattributeImagingPlane.excitation_lambda— doc says "in nm"; nounitattributeImagingPlane.imaging_rate— doc says "in Hz"; nounitattributeOpticalChannel.emission_lambda— doc says "in nm"; nounitattributenwb.ogen.yamlOptogeneticSeries.data.unit— free text with no fixed value; doc says "in watts"Open questions
ElectrodesTable,Units) may not support a schema-enforcedunitattribute the same way datasets do. What is the correct approach for these?