Skip to content

ignore plot_settings.pkl file if model is changed#94

Merged
paulromano merged 5 commits intoopenmc-dev:developfrom
kkiesling:ignore-settings
May 31, 2022
Merged

ignore plot_settings.pkl file if model is changed#94
paulromano merged 5 commits intoopenmc-dev:developfrom
kkiesling:ignore-settings

Conversation

@kkiesling
Copy link
Contributor

closes #77

If either the materials IDs or cell IDs are altered between when the GUI was last closed and when it is reopened with the plot_settings.pkl file, this will ignore the settings file (previously this would cause an error).

In order for this to work, restoreModelSettings() has to be called after the cell and material IDs have been populated in the model (ie, after the plot model is no longer "frozen").

Are there any other properties/model changes that could cause these errors that are not captured in cell IDs and mat IDs?

@kkiesling
Copy link
Contributor Author

Don't merge this yet- I think moving the point at which the model settings are restored messed with some other things. If we check the whole file, then that doesn't need to be moved to the end anyway. So let me change that back.

@kkiesling
Copy link
Contributor Author

Now this should be good

Copy link
Collaborator

@pshriwise pshriwise left a comment

Choose a reason for hiding this comment

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

Works like a charm for me! Thanks for tackling this @kkiesling

@paulromano paulromano merged commit 1a5b837 into openmc-dev:develop May 31, 2022
@paulromano
Copy link
Contributor

Thanks @kkiesling!

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.

Better way to check if plot settings are valid

3 participants