Skip to content

Fix creation of meshes when from loading settings from XML - #2805

Merged
pshriwise merged 1 commit into
openmc-dev:developfrom
paulromano:fix-settings-meshes
Dec 13, 2023
Merged

pshriwise merged 1 commit into
openmc-dev:developfrom
paulromano:fix-settings-meshes

Conversation

@paulromano

Copy link
Copy Markdown
Contributor

Description

Right now, if you call Model.from_xml or Model.from_model_xml on a model that has meshes in the <settings> element, you end up with warnings like the following:

/home/romano/openmc/openmc/mixin.py:70: IDWarning: Another MeshBase instance already exists with id=1.
  warn(msg, IDWarning)

This PR fixes this by properly checking if a mesh has already been created and passed through to Settings.from_xml_element.

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)

@paulromano
paulromano requested a review from pshriwise December 13, 2023 13:09

@pshriwise pshriwise 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! As the changes here are pretty straightforward I won't let this sit long before merging. Thanks @paulromano

@pshriwise pshriwise added the Merging Soon PR will be merged in < 24 hrs if no further comments are made. label Dec 13, 2023
@pshriwise
pshriwise merged commit 3efd242 into openmc-dev:develop Dec 13, 2023
@paulromano
paulromano deleted the fix-settings-meshes branch December 15, 2023 01:14
church89 pushed a commit to openmsr/openmc that referenced this pull request Jul 18, 2024
apingegno pushed a commit to apingegno/openmc that referenced this pull request May 7, 2026
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.

2 participants