Skip to content

feat: no storage#1098

Merged
henryiii merged 6 commits into
developfrom
henryiii/fix/emptystorage
Apr 9, 2026
Merged

feat: no storage#1098
henryiii merged 6 commits into
developfrom
henryiii/fix/emptystorage

Conversation

@henryiii
Copy link
Copy Markdown
Member

@henryiii henryiii commented Mar 24, 2026

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_storage option to to_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.

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
@github-actions github-actions Bot added the needs changelog Might need a changelog entry label Mar 24, 2026
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_storage option to to_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.

Comment thread src/boost_histogram/serialization/__init__.py Outdated
Comment thread src/boost_histogram/serialization/__init__.py
Comment thread src/boost_histogram/serialization/_storage.py Outdated
Comment thread tests/test_serialization_uhi.py Outdated
henryiii added 3 commits April 9, 2026 14:16
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
@henryiii henryiii force-pushed the henryiii/fix/emptystorage branch from 16c395d to 0fa746d Compare April 9, 2026 20:31
@henryiii henryiii marked this pull request as ready for review April 9, 2026 21:50
@henryiii henryiii merged commit 600dbd4 into develop Apr 9, 2026
20 checks passed
@henryiii henryiii deleted the henryiii/fix/emptystorage branch April 9, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs changelog Might need a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants