feat(v4): add component-level generic_data support#103
Merged
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Collaborator
Author
|
/ok to test cf53d3d |
82abbe6 to
93462e8
Compare
Closed
93462e8 to
edda9e6
Compare
17780c5 to
f6bf722
Compare
Add set_generic_data() to ComponentWriter for storing named numpy arrays and additional metadata at the component level. Defer component .zattrs writing from register_component_writer() to a two-phase finalize in SequenceComponentGroupsWriter: first each writer's finalize() runs, then _write_component_meta() writes deferred metadata and generic data. Writer API: - set_generic_data(data, meta_data) sets arrays and optional metadata - meta_data keys overwrite init-time generic_meta_data keys - Multiple calls accumulate via merge - Arrays stored with LZ4+bitshuffle compression in generic_data/ subgroup Reader API (backwards-compatible): - has_generic_data(name) -> bool - get_generic_data_names() -> List[str] - get_generic_data(name) -> np.ndarray - Missing generic_data/ subgroup (old stores) handled gracefully
f6bf722 to
1888a3a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
set_generic_data(data, meta_data)method toComponentWriterfor storing named numpy arrays and additional metadata at the component level.zattrswriting fromregister_component_writer()tofinalize()to support itar stores (which reject duplicate key writes)has_generic_data,get_generic_data_names,get_generic_data) toComponentReaderMotivation
Converters sometimes need to attach auxiliary time-series data to components without defining a custom component type. For example, a KITTI converter needs to store raw GPS/IMU measurements (30 float values per frame at 10Hz) alongside the derived ego poses. This feature provides that extensibility at the component level, mirroring the existing per-frame
generic_datamechanism on sensor components.API
Writer
meta_datakeys overwrite init-timegeneric_meta_datakeysgeneric_data/subgroupReader (backwards-compatible)
Changes
ncore/impl/data/v4/components.py.zattrs,set_generic_data, reader methods,super().finalize()in all subclassesncore/impl/data/v4/components_test.pydocs/data/formats.rstTesting
All existing tests pass unchanged. New tests cover:
generic_data/subgroup)set_generic_datameta overwrites init-time keys)No new dependencies required.