You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug: get_dict() not updated for new 9-field trace tuples
The trace tuples were expanded from 5 fields to 9 fields in this PR, but get_dict() was not updated to handle the new format. This causes a ValueError at runtime when any code calls interpretation.get_dict().
Error
File "pyreason/scripts/interpretation/interpretation.py", line 698, in get_dict
time, _, node, l, bnd = change
ValueError: too many values to unpack (expected 5)
The proper fix should unpack all 9 fields, not slice to 5. This keeps get_dict() consistent with the new tuple format and allows it to use any of the new fields if needed in the future.
For nodes (line 698):
time, _, node, l, bnd, consistent, triggered_by, name, inconsistency_msg=change
For edges (line 708):
time, _, edge, l, bnd, consistent, triggered_by, name, inconsistency_msg=change
The rest of the method body can remain the same since it only uses time, node/edge, l, and bnd — but unpacking all 9 makes the code self-documenting and future-proof.
Broader issue: get_dict() return value should include new metadata
Just unpacking 9 fields fixes the crash, but it still discards the 4 new fields (consistent, triggered_by, name, inconsistency_msg) — meaning downstream consumers calling get_dict() have no way to access the detailed atom trace data this PR adds.
The return structure should be updated to include the new metadata. For example, instead of:
Otherwise the whole point of this PR (richer trace explainability) is only accessible through the raw trace tuples or CSV output, but not through the get_dict() API that downstream code actually uses.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.