Skip to content

Better way to check if plot settings are valid #77

Closed

Description

@pshriwise

Right now we get a lot of errors if the plot_settings.pkl file doesn't match the current model closely enough when starting the plotter. This happens often when building a model:

  1. Use plotter to view model
  2. Discover problem in model
  3. Close GUI (plot_settings.pkl is written)
  4. Model is extended or changed
  5. Re-load plotter and get a long list of errors about keys not found in the ID mapping

It would be really useful to have some kind of automated detection as to whether or not that file is still valid for the model. This will likely require some hashing of the XML files, which might be a useful feature to add to OpenMC itself.

Activity

  1. kkiesling commented on May 13, 2022

    @kkiesling
    Contributor

    Is there a simple way to replicate this error with the test files present in this repo? I am doing the following, and it is not triggering any errors when I re-open:

    1. open plotter
    2. close plotter - writes plot_settings.pkl file
    3. change one of the .xml files (I tried changing material definitions, changing dimensions on existing surfaces, changing cell IDs to be different integers)
    4. Reopen plotter so it loads the plot_settings.pkl file. I would expect the errors here, but I don't get any.
  2. kkiesling commented on May 13, 2022

    @kkiesling
    Contributor

    Wait- changing one material ID to new integer seemed to work to create these errors. nvm

  3. kkiesling commented on May 13, 2022

    @kkiesling
    Contributor

    Okay I want to double check the desired behavior before I open this PR:

    Right now, if the model is viewed by cell in the GUI, and then a material ID changes after close, no error is triggered. And vice versa. Do we want to ignore plot_settings.pkl file no matter what if the cell or mat IDs change? Or only if the saved view has changed from what those IDs are? I am guessing the latter (so if materials change, but we are viewing by cell, we can still use the plot_settings.pkl file).

  4. kkiesling commented on May 13, 2022

    @kkiesling
    Contributor

    never mind again - I don't think the latter above actually works. I will ignore pkl file if either cells or mat IDs change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions