Skip to content

Commit

Permalink
More touch ups to error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Sep 25, 2023
1 parent 52622d0 commit e776f6a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pydra/engine/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ def _check_for_hash_changes(self):
f"- the {field.type} object passed to '{changed}' field appears to "
f"have an unstable hash. The {field.type}.__bytes_repr__() method "
"can be implemented to provide stable hashes for this type. "
"See pydra/utils.hash.py for examples.\n"
"See pydra/utils/hash.py for examples.\n"
)
if hash_changes:
raise RuntimeError(
Expand Down
19 changes: 16 additions & 3 deletions pydra/engine/submitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ async def expand_workflow(self, wf, rerun=False):
}
graph_checksums = dict(wf.inputs._graph_checksums)

hashes_have_changed = False
for task, waiting_on in outstanding.items():
if not waiting_on:
continue

Check warning on line 188 in pydra/engine/submitter.py

View check run for this annotation

Codecov / codecov/patch

pydra/engine/submitter.py#L188

Added line #L188 was not covered by tests
Expand All @@ -193,13 +194,25 @@ async def expand_workflow(self, wf, rerun=False):
f"Current values and hashes: {pred.inputs}, "
f"{pred.inputs._hashes}\n"
)
hashes_have_changed = True
elif pred not in outstanding:
msg += (

Check warning on line 199 in pydra/engine/submitter.py

View check run for this annotation

Codecov / codecov/patch

pydra/engine/submitter.py#L199

Added line #L199 was not covered by tests
f" - undiagnosed issues in '{pred.name}' node "
"(potentially related to the file-system)"
f" - undiagnosed issues in '{pred.name}' node, "
"potentially related to file-system access issues "
)
msg += "\n"
msg += "Set loglevel to 'debug' in order to track hash changes"
if hashes_have_changed:
msg += (
"Set loglevel to 'debug' in order to track hash changes "
"throughout the execution of the workflow.\n\n "
"These issues may have been caused by `bytes_repr()` methods "
"that don't return stable hash values for specific object "
"types across multiple processes (see bytes_repr() "
'"singledispatch "function in pydra/utils/hash.py).'
"You may need to implement a specific `bytes_repr()` "
'"singledispatch overload"s or `__bytes_repr__()` '
"dunder methods to handle one or more types in "
)
raise RuntimeError(msg)
for task in tasks:
# grab inputs if needed
Expand Down

0 comments on commit e776f6a

Please sign in to comment.