Skip to content

Commit

Permalink
[patch] Fail to cache when equality comparison throws an exception (#396
Browse files Browse the repository at this point in the history
)

E.g. when comparing a numpy array to None. We continue greedily caching, but if it just doesn't work for some reason, the fallback is to simply not cache. Since the current and cached inputs (along with whether or not they generate a cache hit) is always available to the user, I think we still leave enough data for people to debug cache misses on their own.
  • Loading branch information
liamhuber authored Jul 31, 2024
1 parent 41d8d42 commit 2f7a7d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyiron_workflow/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,10 @@ def run_data_tree(self, run_parent_trees_too=False) -> None:

@property
def cache_hit(self):
return self.inputs.to_value_dict() == self.cached_inputs
try:
return self.inputs.to_value_dict() == self.cached_inputs
except:
return False

def _outputs_to_run_return(self):
return DotDict(self.outputs.to_value_dict())
Expand Down

0 comments on commit 2f7a7d0

Please sign in to comment.