Skip to content
Snippets Groups Projects
Commit 7e5faa0a authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Avoid `hash()` in Field.hashable_contents

hash should not be used in hashable_contents because even if we will use
a deterministic hash function we will end up non-deterministic since
hash is initialized with a random seed.
parent 974febd7
No related branches found
No related tags found
1 merge request!91Avoid `hash()` in Field.hashable_contents
......@@ -529,8 +529,13 @@ class Field(AbstractField):
return Field.Access(self, center)(*args, **kwargs)
def hashable_contents(self):
dth = hash(self._dtype)
return self._layout, self.shape, self.strides, dth, self.field_type, self._field_name, self.latex_name
return (self._layout,
self.shape,
self.strides,
self.field_type,
self._field_name,
self.latex_name,
self._dtype)
def __hash__(self):
return hash(self.hashable_contents())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment