Skip to content

Commit

Permalink
reverting some changes to hash_value: approach of adding cp.dumps(ob)…
Browse files Browse the repository at this point in the history
… to hash_value has to be better tested
  • Loading branch information
djarecka committed Feb 16, 2021
1 parent 5a085c4 commit 6bd33d0
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions pydra/engine/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,19 +696,8 @@ def hash_value(value, tp=None, metadata=None, precalculated=None):
return hash_dir(value, precalculated=precalculated)
elif type(value).__module__ == "numpy": # numpy objects
return sha256(value.tostring()).hexdigest()
elif (
isinstance(
value, (int, float, complex, bool, str, bytes, LazyField, os.PathLike)
)
or value is None
):
return value
else:
warnings.warn(
f"pydra doesn't fully support hashing for {type(value)}, "
f"cp.dumps is used in hash functions, so it could depend on the system"
)
return sha256(cp.dumps(value)).hexdigest()
return value


def output_from_inputfields(output_spec, input_spec):
Expand Down

0 comments on commit 6bd33d0

Please sign in to comment.