Conversation
This branch has not been deployed
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 adds component-specific source metadata to depletion-chain construction and XML persistence, following the chain-file request in #4075.
Chain.source_metadataretains separate neutron, decay, and fission-yield records from the existing ENDFevaluation.info['library']tuple. Each component can contain multiple distinct library/version/release records; a mixed collection is not collapsed to one library label.The proposed XML layout is an optional root-level
<source_metadata>element containing<source component="..." library="..." version="..." release="..."/>entries. Existing nuclide records are unchanged, and files without metadata still load with an empty dictionary. Reduction retains an independent copy of the original construction records. Invalid metadata is rejected before opening an output file.These records describe chain-construction inputs, not the transport library used for reaction rates or a complete processing history. This is separate from photon HDF5 PR #4117, the general HDF5 metadata proposal #3257, and the release-tool provenance work discussed in openmc-dev/data#101. The guide documents that distinction and includes a save/reload/inspect example.
Validation
Tested with Python 3.13.12, official NNDC ENDF/B-VII.1 neutron/decay/fission-yield files, and a real strict-FP OpenMC shared library. The targeted suite covers filename, Evaluation, and endf.Material inputs; single-pass parsing; mixed and missing sources; deterministic XML; legacy compatibility; reduction without shared mutable records; invalid-input protection; and adjacent decay/yield/reaction behavior.
With
OPENMC_ENDF_DATApointing to the extracted ENDF/B-VII.1 files:Actual output:
The warnings are Python 3.13 multiprocessing/fork deprecations in the existing depletion tests.
OPENMC_CROSS_SECTIONSwas unset, producing the usual environment warning; this run did not perform neutron transport. The reused native library was built from5260b9a0fc51f3f312024c425a5c1c227f8ba555with strict FP enabled; theopenmc.libbindings are unchanged between that revision and this PR's base.Full Sphinx HTML builds completed for both upstream and patched documentation. After fixing a heading underline and the new property's API anchor, a warnings-as-errors rebuild of the affected pages passed with no warnings. The full baseline's missing-Doxygen and parallel-extension warnings were unchanged.
git diff --checkalso passes.The full chain was also constructed independently with the unmodified
developimplementation atef49d52c2afb43f4064d1407c1477529bb2d4eb0and this patch using identical inputs: 3,821 decay, 31 fission-yield, and 423 neutron evaluations. Both produced 3,820 nuclides. With only the optional metadata omitted, the serialized numerical/structural payloads were byte-identical:The downloaded neutron collection itself contains several library labels in its ENDF headers, so preserving multiple records is necessary even for this test bundle. Labels, including
Unknown, are retained as reported by the existing parser rather than inferred from the archive name.For example, after reloading the generated full-chain XML:
Related to #4075.