Skip to content

Guard average molar mass and validate materials depletion inputs#3941

Merged
paulromano merged 2 commits into
openmc-dev:developfrom
approx-infinity:fix-1
May 20, 2026
Merged

Guard average molar mass and validate materials depletion inputs#3941
paulromano merged 2 commits into
openmc-dev:developfrom
approx-infinity:fix-1

Conversation

@approx-infinity
Copy link
Copy Markdown
Contributor

Description

  • Raise a clear error if average_molar_mass is accessed before any nuclides are added.
  • Add validation for Materials.deplete input lengths and missing material volumes.
  • Fix a small docstring typo in Materials.deplete.
  • Add unit tests covering the new validation errors.

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)

Copy link
Copy Markdown
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

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

@paulromano paulromano merged commit 3c7a030 into openmc-dev:develop May 20, 2026
17 checks passed
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