diff --git a/openmc/lattice.py b/openmc/lattice.py index 3bb6e825e..be5f22db9 100644 --- a/openmc/lattice.py +++ b/openmc/lattice.py @@ -56,11 +56,11 @@ class Lattice(object): return False elif self.name != other.name: return False - elif self.pitch != other.pitch: + elif np.any(self.pitch != other.pitch): return False elif self.outer != other.outer: return False - elif self.universes != other.universes: + elif np.any(self.universes != other.universes): return False else: return True @@ -533,7 +533,7 @@ class RectLattice(Lattice): return False elif self.shape != other.shape: return False - elif self.lower_left != other.lower_left: + elif np.any(self.lower_left != other.lower_left): return False else: return True diff --git a/openmc/universe.py b/openmc/universe.py index e69bbd7c4..006a77a54 100644 --- a/openmc/universe.py +++ b/openmc/universe.py @@ -76,17 +76,10 @@ class Universe(object): return False elif self.name != other.name: return False - elif len(self.cells) != len(other.cells): + elif dict.__eq__(self.cells, other.cells): return False - - # Check each cell - for cell_id in self.cells: - if cell_id not in other.cells: - return False - if self.cells[cell_id] != other.cells[cell_id]: - return False - - return True + else: + return True def __ne__(self, other): return not self == other