openmc
openmc copied to clipboard
Error with Universe.plot in 0.13.1dev version
While trying to plot models geometry using universe.plot with the 13.1dev version I get the following error:
"RuntimeError: No cross_sections.xml file was specified in materials.xml or in the OPENMC_CROSS_SECTIONS environment variable. OpenMC needs such a file to identify where to find data libraries. Please consult the user's guide at https://docs.openmc.org/ for information on how to set up data libraries."
Additional info:
- I don't have an OPENMC_CROSS_SECTIONS env variable, I use
materials.cross_sectionsinstead, directly in the model materials definition - Commenting out the
universe.plotlines the rest of the simulation runs fine - The same model with the 0.13.0 version runs fine and plots the geometry
- The error appears with all the models
I'm working on a better solution for this, but in the meantime as a workaround, the following should work:
import os
os.environ['OPENMC_CROSS_SECTIONS'] = material.cross_sections
...
universe.plot(...)
The proper solution for this now is to use openmc.config, which was introduced in version 0.13.2.