Restrict the Cell.rotation property to cells filled with a Universe

This commit is contained in:
Paul Romano 2016-05-10 11:21:48 -05:00
parent 8ff23e9f98
commit 962d592d2e

View file

@ -243,6 +243,10 @@ class Cell(object):
@rotation.setter
def rotation(self, rotation):
if not isinstance(self.fill, openmc.Universe):
raise RuntimeError('Cell rotation can only be applied if the cell '
'is filled with a Universe')
cv.check_type('cell rotation', rotation, Iterable, Real)
cv.check_length('cell rotation', rotation, 3)
self._rotation = rotation