mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Remove __eq__ and __hash__ on geometry objects
This commit is contained in:
parent
598b5d4f2b
commit
61bdb5b322
4 changed files with 0 additions and 85 deletions
|
|
@ -108,32 +108,6 @@ class Cell(IDManagerMixin):
|
|||
else:
|
||||
return point in self.region
|
||||
|
||||
def __eq__(self, other):
|
||||
if not isinstance(other, Cell):
|
||||
return False
|
||||
elif self.id != other.id:
|
||||
return False
|
||||
elif self.name != other.name:
|
||||
return False
|
||||
elif self.fill != other.fill:
|
||||
return False
|
||||
elif self.region != other.region:
|
||||
return False
|
||||
elif self.rotation != other.rotation:
|
||||
return False
|
||||
elif self.temperature != other.temperature:
|
||||
return False
|
||||
elif self.translation != other.translation:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def __ne__(self, other):
|
||||
return not self == other
|
||||
|
||||
def __hash__(self):
|
||||
return hash(repr(self))
|
||||
|
||||
def __repr__(self):
|
||||
string = 'Cell\n'
|
||||
string += '{: <16}=\t{}\n'.format('\tID', self.id)
|
||||
|
|
|
|||
|
|
@ -517,24 +517,6 @@ class RectLattice(Lattice):
|
|||
# Initialize Lattice class attributes
|
||||
self._lower_left = None
|
||||
|
||||
def __eq__(self, other):
|
||||
if not isinstance(other, RectLattice):
|
||||
return False
|
||||
elif not super(RectLattice, self).__eq__(other):
|
||||
return False
|
||||
elif self.shape != other.shape:
|
||||
return False
|
||||
elif np.any(self.lower_left != other.lower_left):
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def __ne__(self, other):
|
||||
return not self == other
|
||||
|
||||
def __hash__(self):
|
||||
return hash(repr(self))
|
||||
|
||||
def __repr__(self):
|
||||
string = 'RectLattice\n'
|
||||
string += '{0: <16}{1}{2}\n'.format('\tID', '=\t', self._id)
|
||||
|
|
@ -864,26 +846,6 @@ class HexLattice(Lattice):
|
|||
self._num_axial = None
|
||||
self._center = None
|
||||
|
||||
def __eq__(self, other):
|
||||
if not isinstance(other, HexLattice):
|
||||
return False
|
||||
elif not super(HexLattice, self).__eq__(other):
|
||||
return False
|
||||
elif self.num_rings != other.num_rings:
|
||||
return False
|
||||
elif self.num_axial != other.num_axial:
|
||||
return False
|
||||
elif self.center != other.center:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def __ne__(self, other):
|
||||
return not self == other
|
||||
|
||||
def __hash__(self):
|
||||
return hash(repr(self))
|
||||
|
||||
def __repr__(self):
|
||||
string = 'HexLattice\n'
|
||||
string += '{0: <16}{1}{2}\n'.format('\tID', '=\t', self._id)
|
||||
|
|
|
|||
|
|
@ -79,9 +79,6 @@ class Surface(IDManagerMixin):
|
|||
def __pos__(self):
|
||||
return Halfspace(self, '+')
|
||||
|
||||
def __hash__(self):
|
||||
return hash(repr(self))
|
||||
|
||||
def __repr__(self):
|
||||
string = 'Surface\n'
|
||||
string += '{0: <16}{1}{2}\n'.format('\tID', '=\t', self._id)
|
||||
|
|
|
|||
|
|
@ -63,24 +63,6 @@ class Universe(IDManagerMixin):
|
|||
if cells is not None:
|
||||
self.add_cells(cells)
|
||||
|
||||
def __eq__(self, other):
|
||||
if not isinstance(other, Universe):
|
||||
return False
|
||||
elif self.id != other.id:
|
||||
return False
|
||||
elif self.name != other.name:
|
||||
return False
|
||||
elif dict.__ne__(self.cells, other.cells):
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def __ne__(self, other):
|
||||
return not self == other
|
||||
|
||||
def __hash__(self):
|
||||
return hash(repr(self))
|
||||
|
||||
def __repr__(self):
|
||||
string = 'Universe\n'
|
||||
string += '{0: <16}{1}{2}\n'.format('\tID', '=\t', self._id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue