Preserve NWB subject age-reference metadata - #1931
AtomicGlance wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1931 +/- ##
==========================================
+ Coverage 78.29% 78.37% +0.07%
==========================================
Files 92 92
Lines 14068 14101 +33
==========================================
+ Hits 11015 11051 +36
+ Misses 3053 3050 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Could a maintainer please add the |
Thanks for sharing these, Yaroslav! It’s helpful to see how this connects to the work on age references in BIDS, and I’m glad the PR sparked the nwb2bids discussion too. I’ll read through the proposals to get a better understanding. |
Fixes #1242.
NWB subjects can store a gestational age as an ordinary duration such as
P3W, with its meaning supplied byage__reference. That reference was not included in the extracted metadata, so the duration became birth-referenced.This includes
age__referencein subject metadata and uses a gestational reference when converting the age. Existing gestational-prefix strings remain supported. When age is calculated from date of birth and session start, it remains birth-referenced; that calculation is unchanged.Tests cover birth and gestational references through an NWB write/read round trip, legacy strings and missing references, and date-of-birth precedence.
Local validation on Windows/Python 3.13:
mypy dandi: no issues in 96 source files.The full integration suite has not been run locally.