Skip to content

Trajectory

A dict[str, np.ndarray] with helpers. meta holds run facts (dt, worlds, health at the end).

frames property

frames: int

Number of recorded frames. Example: traj.frames.

world

world(w: int) -> Trajectory

The same frames for world w only (world axis dropped). Example: traj.world(0)["cube.pos"].shape.

save

save(path: str | Path, **extra: Any) -> Path

Write every array (plus extra arrays) with np.savez; returns the path.

Example: traj.world(0).save("out/traj.npz", faces=sim.faces("cloth")).

summary

summary() -> dict[str, Any]

Shapes and the run facts, JSON-ready. Example: {"frames": 201, "keys": {"cube.pos": [201, 1, 3]}}.