Skip to content

feat: add support for user-defined custom metadata from ND acquisition - #300

Open
jmarkow wants to merge 6 commits into
tlambert03:mainfrom
markolab:nd-acq-custom-metadata-fix
Open

feat: add support for user-defined custom metadata from ND acquisition#300
jmarkow wants to merge 6 commits into
tlambert03:mainfrom
markolab:nd-acq-custom-metadata-fix

Conversation

@jmarkow

@jmarkow jmarkow commented Jul 13, 2026

Copy link
Copy Markdown

We are using custom metadata when acquiring data via ND acquisition in Nikon Elements (AR 6.02.01 64-bit). We could not find the metadata in any of the commonly used metadata fields in ND2File. After poking around, we found the metadata lived in CustomData|CustomDescriptionV1_0!. Using json_from_clx_lite_variant without modification only loaded in a subset of the metadata. This turned out to be due to keys getting clobbered by https://github.com/tlambert03/nd2/blob/main/src/nd2/_parse/_clx_lite.py#L234 . This PR includes a minimal set of changes to safely load in custom metadata under the custom_metadata field. We also included an opt-in modification to the clx parser to prevent keys from getting clobbered.

Let us know if you need anything else here.

@jmarkow
jmarkow marked this pull request as ready for review July 13, 2026 17:25
@codspeed-hq

codspeed-hq Bot commented Jul 19, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 13 untouched benchmarks


Comparing markolab:nd-acq-custom-metadata-fix (cdf292d) with main (37b131f)

Open in CodSpeed

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 54.54545% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.83%. Comparing base (37b131f) to head (cdf292d).

Files with missing lines Patch % Lines
src/nd2/_readers/_modern/modern_reader.py 33.33% 4 Missing ⚠️
src/nd2/_nd2file.py 66.66% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (54.54%) is below the target coverage (85.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #300      +/-   ##
==========================================
- Coverage   93.63%   89.83%   -3.81%     
==========================================
  Files          22       22              
  Lines        2607     2616       +9     
==========================================
- Hits         2441     2350      -91     
- Misses        166      266     +100     

☔ 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.

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.

1 participant