Skip to content

Mark multigroup source files and keep their groups in FileSource - #4191

Open
ondrejch wants to merge 4 commits into
openmc-dev:developfrom
ondrejch:pr/fix-mg-file-source-groups
Open

ondrejch wants to merge 4 commits into
openmc-dev:developfrom
ondrejch:pr/fix-mg-file-source-groups

Conversation

@ondrejch

@ondrejch ondrejch commented Oct 13, 2026 •

Copy link
Copy Markdown

Description

In a multigroup simulation the source bank stores the energy group index of each site in E, and so do the source files written from it: source.<batch>.h5 and source.h5 (Settings.sourcepoint) and the source bank of a statepoint. FileSource read E as an energy in eV and converted it to a group again (#4183). A site in group g >= 1 started in the group whose energy range contains g eV, or at the invalid index G (for G groups) when g eV lies below the lowest group edge. A site in group 0 was rejected by the default energy bounds; with widened bounds it was given group G - 1 or the invalid index G, depending on whether the lowest group edge is 0. With the default bounds, a file whose sites are all in group 0, such as any one-group file, could not be used at all.

This PR marks the source point files of multigroup runs, and FileSource then keeps the stored group of each site.

Fixes #4183

Changes

The PR has four commits. The first is the fix described below, and the third extends its description of the energy_mode attribute in io_formats/source.rst. The second and the fourth add the tests (see "New tests").

Writer. write_source_point() and write_h5_source_point() take a new trailing argument, bool group_indices = false. The two source-bank calls in finalize_batch() pass !settings::run_CE, so the source point files of a multigroup run get the root attribute energy_mode = "multi-group". It is written like filetype, in the same mpi::master || parallel block, so under parallel HDF5 every rank takes part in the write. Nothing else writes the attribute: not continuous-energy runs, not surface source files (their sites store energies in eV, site.E = p.E()), not initial_source.h5, not statepoints, and not the Python writers. Existing callers compile unchanged and write unmarked files.

Reader. After the filetype check, FileSource::load_sites_from_file() reads the marker of an HDF5 file. For a source file it is the root attribute energy_mode; for a statepoint it is the root dataset energy_mode that every statepoint already has.

  • No marker, or "continuous-energy": E is an energy in eV, read and converted exactly as before.
  • "multi-group": E holds group indices. sample_external_source() checks that the sampled E is an integer with 0 <= E < G and returns the site before the conversion from eV, so the particle starts in its stored group. A site that fails the check stops the run, for example with Source site has energy group index 0.5, which is not valid for 2 energy groups. NaN fails the check too.
  • Any other marker value: a fatal error that names the file and the value.

Every rank reads the marker itself. The decision is made per source (Source::energy_is_group_index(), false by default), so in a model with several sources the other sources are converted as before. Because statepoints are read through their existing energy_mode dataset, multigroup statepoints keep their groups too, including those written before this PR.

Refusals and energy bounds.

  • A continuous-energy run refuses a file that holds group indices when the file is loaded: Source file '...' holds multigroup energy group indices and cannot be used in a continuous-energy simulation.
  • Energy bounds are not applied to group-index sites. sample_with_constraints() skips only the energy test for them; the spatial, time and fissionable constraints and the rejection strategy apply as before. If the bounds differ from the defaults, loading prints one warning that names the file.

Unchanged.

  • Files with energies in eV are read as before in both modes: surface source files, files written by continuous-energy runs, and files written by openmc.write_source_file() or ParticleList.export_to_hdf5(). A multigroup run still converts an eV file to groups. Nothing in such a file distinguishes a file written by a continuous-energy run from a user-written one, and the conversion is correct for both.
  • Restart (openmc -r) reads the source bank without any conversion. This PR does not change it.
  • FileSource::sample() and the existing conversion block in sample_external_source() are textually unchanged.
  • Python behaviour is unchanged; only docstrings are updated. ParticleList.from_hdf5() returns E as stored and ignores the attribute, and export_to_hdf5() does not write one.
  • The file format version stays 18.2. The attribute is optional and describes itself, and an older OpenMC ignores it. A version bump would make every 18.2 statepoint fail the exact version check on restart.

Documentation. io_formats/source.rst describes the attribute and what E then holds. It gives both values, 'multi-group' for group indices and 'continuous-energy' for energies in eV, and says that a file without the attribute is read as 'continuous-energy'. It also says that FileSource treats any other value, and a 'multi-group' file in a continuous-energy simulation, as an error, and that OpenMC writes the attribute only to the source point files of multigroup runs. io_formats/statepoint.rst gets one sentence in the source_bank entry. The "File-based Sources" section of usersguide/settings.rst gets a paragraph. The docstrings of FileSource, SourceParticle, ParticleList.from_hdf5() and ParticleList.export_to_hdf5() are updated.

Not covered.

  • MCPL source points. An MCPL file written by a multigroup run still stores the group index (as ekin = E * 1e-6 MeV), and it is read back as an energy in eV.
  • Round trips through ParticleList. A multigroup file read with from_hdf5() and written with export_to_hdf5() loses the marker, and its group indices are then read as eV. The export_to_hdf5() docstring says so.
  • initial_source.h5 (Settings.write_initial_source) is not marked. It has no filetype attribute, so FileSource refuses it both before and after this PR (Specified starting source file not a source file type.).
  • The group structure. The marker says only that E holds group indices; it does not record the groups. A group-index file read with a different multigroup library is therefore accepted whenever its indices are in range. For example, a file written by a two-group run and read in a 70-group run starts its group-1 sites in group 1 of 70. Such a file was misread before this PR too.

Compatibility

The script of #4183

Output on develop (a5bc348), with one thread, as in #4183:

--- group edges [1e-05, 0.625, 20000000.0] eV, chi [0.0, 1.0]
E stored in source.3.h5:    [1.]
E of the sampled sites:     [0.] (energy bounds default; 2 group(s))
Eigenvalue run from the file: RuntimeError: No fission sites banked on MPI rank 0
--- group edges [1e-05, 20000000.0] eV, chi [1.0]
E stored in source.3.h5:    [0.]
E of the sampled sites:     [1.] (energy bounds [-1.0, 30000000.0]; 1 group(s))
Eigenvalue run from the file: RuntimeError: Exceeded maximum number of source rejections per sample. Please check your source definition.
--- group edges [0.0, 20000000.0] eV, chi [1.0]
E stored in source.3.h5:    [0.]
E of the sampled sites:     [0.] (energy bounds [-1.0, 30000000.0]; 1 group(s))
Eigenvalue run from the file: RuntimeError: Exceeded maximum number of source rejections per sample. Please check your source definition.

Output on this branch, with one thread (exit code 0):

--- group edges [1e-05, 0.625, 20000000.0] eV, chi [0.0, 1.0]
E stored in source.3.h5:    [1.]
E of the sampled sites:     [1.] (energy bounds default; 2 group(s))
Eigenvalue run from the file: completed
--- group edges [1e-05, 20000000.0] eV, chi [1.0]
E stored in source.3.h5:    [0.]
E of the sampled sites:     [0.] (energy bounds [-1.0, 30000000.0]; 1 group(s))
Eigenvalue run from the file: completed
--- group edges [0.0, 20000000.0] eV, chi [1.0]
E stored in source.3.h5:    [0.]
E of the sampled sites:     [0.] (energy bounds [-1.0, 30000000.0]; 1 group(s))
Eigenvalue run from the file: completed

On this branch, stderr holds two warnings, one for each of the two one-group cases sampled with widened bounds. Here the run directory is shortened to <dir> and each message is joined onto one line:

 WARNING: Energy bounds are not applied to the sites of source file '<dir>/case1/write/source.3.h5', which holds multigroup energy group indices.
 WARNING: Energy bounds are not applied to the sites of source file '<dir>/case2/write/source.3.h5', which holds multigroup energy group indices.

Tests

New tests

The second commit, "Test multigroup source files read by FileSource", adds tests/unit_tests/test_source_file_mg.py. The fourth, "Test that energy bounds are not applied to group indices", adds one test to it, which gives 21 test functions and 48 test cases. They use the model and the five libraries described under "Checks outside the test suite". Each test either runs OpenMC in a subprocess or samples the source in memory through openmc.lib.

The tests check that:

  • the source point files of a multigroup run are marked and hold the creation group;
  • fixed-source runs, eigenvalue runs and sampling from such a file, and sampling from a multigroup statepoint, keep the stored group; sampling keeps it with the default and with widened energy bounds;
  • energy bounds are not applied to the stored group indices: a fixed-source run from the two-group file of group-1 sites, with bounds of 1 keV to 20 MeV that would reject the index 1 read as an energy in eV, completes with flux only in group 1 and one warning;
  • one warning is printed when energy bounds are given, and none without bounds or with the default bounds;
  • domain and time constraints still apply;
  • another source in the same model is still converted from eV;
  • a group index equal to G, fractional, negative or NaN, an unknown energy_mode value, and a marked file or multigroup statepoint in a continuous-energy run are refused.

As guards, they also check that multigroup surface source files, continuous-energy source points and files written by openmc.write_source_file() are unmarked and still read in eV, and that energy bounds still apply to such files. With --mpi, the writer and two readers run on several processes. The models cap a history at 1000 events, so that a particle left in an invalid group fails the test instead of running forever. The three continuous-energy cases (H-1, U-235) run with CI's nuclear data; the other 45 are data-free.

On develop (a5bc348) with this test file, 32 of the 48 cases fail, and 4 end the test process. Those 4 sample the four files of group-0 sites with the default bounds, which hits the source rejection limit. The fatal error then ends the process: here with a segmentation fault after the error message, and with exit code 255 in the MPI build. The other 12 pass: the 9 guards, and 3 cases that develop already gets right (no warning without bounds or with the default bounds, and widened sampling of the one-group file whose lowest edge is 0). With --mpi the outcomes on develop are the same. On this branch all 48 pass in history mode (3.05 s), with --event (7.52 s) and with --mpi (2 ranks x 2 threads, 12.15 s).

Checks outside the test suite

These checks used the model of the script in #4183: an infinite medium (a reflective 10 cm cube) with no group transfer, and fission only in the group that chi feeds. It was run with five data-free libraries: one group with edges [1e-5, 2e7] or [0, 2e7] eV, and two groups with edges [1e-5, 0.625, 2e7] eV and every fission neutron born in group 1, or born in group 0 with a lowest edge of 1e-5 or 0 eV. The multigroup runs used 1000 particles per batch. Every case ran in a fresh process with seed 1 and one thread per process, on develop (a5bc348) and on this branch.

# Check develop (a5bc348) this branch
1 source.3.h5 and source.h5 of a multigroup eigenvalue run E is the creation group; attributes filetype, version byte-identical source_bank, plus energy_mode = "multi-group"
2 fixed-source run from each of the five files, default bounds the four files of group-0 sites stop with "Exceeded maximum number of source rejections per sample"; the file of group-1 sites runs with all of its flux in group 0 all five complete without a warning, with flux only in the stored group
3 openmc.lib.sample_external_source(), 1000 sites, default bounds group 1 sampled as group 0 (the files of group-0 sites were not sampled, see row 2) every E is the stored group, for all five files
4 the same with bounds [-1, 3e7] eV stored group 0 sampled as 1 (one group, invalid), 0 (one group, lowest edge 0), 2 (two groups, invalid) or 1 (two groups, lowest edge 0); stored group 1 as 0 the same sites as with the default bounds, and one warning
5 a domain constraint (an inner cell, [-2, 2] cm in x, y and z) E is 0 E is 1, and every site lies in the cell
6 eigenvalue run from the two-group file of group-1 sites "No fission sites banked on MPI rank 0" completes; k = 0.803 from two active batches of 1000 (k-infinity 0.8); flux only in group 1
7 that file and a 1 MeV point source of equal strength file sites in group 0 the 496 file sites in group 1; the 504 point-source sites converted to group 0
8 the statepoint of a writer run as a FileSource group 1 sampled as group 0 group 1
9 an eV file from openmc.write_source_file() (0.1 eV and 1 MeV), and a copy with energy_mode = "continuous-energy" groups 1 and 0 sampled sites and the tally results of a fixed-source run byte-identical to develop's; the marked copy gives the same sites
10 a multigroup surface source file (plane x = 0) E is 0.312505 or 10000000.3125 eV (the group midpoints), no marker; sampled as groups 1 and 0 byte-identical file and sampled sites
11 continuous-energy eigenvalue run (NNDC data) attributes filetype, version the same attributes and byte-identical banks
12 a marked file with every E = 2, 0.5, -1 or NaN 2 and 0.5 run; -1 and NaN stop at the rejection limit stops with "Source site has energy group index 2, which is not valid for 2 energy groups." (and 0.5, -1, nan)
13 a file with energy_mode = "foo" runs stops with "... has an unrecognized energy mode 'foo'."
14 a multigroup source file or statepoint in a continuous-energy run runs, reading each group index as an energy in eV refused when loaded; no transport starts
15 initial_source.h5 as a FileSource refused (not a source file type) the same
16 restart, openmc -r statepoint.2.h5 source.2.h5 completes completes; k_generation, k_combined and the tally results are byte-identical to develop's and to an uninterrupted run
17 MPI, 2 ranks, parallel HDF5: rows 1, 2 (one and two groups) and 6 as in those rows as in those rows; with widened bounds one warning, not one per rank

Test suite

The test set of CI (tests/test_matplotlib_import.py tests/unit_tests tests/regression_tests) was run on a5bc348 and on the fix commit of this PR, in the same environment. The other three commits change only the new test file and io_formats/source.rst. The environment used the NNDC HDF5 library (its cross_sections.xml matches the md5 in tests/conftest.py) and OMP_NUM_THREADS=2.

Mode a5bc348 this PR (fix commit)
history 1494 passed, 147 skipped, 64 errors 1494 passed, 147 skipped, 64 errors
--event 1475 passed, 166 skipped, 64 errors 1475 passed, 166 skipped, 64 errors
--mpi --mpi-np=2 (2 ranks x 2 threads) 1414 passed, 157 skipped, 134 errors 1414 passed, 157 skipped, 134 errors

No test failed in any run. The skipped tests and the tests with errors are the same on both sides, and every error is raised at setup by the environment:

  • 61 tests need OPENMC_ENDF_DATA, which was not set (test_data_*.py, test_deplete_chain.py, test_endf.py).
  • 3 tests (cpp_driver, source_dlopen, source_parameterized_dlopen) build against an installed OpenMC, and these builds were not installed.
  • 70 tests, in the MPI run only, need mpi4py, which was not installed.

MPI run. The MPI run used Open MPI 4.1.6 with process binding off, through a small wrapper around mpiexec. The wrapper unsets the OMPI_*, PMIX_*, OPAL_* and ORTE_* environment variables before it calls mpiexec. Without it, the in-process openmc.lib.init() of the CMFD regression tests (a singleton MPI_Init under Open MPI) leaves these variables in the pytest process, and every later mpiexec -n 2 openmc in that process aborts, on develop and on this PR alike.

Reference files. Regenerating every regression reference with pytest --update tests/regression_tests (history mode) on a5bc348 and on the fix commit gives byte-identical files, apart from run-to-run differences:

  • At 2 threads, 58 of the 1137 files differ, all in 8 directories (collision_track, the four deplete_* directories, microxs, surface_source, surface_source_write). All 58 also differ between two runs of develop.
  • At 1 thread, 52 of the 166 files in these directories differ, and only in timestamps. 30 differ only in the modification times in HDF5 object headers, and 22 in the wall-clock depletion time dataset. The same two kinds of fields differ between two 1-thread runs of develop.

No existing reference value changes.

Other checks.

  • ctest on the serial and the MPI build: 14 tests, 13 passed, test_mcpl_stat_sum skipped because MCPL is not enabled. The same holds on a5bc348 and with all four commits.
  • clang-format 18.1.8 (--dry-run --Werror) reports no changes for the five changed C++ files. pyflakes 3.2.0 on openmc/source.py and the new test file, and pycodestyle 2.11.1 on their diff, report nothing.
  • Environment: Ubuntu 24.04 (x86_64) and GCC 13.3.0. Builds were RelWithDebInfo with strict FP and OpenMP on. HDF5 1.10.10 was serial, or Open MPI parallel for the MPI build. Python 3.12.3 with numpy 2.5.3, h5py 3.16.0, scipy 1.18.1, pandas 3.0.6 and pytest 9.1.1.

Not run (CI configurations not reproduced):

  • MPICH: the MPI runs used Open MPI 4.1.6, through the wrapper above, without mpi4py.
  • Builds with MCPL or coverage, and builds with OpenMP off. Without MCPL, the unchanged MCPL path was not exercised.
  • Builds with DAGMC, libMesh, XDG or NCrystal.
  • The tests that need OPENMC_ENDF_DATA or an installed OpenMC (errors on both sides, listed above).
  • CI's Python environment: the package versions above may differ from CI's.

Related PRs

AI Assistance

Code, tests, analysis, reviews and text:

  • Harness: Claude Code
  • Model: Claude Opus 5.5 (claude-opus-5-5)
  • Reasoning effort: xhigh

Review of the change:

  • Harness: OpenCode
  • Model: grok-4.7
  • Reasoning effort: not recorded

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 18) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

