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
Branches
Tags
No related merge requests found
...@@ -529,8 +529,13 @@ class Field(AbstractField): ...@@ -529,8 +529,13 @@ class Field(AbstractField):
return Field.Access(self, center)(*args, **kwargs) return Field.Access(self, center)(*args, **kwargs)
def hashable_contents(self): def hashable_contents(self):
dth = hash(self._dtype) return (self._layout,
return self._layout, self.shape, self.strides, dth, self.field_type, self._field_name, self.latex_name self.shape,
self.strides,
self.field_type,
self._field_name,
self.latex_name,
self._dtype)
def __hash__(self): def __hash__(self):
return hash(self.hashable_contents()) return hash(self.hashable_contents())
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment