Skip to content

Commit 566a77b

Browse files
pkooijclaude
andcommitted
refactor(envs): remove unused add_envs_task
Replaced by env.call("task_description") in lerobot_eval.py. No callers remain in the codebase. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5bc90c7 commit 566a77b

1 file changed

Lines changed: 0 additions & 23 deletions

File tree

src/lerobot/envs/utils.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
from lerobot.configs.types import FeatureType, PolicyFeature
3131
from lerobot.envs.configs import EnvConfig
32-
from lerobot.types import RobotObservation
3332
from lerobot.utils.constants import OBS_ENV_STATE, OBS_IMAGE, OBS_IMAGES, OBS_STATE, OBS_STR
3433
from lerobot.utils.utils import get_channel_first_image_shape
3534

@@ -206,28 +205,6 @@ def check_env_attributes_and_types(env: gym.vector.VectorEnv) -> None:
206205
)
207206

208207

209-
def add_envs_task(env: gym.vector.VectorEnv, observation: RobotObservation) -> RobotObservation:
210-
"""Adds task feature to the observation dict with respect to the first environment attribute."""
211-
if _sub_env_has_attr(env, "task_description"):
212-
task_result = list(env.call("task_description"))
213-
214-
if not all(isinstance(item, str) for item in task_result):
215-
raise TypeError("All items in task_description result must be strings")
216-
217-
observation["task"] = task_result
218-
elif _sub_env_has_attr(env, "task"):
219-
task_result = list(env.call("task"))
220-
221-
if not all(isinstance(item, str) for item in task_result):
222-
raise TypeError("All items in task result must be strings")
223-
224-
observation["task"] = task_result
225-
else:
226-
num_envs = observation[list(observation.keys())[0]].shape[0]
227-
observation["task"] = ["" for _ in range(num_envs)]
228-
return observation
229-
230-
231208
def _close_single_env(env: Any) -> None:
232209
try:
233210
env.close()

0 commit comments

Comments
 (0)