Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make XRay robust to traces without goal #30

Merged
merged 3 commits into from
Sep 24, 2024
Merged

Make XRay robust to traces without goal #30

merged 3 commits into from
Sep 24, 2024

Conversation

gasse
Copy link
Collaborator

@gasse gasse commented Sep 18, 2024

This happens when env.reset() fails

@gasse gasse requested a review from recursix September 18, 2024 15:11
recursix
recursix previously approved these changes Sep 18, 2024
goal = step_info.obs["goal"]
try:
goal = step_info.obs["goal"]
except:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid generic except, this can lead to silent error. I think it's except KeyError or something like that.

@@ -648,7 +648,10 @@ def get_episode_info(info: Info):
env_args = info.exp_result.exp_args.env_args
steps_info = info.exp_result.steps_info
step_info = steps_info[info.step]
goal = step_info.obs["goal"]
try:
goal = step_info.obs["goal"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
goal = step_info.obs["goal"]
goal = step_info.obs.get("goal", None)

@recursix recursix merged commit c5c7605 into main Sep 24, 2024
2 checks passed
@recursix recursix deleted the gasse/patch_4 branch September 24, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants