Remove eq/hash on Mesh and Tally

This commit is contained in:
Paul Romano 2017-11-29 11:05:52 -06:00
parent e2dfb5b5fb
commit b771fb7ae3
2 changed files with 1 additions and 47 deletions

View file

@ -11,7 +11,7 @@ import openmc
from openmc.mixin import EqualityMixin, IDManagerMixin
class Mesh(EqualityMixin, IDManagerMixin):
class Mesh(IDManagerMixin):
"""A structured Cartesian mesh in one, two, or three dimensions
Parameters
@ -124,9 +124,6 @@ class Mesh(EqualityMixin, IDManagerMixin):
cv.check_length('mesh width', width, 1, 3)
self._width = width
def __hash__(self):
return hash(repr(self))
def __repr__(self):
string = 'Mesh\n'
string += '{0: <16}{1}{2}\n'.format('\tID', '=\t', self._id)

View file

@ -129,49 +129,6 @@ class Tally(IDManagerMixin):
self._sp_filename = None
self._results_read = False
def __eq__(self, other):
if not isinstance(other, Tally):
return False
# Check all filters
if len(self.filters) != len(other.filters):
return False
for self_filter in self.filters:
if self_filter not in other.filters:
return False
# Check all nuclides
if len(self.nuclides) != len(other.nuclides):
return False
for nuclide in self.nuclides:
if nuclide not in other.nuclides:
return False
# Check derivatives
if self.derivative != other.derivative:
return False
# Check all scores
if len(self.scores) != len(other.scores):
return False
for score in self.scores:
if score not in other.scores:
return False
if self.estimator != other.estimator:
return False
return True
def __ne__(self, other):
return not self == other
def __hash__(self):
return hash(repr(self))
def __repr__(self):
string = 'Tally\n'
string += '{: <16}=\t{}\n'.format('\tID', self.id)