Skip to content

Make Units.waveform_unit configurable - #2237

Open
rly wants to merge 1 commit into
devfrom
fix-2162-waveform-unit
Open

Make Units.waveform_unit configurable#2237
rly wants to merge 1 commit into
devfrom
fix-2162-waveform-unit

Conversation

@rly

@rly rly commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Fixes #2162.

Updates the nwb-schema submodule to the latest schema dev (2.10.1-alpha), which includes NeurodataWithoutBorders/nwb-schema#707. That PR changes the unit attribute of Units.waveform_mean, waveform_sd, and waveforms from a fixed value of "volts" to a default value of "volts".

HDMF short-circuits attribute resolution when a spec has a fixed value, so the existing mapping from Units.waveform_unit onto the unit attribute was never reached. With the schema change it is reachable, so no write-path change was needed.

Also implements the warning placeholder in UnitsMap._get_waveform_stat, since a file can now carry different unit values across the three waveform columns while the Units container holds only one.

Note that waveform_unit can only be set on the Units constructor, so it is not reachable from the nwbfile.add_unit(...) path that auto-creates the table. Worth addressing separately.

🤖 Generated with Claude Code

Update the nwb-schema submodule to the latest schema dev (2.10.1-alpha),
which includes NeurodataWithoutBorders/nwb-schema#707. That PR changes the
"unit" attribute of Units.waveform_mean, waveform_sd, and waveforms from a
fixed value of "volts" to a default value of "volts".

HDMF short-circuits attribute resolution when a spec has a fixed value, so
the existing mapping from Units.waveform_unit onto the "unit" attribute of
the waveform columns was never reached and the requested unit was silently
replaced with "volts" on write. With the schema change the mapping is
reachable, so no write-path change is needed.

Implement the warning placeholder in UnitsMap._get_waveform_stat: a file
can now carry different "unit" values across the three waveform columns
while the Units container holds only one, so report which column's value
was used.

Fixes #2162

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.24%. Comparing base (3eb4348) to head (a69d9c1).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2237      +/-   ##
==========================================
+ Coverage   96.04%   96.24%   +0.19%     
==========================================
  Files          30       30              
  Lines        3010     3010              
  Branches      437      436       -1     
==========================================
+ Hits         2891     2897       +6     
+ Misses         67       64       -3     
+ Partials       52       49       -3     
Flag Coverage Δ
integration 74.65% <100.00%> (+0.19%) ⬆️
unit 86.81% <12.50%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rly
rly requested a review from h-mayorquin August 1, 2026 00:19
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.

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

1 participant