feat: no storage#1098
Merged
Merged
Conversation
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for generating “structure-only” UHI serialization output (axes + metadata + storage type) without including the underlying bin contents, and updates deserialization to accept such payloads.
Changes:
- Add
keep_storageoption toto_uhi(...)to omit stored bin data while retaining storage type information. - Update
from_uhi(...)to support loading histograms when storage data is absent. - Add tests covering the new structure-only serialization/deserialization behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/boost_histogram/serialization/__init__.py |
Adds keep_storage option to to_uhi and early-return handling in from_uhi for structure-only storage payloads. |
src/boost_histogram/serialization/_storage.py |
Introduces _storage_type_to_str helper and refactors storage-to-dict type emission. |
tests/test_serialization_uhi.py |
Adds tests for keep_storage=False and loading UHI dicts missing storage data. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
16c395d to
0fa746d
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.
This PR adds support for generating “structure-only” UHI serialization output (axes + metadata + storage type) without including the underlying bin contents, and updates deserialization to accept such payloads.
Changes:
keep_storageoption toto_uhi(...)to omit stored bin data while retaining storage type information.from_uhi(...)to support loading histograms when storage data is absent.