Skip to content

Ensure photon cross sections are loaded when FileSource contains photons#3988

Open
paulromano wants to merge 2 commits into
openmc-dev:developfrom
paulromano:filesource-photons
Open

Ensure photon cross sections are loaded when FileSource contains photons#3988
paulromano wants to merge 2 commits into
openmc-dev:developfrom
paulromano:filesource-photons

Conversation

@paulromano

Copy link
Copy Markdown
Contributor

Description

If an OpenMC model uses a FileSource that has photons and/or electrons/positrons but settings.photon_transport hasn't been set to true, the model will run but segfault because photon cross sections were never loaded. This PR fixes that and adds a test to confirm that it works as intended.

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)

@GuySten GuySten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@shimwell shimwell added the Merging Soon PR will be merged in < 24 hrs if no further comments are made. label Jul 2, 2026
@shimwell

shimwell commented Jul 2, 2026

Copy link
Copy Markdown
Member

thanks for the fix. happy to merge, will merge tomorrow if there are no objections

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

Labels

Merging Soon PR will be merged in < 24 hrs if no further comments are made.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants