From b771fb7ae3bc54cc2c7e4083b71ae63595a1a88f Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 29 Nov 2017 11:05:52 -0600 Subject: [PATCH] Remove eq/hash on Mesh and Tally --- openmc/mesh.py | 5 +---- openmc/tallies.py | 43 ------------------------------------------- 2 files changed, 1 insertion(+), 47 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index 76a33d8e2d..b315b2628b 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -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) diff --git a/openmc/tallies.py b/openmc/tallies.py index de9a6657df..b358a14bcc 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -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)