Skip to content

Conversation

@GuySten
Copy link
Contributor

@GuySten GuySten commented Jan 21, 2026

Description

This PR warn users when setting undefined attributes in openmc.Settings

Fixes #3741

Example Behavior

>>> import openmc
>>> s = openmc.Settings()
>>> s.particle = 5
<python-input-2>:1: UserWarning: 'Settings' object has no attribute 'particle'. Did you mean: 'particles'?
  s.particle = 5

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 15) 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 marked this pull request as ready for review January 21, 2026 22:59
@GuySten GuySten requested a review from paulromano January 22, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openmc.Settings Allows Arbitrary Attribute Assignment, Leading to Silent User Errors

2 participants