Develop 2.0 - #85
Open
SteSeg wants to merge 143 commits into
Open
Conversation
[Self consistency] Replace DataFrame-based tally conversion with n-D OFB tallies
…y_report Self consistency 2 tally consistency report
Self consistency 3 convert old results
Results quality grading
Automatic report generation
More tests for better coverage
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.
Disclaimer
This PR mainly proposes better tally management and more consistent across the different apps. Moreover, it proposes major new implementations like more benchmark quality metrics other than classic C/E and automatic report generation. It is an ensamble of multiple PR that were merged on a the
develop_2.0branch of my fork that caused it to be consistently ahead of this default branch. Here below the summary of all the new features.Self consistency part 1:
Replace DataFrame-based tally conversion with nD OFB tallies
Summary
This PR removes the intermediate
pandas.DataFramestep when converting OpenMC tallies from astatepointfile tobenchmark_results.h5.Previously, tallies were converted as:
OpenMC tally -> pandas.DataFrame -> xarray.DataArray -> HDF5Because DataFrames are inherently 2D, this imposed shape limitations and made it harder to preserve full tally structure.
With this PR, tallies are handled as true multi-dimensional arrays, consistent with OpenMC and with the OFB specification model.
What changes
BaseTallyandTallyobjects for OFB tally handling.src/openmc_fusion_benchmarks/backends/to support transport-code-specific conversions.src/openmc_fusion_benchmarks/backends/openmc/.scorenuclidefiltersWhy this matters
benchmark_results.h5tally representation with OFB specification semantics.Usage example
Notes for reviewers
This PR is part of a stacked series.
Related PRs in this series use the [Self consistency] prefix.
Part 2
this PR adds the internal piping to check whether resulting tallies from a benchmark (here provided with the openmc backend), converted to an ofb
Tally, has the shape consistent with what defined in the benchmarkspecificationsfile.In addition, a
get_spec_consistency_report()method has been implemented in theBenchmarkResults/Resultsclass. Such report provides informations about the actual consistency of all the tallies resulting from a given benchmark run with thespecificationsrequirements. Example usage:Part 3
Now that the
openmc_fusion_benchmark'sTallyobject is a multi-dimensional array (which has its own convention for dimensions), it may become confusing to navigate all the dimensions: there are new dimensions for everyfilter,score,nuclidesetc. (and with the adaptation of theTMCManageruncertainty quantification method there will be dimension also forperturbationsandrealizations). Hence, we implemented here the possibility of printing atally_dimension_reportfor easy inspection.Example usage:
It should print something like this:
As always, we provide the code for the
openmcbackend. Code for other backends (e.g.serpent, 'mcnp` etc.) is always welcome.Part 4
Implemented the
tmc_modemetadata (sequential,matrixordiagonal) in theTMCStatePointobject.Part 5: report generation
Summary
This PR adds a modular report-generation scaffold for OFB benchmark results. It provides the raw structure (metadata + sources + plots) and supports YAML/PDF output. Scoring integration is intentionally left for a later PR.
What’s Included
Architecture
Usage
Configuration knobs
Notes / limitations
part 6: Benchmark quality values beyond C/E
Summary
This PR introduces a first end-to-end validation framework for comparing benchmark results against reference data. The pipeline goes from per-point metrics to observable (tally) aggregates and then to benchmark-level aggregates. It also includes a grading/qualitative status infrastructure (OK/WARNING/OUTLIER, ACCEPTABLE/BORDERLINE/PROBLEMATIC, dashboard score), but that grading output is disabled by default for now and kept as a skeleton for future use.
Rationale and structure
The goal is a consistent, repeatable workflow to evaluate calculations vs reference data while preserving full quantitative metrics. The grading layer is intentionally kept off for external presentation until we finalize thresholds and interpretation.
Scoring flow
Point-level metrics (quantitative)
For calculated value C, experimental/reference value E, and uncertainties u_C, u_E:
Observable-level metrics (quantitative)
Benchmark-level metrics (quantitative)
Qualitative grading (skeleton only; disabled by default)
These are not surfaced by default in comparison outputs. They can be enabled explicitly via include_grading=True.
Usage
Basic workflow (benchmark-level)
Enabling grading output explicitly
Observable-level (tally-level)
Notes
Part 7: Report generation made automatic and API exposed
Summary
This PR introduces an end-to-end report generation API for benchmarks, including optional report creation directly from
Benchmark.run(). The report workflow builds structured report metadata, renders plots (absolute + C/E), and adds validation quality plots and observable-level summary charts based on verbosity. Reports can be rendered to YAML and PDF.What is new
Benchmark.run(..., generate_report=False, report_config=None)now optionally generates a report after a benchmark run.results_database/{benchmark_name}/experiment.h5when available.ResultSourceentries.API overview
1) Run-time report generation
This triggers report generation after the run completes. If
report_configis omitted, defaults are:output_dir=report/include_yaml=Trueinclude_pdf=Trueverbosity=22) Manual report pipeline
Use this when you want to customize the report or run it outside
Benchmark.run().3) Config objects
ReportConfig:output_dir: output directory root.include_yaml: enable YAML output.include_pdf: enable PDF output.plot_tallies: optional list of tallies to plot.verbosity: controls level of detail for plots/sections.ResultSource:name: display name.kind: typicallyexperiment(reference) orcalculation(candidate).results: aBenchmarkResultsinstance.tally_names: optional list of tallies to include.Workflow details
Build report data
build_report()collects:Render outputs
render_yaml()writes a machine-readable report summary.render_pdf()composes a full PDF report:Validation quality plots (verbosity-driven)
A dedicated "Quality evaluation" section is added with per-point metrics. Metrics included depend on verbosity:
Each plot includes the mathematical expression and a short description of the metric.
Observable summary charts
A dedicated "Observable summary" page aggregates per-tally metrics into bar charts. Metrics depend on verbosity:
Notes
benchmark_results.h5and reference results fromexperiment.h5if available.