Summary by CodeRabbit

  • New Features
    • Multigroup source files can store particle energies as energy-group indices, with the file format identifying this interpretation.
    • Multigroup simulations use stored group indices directly; continuous-energy simulations reject multigroup source files. Invalid group indices and unknown energy modes are also rejected.
    • Energy bounds are not applied to sites with group-index energies, and a warning is issued when configured bounds will not apply.
  • Documentation
    • Clarified energy storage and interpretation for source and statepoint files, including files without an energy-mode marker.

In a multigroup simulation the source bank stores the energy group
index of each site in E, and so do the source point files written from
it (source.<batch>.h5 and source.h5). FileSource read E as an energy in
eV and converted it to a group: with two groups, a site of group 1 was
started in group 0, and a site of group 0 was rejected by the default
energy bounds, which require E > 0, or, with wider bounds, given the
invalid group index G when the lowest group edge is above zero.

These source point files now have an energy_mode attribute equal to
"multi-group". FileSource reads it, or the energy_mode dataset of a
state point, and then keeps the stored group of each site: it checks
that E is an integer from 0 to G - 1, skips the conversion from eV and
does not apply energy bounds to these sites, with a warning when bounds
are given. A continuous-energy simulation refuses such a file, and an
unrecognized energy_mode value is an error. Files without the marker,
such as surface source files, which store energies, older source files
and files written by openmc.write_source_file, are read in eV as
before. The decision is made per source, so the other sources of a
simulation are converted as before. The file format version is
unchanged: the attribute is optional, and older versions ignore it.
Add tests of the energy_mode marker that multigroup simulations write
to their source point files and of how a FileSource reads them. The
marker is on source.<batch>.h5 and source.h5 only. Fixed source and
eigenvalue simulations from such a file start every particle in its
stored group, and sampling keeps that group with default and with
widened energy bounds; one warning is printed when bounds are given,
while domain and time constraints still apply. A multigroup state
point is read through its energy_mode dataset. Group indices that are
out of range, fractional or NaN, an unknown energy_mode value, and a
marked file or multigroup state point in a continuous-energy
simulation are refused.

Files that hold energies are unmarked and read in eV as before:
surface source files written by a multigroup simulation, source points
of a continuous-energy simulation and files written by
openmc.write_source_file, also when another source of the simulation
holds group indices. With --mpi, the writer and two readers run on
several processes.
State that FileSource also accepts 'continuous-energy' (energies in
eV, as without the attribute), that any other value is an error, and
that files written by ParticleList.export_to_hdf5 have no energy_mode
attribute either.
Run a fixed source simulation from the source file of a two-group
simulation, whose sites are all in group 1, with energy bounds of
1 keV to 20 MeV. Read as energies in eV, the stored indices would be
rejected; as group indices, the sites start in their group, and one
warning says that the bounds are not applied.
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9761eec7-df78-4cca-bddc-4e8658c9821d
📥 Commits

Reviewing files that changed from the base of the PR and between aa4afc4 and 93d7766.

📒 Files selected for processing (10)
  • docs/source/io_formats/source.rst
  • docs/source/io_formats/statepoint.rst
  • docs/source/usersguide/settings.rst
  • include/openmc/source.h
  • include/openmc/state_point.h
  • openmc/source.py
  • src/simulation.cpp
  • src/source.cpp
  • src/state_point.cpp
  • tests/unit_tests/test_source_file_mg.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

Walkthrough

Source-point files now identify multigroup site energies as group indices. File-source loading and sampling interpret, validate, and preserve those indices, while retaining eV handling for files without the multigroup marker.

Changes

Multigroup source energy handling

Layer / File(s) Summary
Mark multigroup source-point files
include/openmc/state_point.h, src/state_point.cpp, src/simulation.cpp, docs/source/io_formats/source.rst, docs/source/io_formats/statepoint.rst
Source-point writers accept a group_indices flag. HDF5 source-point files record energy_mode="multi-group" when the flag is enabled. The documentation describes the marker and the meaning of E.
Load and sample group-index energies
include/openmc/source.h, src/source.cpp, openmc/source.py, docs/source/usersguide/settings.rst, tests/unit_tests/test_source_file_mg.py
FileSource identifies energy mode, rejects unsupported mode combinations, and validates multigroup indices. Sampling preserves valid indices and skips energy-bound checks for those sites. Tests cover marked and unmarked files, conversions, constraints, and errors.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant Simulation
  participant SourcePointWriter
  participant HDF5SourcePoint
  participant FileSource
  participant ExternalSourceSampler
  Simulation->>SourcePointWriter: pass group_indices
  SourcePointWriter->>HDF5SourcePoint: write energy_mode="multi-group"
  HDF5SourcePoint->>FileSource: provide marker and site energies
  FileSource->>ExternalSourceSampler: provide sites and group-index status
  ExternalSourceSampler->>ExternalSourceSampler: validate and preserve group indices
