Skip to content

Make waveform units configurable - #707

Merged
rly merged 1 commit into
NeurodataWithoutBorders:devfrom
stanbot8:fix/2162-waveform-unit
Jul 31, 2026
Merged

Make waveform units configurable#707
rly merged 1 commit into
NeurodataWithoutBorders:devfrom
stanbot8:fix/2162-waveform-unit

Conversation

@stanbot8

@stanbot8 stanbot8 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Units(waveform_unit="microvolts") writes volts for all waveform datasets. This change writes the requested unit and keeps volts as the default. From NeurodataWithoutBorders/pynwb#2162.

Design

Use default_value for waveform_mean, waveform_sd, and waveforms. This keeps the existing default and permits the API value.

The implementation changes core/nwb.misc.yaml and docs/format/source/format_release_notes.rst. The design follows Use default_value because this change is reasonable and non-breaking.

Tests

The HDMF validator accepts the complete core namespace. PyNWB writes and reads microvolts for all 3 waveform datasets. MatNWB reads all 3 HDF5 unit attributes.

The PyNWB relevant suite passes with 60 tests and 662 subtests. The complete MatNWB R2025b suite passes. An installed PyNWB wheel passes the custom unit case. The release note is included. The hdmf-common-schema pointer stays at 1.9.0 because 1.10.0 has an unrelated breaking MeaningsTable change.

Downstream validation includes NeurodataWithoutBorders/matnwb and NeurodataWithoutBorders/pynwb.

Commands
uvx --from git+https://github.com/hdmf-dev/hdmf.git validate_hdmf_spec core -m nwb.schema.json
PYNWB_NO_CACHE_DIR=1 python -m pytest tests/integration/hdf5/test_misc.py tests/unit/test_misc.py -q

@h-mayorquin

Copy link
Copy Markdown
Contributor

This LGTM and is the approach discussed already here: NeurodataWithoutBorders/pynwb#2162

@rly
rly merged commit cff37d3 into NeurodataWithoutBorders:dev Jul 31, 2026
6 checks passed
@stanbot8
stanbot8 deleted the fix/2162-waveform-unit branch August 1, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants