From 962d592d2e262206dcde01207100e14cf26a91b0 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 10 May 2016 11:21:48 -0500 Subject: [PATCH] Restrict the Cell.rotation property to cells filled with a Universe --- openmc/cell.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openmc/cell.py b/openmc/cell.py index 806f3f32ff..8ddae63716 100644 --- a/openmc/cell.py +++ b/openmc/cell.py @@ -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