Loading

Suggested reviewers: paulromano

Merge Risk: ⚪ Minimal · up to 93d77

No actionable merge-blocking risk is established; the change is mergeable after normal checks.

Security architecture risk: 🔵 Low · up to 93d77

The new format distinguishes group indices from energies and adds validation. A reused native source object can nevertheless retain stale energy-mode state after loading a different file. Normal construction does not trigger that transition, and no expanded privileged access was established.

Retained concerns

  • Low · reliability · inferred: The public FileSource reload operation replaces the bank without consistently replacing its energy semantics. After loading a marked multigroup file, loading an unmarked or explicit continuous-energy file leaves group_index_ true. Subsequent sampling can skip the replacement file’s energy bounds and treat its eV values as indices, silently accepting in-range integers or terminating on other values. This is a new metadata-to-bank ownership invariant failure. Located in-tree callers construct fresh objects, so repeat-load exposure is limited to native callers and is not established as an attacker-reachable path.
Security review details

Security Blast Radius

  • inferred — The demonstrated effects concern source interpretation and execution of the consuming simulation. The inspected changes do not establish broader tenant, service, credential, or environment authority. Deployment-specific exposure to untrusted source files remains unknown.

Security Findings and Attack Paths

  • inferred — The stale-mode transition requires a native caller to reload an existing FileSource; the located in-tree loading calls occur only in constructors. It is therefore a supported lifecycle concern, not a verified externally reachable exploit.

