Hello all,
I’m running into a problem when I try to import my model using model.from_xml(). I have some cells that have rotations applied to the universes inside the fill. Here’s the traceback:
Traceback (most recent call last):
File "FILE.py", line 4, in <module>
model = model.from_xml()
File "/home/james/anaconda3/envs/openmc-env2/lib/python3.10/site-packages/openmc/model/model.py", line 234, in from_xml
geometry = openmc.Geometry.from_xml(geometry, materials)
File "/home/james/anaconda3/envs/openmc-env2/lib/python3.10/site-packages/openmc/geometry.py", line 202, in from_xml
c = openmc.Cell.from_xml_element(elem, surfaces, mats, get_universe)
File "/home/james/anaconda3/envs/openmc-env2/lib/python3.10/site-packages/openmc/cell.py", line 693, in from_xml_element
setattr(c, key, [float(x) for x in value.split()])
File "/home/james/anaconda3/envs/openmc-env2/lib/python3.10/site-packages/openmc/cell.py", line 303, in rotation
phi, theta, psi = self.rotation*(-pi/180.)
ValueError: too many values to unpack (expected 3)
I did some digging, and I see that when the xml subelement is created that the rotation matrix is flattened, but when I call model.from_xml(), it seems like the rotation setter thinks that because self.rotation isn’t 2d that the rotation is of the form (phi, theta, psi).
Do I have this right?
As always thanks,
James