Preserve photon-data source metadata through HDF5 conversion - #4117
Open
JROChub wants to merge 1 commit into
Open
Preserve photon-data source metadata through HDF5 conversion#4117JROChub wants to merge 1 commit into
JROChub wants to merge 1 commit into
Conversation
Capture each ENDF evaluation's library, version, and release separately for photoatomic and atomic-relaxation components. Persist optional attributes on the existing element and subshells groups, preserving the root layout and compatibility with files that omit source metadata. Validate metadata before opening output files. Add extraction, round-trip, legacy compatibility, data-integrity, and invalid-input coverage, with an inspection example and the optional attributes in the format guide.
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.
Description
This adds component-specific source metadata to photon-data conversion and HDF5 persistence.
Photoatomic and atomic-relaxation data retain separate library, version, and release information. The change includes metadata extraction, round-trip, older-file compatibility, and data-integrity tests, plus an inspection example.
Related to #4075.
Feedback on the proposed storage layout is welcome during review. The implementation stores optional
source_library,source_version, andsource_releaseattributes on the existing element group for photoatomic data and on its existingsubshellsgroup for relaxation data. The HDF5 root and numerical datasets are unchanged.The fields come directly from each evaluation's
info["library"]. Missing information remains absent; files without source attributes load with empty dictionaries. Metadata is validated before opening an output file, including malformed strings and integers outside HDF5's representable range.Validation
438b05dphoton module and this implementation: 295 numerical datasets byte-identical, with 419 existing attributes unchanged, across H, O, Al, Cu, Ag, U, and Pu.git diff --checkpassed.From the configured OpenMC development environment:
export OPENMC_ENDF_DATA=/path/to/endf-b-vii.1 OMP_NUM_THREADS=2 OPENBLAS_NUM_THREADS=1 python -m pytest tests/unit_tests/test_data_photon.py -qActual test output
The transport cross-section warning and existing pandas deprecation warnings are retained above. These tests use the ENDF photon fixtures and HDF5 conversion, not particle transport.
Save, reload, and inspect
Executed using the official ENDF/B-VII.1 uranium evaluations:
These inputs happen to share the same library. Separate tests deliberately assign different source tuples to the two evaluations and verify that each survives independently.
Checklist