From 0339809deb8045c8a9132ea16d20ea44004ba177 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 14 Apr 2016 07:58:06 -0500 Subject: [PATCH] Fix imports in cell and lattice modules --- openmc/cell.py | 9 ++++----- openmc/lattice.py | 2 ++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/openmc/cell.py b/openmc/cell.py index c138f3044..cf247963a 100644 --- a/openmc/cell.py +++ b/openmc/cell.py @@ -9,7 +9,6 @@ import openmc.checkvalue as cv from openmc.surface import Halfspace from openmc.region import Region, Intersection, Complement - if sys.version_info[0] >= 3: basestring = str @@ -112,7 +111,7 @@ class Cell(object): string += ', '.join(['void' if m == 'void' else str(m.id) for m in self.fill]) string += ']\n' - elif isinstance(self._fill, (Universe, Lattice)): + elif isinstance(self._fill, (openmc.Universe, openmc.Lattice)): string += '{0: <16}{1}{2}\n'.format('\tFill', '=\t', self._fill._id) else: @@ -210,10 +209,10 @@ class Cell(object): (openmc.Material, basestring)) self._type = 'normal' - elif isinstance(fill, Universe): + elif isinstance(fill, openmc.Universe): self._type = 'fill' - elif isinstance(fill, Lattice): + elif isinstance(fill, openmc.Lattice): self._type = 'lattice' else: @@ -407,7 +406,7 @@ class Cell(object): element.set("material", ' '.join([m if m == 'void' else str(m.id) for m in self.fill])) - elif isinstance(self.fill, (Universe, Lattice)): + elif isinstance(self.fill, (openmc.Universe, openmc.Lattice)): element.set("fill", str(self.fill.id)) self.fill.create_xml_subelement(xml_element) diff --git a/openmc/lattice.py b/openmc/lattice.py index 6417eef3c..1b478e537 100644 --- a/openmc/lattice.py +++ b/openmc/lattice.py @@ -1,10 +1,12 @@ import abc from collections import OrderedDict, Iterable from numbers import Real, Integral +from xml.etree import ElementTree as ET import sys import numpy as np +import openmc.checkvalue as cv from openmc.universe import Universe, AUTO_UNIVERSE_ID if sys.version_info[0] >= 3: