Skip to content

Commit

Permalink
Remove eq/hash on Mesh and Tally
Browse files Browse the repository at this point in the history
  • Loading branch information
paulromano committed Dec 17, 2017
1 parent e2dfb5b commit b771fb7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 47 deletions.
5 changes: 1 addition & 4 deletions openmc/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from openmc.mixin import EqualityMixin, IDManagerMixin


class Mesh(EqualityMixin, IDManagerMixin):
class Mesh(IDManagerMixin):
"""A structured Cartesian mesh in one, two, or three dimensions
Parameters
Expand Down Expand Up @@ -124,9 +124,6 @@ def width(self, width):
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)
Expand Down
43 changes: 0 additions & 43 deletions openmc/tallies.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,49 +129,6 @@ def __init__(self, tally_id=None, name=''):
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)
Expand Down

0 comments on commit b771fb7

Please sign in to comment.