Skip to content

Self consistency 4 tally dimension report#3

Open
SteSeg wants to merge 2 commits intoself-consistency_3_convert_old_resultsfrom
self-consistency_4_tally_dimension_report
Open

Self consistency 4 tally dimension report#3
SteSeg wants to merge 2 commits intoself-consistency_3_convert_old_resultsfrom
self-consistency_4_tally_dimension_report

Conversation

@SteSeg
Copy link
Copy Markdown
Owner

@SteSeg SteSeg commented Apr 17, 2026

Now that the openmc_fusion_benchmark's Tally object 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 every filter, score, nuclides etc. (and with the adaptation of the TMCManager uncertainty quantification method there will be dimension also for perturbations and realizations). Hence, we implemented here the possibility of printing a tally_dimension_report for easy inspection.
Example usage:

import openmc_fusion_benchmarks as ofb

# Get benchmark results file
br = ofb.BenchmarkResults('benchmark_results.h5')

# Extract tally
tally = br.get_tally('tally_name')

# print tally dimension report
print(tally.format_dimension_report())

It should print something like this:

Tally neutron_leakage (id=1)
OFB dims            : ['realization', 'particle', 'surface', 'energy', 'nuclide', 'score']
OFB shape           : (1, 1, 1, 134, 1, 1)
TMC axes            : realization=1
Filter axes         : particle=1, surface=1, energy=134
Nuclide/score sizes : nuclide=1, score=1
OpenMC raw equivalent: (134, 1, 1)  (flat_filters, nuclide, score)

As always, we provide the code for the openmc backend. Code for other backends (e.g. serpent, 'mcnp` etc.) is always welcome.

@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 24569819966

Coverage increased (+1.1%) to 61.663%

Details

  • Coverage increased (+1.1%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 5 coverage regressions across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

5 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
/usr/share/miniconda3/envs/test-env/lib/python3.13/site-packages/openmc_fusion_benchmarks/tallies.py 5 85.95%

Coverage Stats

Coverage Status
Relevant Lines: 1419
Covered Lines: 875
Line Coverage: 61.66%
Coverage Strength: 0.62 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants