Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Releasing ID after creating dummy universe for cell plotting #2663

Merged
merged 8 commits into from
Sep 1, 2023

Conversation

pshriwise
Copy link
Contributor

Description

This might be overkill, but while reviewing @shimwell's PR providing the Geometry.plot option I realized that creating a Universe object in the Cell.plot method might reserve a bunch of IDs under the hood and potentially confuse users later on during model generation.

Here I've added a function to the mixin module that allows us to release IDs for a given type. This way the next Universe object created after a Cell.plot call will have the same ID as it would have in the absence of the plot call.

Checklist

  • I have performed a self-review of my own code
  • I have followed the style guidelines for Python source files (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

Copy link
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.

Good find on this -- suggestion for simplification below:

openmc/cell.py Outdated Show resolved Hide resolved
@paulromano paulromano enabled auto-merge (squash) September 1, 2023 12:30
@paulromano paulromano merged commit 27540c5 into openmc-dev:develop Sep 1, 2023
16 checks passed
stchaker pushed a commit to stchaker/openmc that referenced this pull request Oct 25, 2023
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.

3 participants