Trust Boundaries and Controls

  • observed — On normal fresh-object loading, caller-supplied HDF5 input must identify as source or statepoint, use a recognized mode, and satisfy run-mode compatibility. Sampled group indices must be nonnegative integers below the active group count; these comparisons also reject NaN and infinite values.

Hardening Proposals

  • proposed — If source banks are exchanged across independently configured multigroup runs, consider recording and checking group-structure identity. This would strengthen compatibility assurance; missing identity is not established here as a vulnerability introduced by this PR.
Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 28.85% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 52 functions across 7 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely summarizes the main change: marking multigroup source files and preserving their energy groups in FileSource.
Description check Passed The description is complete and follows the repository template. It explains the motivation, references issue #4183, documents the implementation and compatibility details, discloses AI assistance, an…
Linked Issues check Passed Issue #4183 requires multigroup FileSource sites to keep their stored group and avoid incorrect conversion or rejection. The change marks multigroup source-point files with energy_mode="multi-group"…
Out of Scope Changes check Passed The changes stay within #4183. The writer and reader updates implement the marker and group-index behavior. The documentation describes the file format and behavior. The tests cover the required fix a…
Full details: Docstring Coverage

Explanation

Docstring coverage is 28.85% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 52 functions across 7 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@ondrejch ondrejch mentioned this pull request Oct 14, 2026
5 tasks done

This branch has not been deployed

No deployments
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.

Multigroup FileSource reads the group index stored in OpenMC source files as an energy in eV

1 participant