def test_trajectory_to_np_without_margin_cuts_last_observation(self):
    """Test that to_np with margin=0 cuts the last observation."""
    tr = rl_task.Trajectory(observation=0)
    for obs in range(1, 4):
      self._extend(tr, new_observation=obs)
    tr_np = tr.to_np(margin=0)
    np.testing.assert_array_equal(tr_np.observation, [0, 1, 2])
Test that to_np with margin=0 cuts the last observation.
trax/rl/task_test.py