Skip to content

fix: normalize episode_seed type to prevent TypeError in replay_trajectory#1430

Open
Ottohere-Mourn wants to merge 1 commit into
mani-skill:mainfrom
Ottohere-Mourn:fix/issue-1413
Open

fix: normalize episode_seed type to prevent TypeError in replay_trajectory#1430
Ottohere-Mourn wants to merge 1 commit into
mani-skill:mainfrom
Ottohere-Mourn:fix/issue-1413

Conversation

@Ottohere-Mourn

@Ottohere-Mourn Ottohere-Mourn commented Jun 7, 2026

Copy link
Copy Markdown

Summary

  • Fixed TypeError: 'int' object is not subscriptable when using --use-env-states with --record-rewards and observation recording flags in replay_trajectory
  • The episode_seed field can be stored as a numpy array, list, or scalar int depending on how the trajectory was collected
  • Added normalization logic to convert episode_seed to a scalar int before comparison or assignment
  • Handles numpy arrays (0-d and 1-d), lists, tuples, and plain ints

Fixes #1413

Test Plan

  • python -m mani_skill.trajectory.replay_trajectory --traj-path <path> --record-rewards --use-env-states --save-traj no longer raises TypeError
  • Existing replay functionality continues to work without --use-env-states

…ctory

Fixes mani-skill#1413

The episode_seed field can be stored as a numpy array, list, or scalar
depending on how the trajectory was collected. Previously this would
cause a TypeError when the code tried to subscript an int or compare a
numpy array directly. Now the seed is normalized to a scalar int before
any comparison or assignment.
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.

Adding observations and rewards to trajectories gives an error in Maniskill 3

1 participant