Skip to content

Commit

Permalink
Remove __eq__ and __hash__ on Material
Browse files Browse the repository at this point in the history
  • Loading branch information
paulromano committed Dec 17, 2017
1 parent b771fb7 commit 3c9e259
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions openmc/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,33 +115,6 @@ def __init__(self, material_id=None, name='', temperature=None):
# If specified, this file will be used instead of composition values
self._distrib_otf_file = None

def __eq__(self, other):
if not isinstance(other, Material):
return False
elif self.id != other.id:
return False
elif self.name != other.name:
return False
# FIXME: We cannot compare densities since OpenMC outputs densities
# in atom/b-cm in summary.h5 irregardless of input units, and we
# cannot compute the sum percent in Python since we lack AWR
#elif self.density != other.density:
# return False
#elif self._nuclides != other._nuclides:
# return False
#elif self._elements != other._elements:
# return False
elif self._sab != other._sab:
return False
else:
return True

def __ne__(self, other):
return not self == other

def __hash__(self):
return hash(repr(self))

def __repr__(self):
string = 'Material\n'
string += '{: <16}=\t{}\n'.format('\tID', self._id)
Expand Down

0 comments on commit 3c9e259

Please sign in to comment.