Skip to content

[codex] Promote specialized attributes of included typed datasets#797

Open
ehennestad wants to merge 10 commits intorefactor-io-parse-datasetfrom
promote-specialized-attributes-of-typed-datasets-to-containing-type
Open

[codex] Promote specialized attributes of included typed datasets#797
ehennestad wants to merge 10 commits intorefactor-io-parse-datasetfrom
promote-specialized-attributes-of-typed-datasets-to-containing-type

Conversation

@ehennestad
Copy link
Copy Markdown
Collaborator

@ehennestad ehennestad commented Mar 29, 2026

Summary

This PR exposes attributes that are added at the inclusion site of a typed dataset on the containing MATLAB class API using the dataset_attribute naming pattern.

Why

The NWB schema allows a typed dataset reused via neurodata_type_inc to gain additional attributes when it is included into another type. matnwb was not surfacing those specialized attributes consistently in the generated API. This showed up most clearly for Units.spike_times.resolution.

What changed

  • added support for promoting inclusion-site attributes from typed datasets onto the containing generated class
  • made the promotion rule schema-driven: promote only attributes added on the included dataset instance, not attributes that already belong to the included dataset type and are merely refined there
  • kept read/export behavior aligned with the promoted properties

User impact

Users can access specialized included-dataset attributes directly from the containing type, e.g. spike_times_resolution, without leaking those attributes onto unrelated VectorData instances.

Root cause

The generator handled untyped dataset attributes as dependent properties on the containing class, but typed reused datasets did not have an equivalent schema-driven path. A temporary hidden-property-based heuristic also turned out to be too tied to legacy VectorData patching.

Validation

  • regenerated core classes for schema 2.9.0
  • ran tests.system.UnitTimesIOTest.testRoundTrip
  • verified that Units exposes spike_times_resolution
  • verified that SimultaneousRecordingsTable does not expose recordings_table
  • checked support for typed unnamed included datasets; no additional generated API changes were triggered by the current core schema

@ehennestad ehennestad changed the base branch from main to refactor-io-parse-dataset March 31, 2026 09:53
resolution property of spike_times VectorData object was previously cleared when spike_times was added to the units object
@ehennestad ehennestad marked this pull request as ready for review March 31, 2026 20:13
…ributes-of-typed-datasets-to-containing-type
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 92.13483% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.45%. Comparing base (df83711) to head (8ae7459).

Files with missing lines Patch % Lines
+file/processClass.m 85.10% 7 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                      @@
##           refactor-io-parse-dataset     #797      +/-   ##
=============================================================
- Coverage                      95.50%   95.45%   -0.05%     
=============================================================
  Files                            191      191              
  Lines                           6961     7047      +86     
=============================================================
+ Hits                            6648     6727      +79     
- Misses                           313      320       +7     

☔ View full report in Codecov by Sentry.
📢 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.

…ributes-of-typed-datasets-to-containing-type
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.

2 participants