From 97972ae1de4811ff134025cde5e1e9c92be485a0 Mon Sep 17 00:00:00 2001 From: Pepijn Date: Wed, 8 Apr 2026 12:46:07 +0200 Subject: [PATCH] refactor(envs): remove unused _get_sub_env_attr helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _get_sub_env_attr was defined but never called anywhere in the codebase. _sub_env_has_attr (its sibling) is kept — it is actively used in utils.py. Co-Authored-By: Claude Sonnet 4.6 --- src/lerobot/envs/utils.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/lerobot/envs/utils.py b/src/lerobot/envs/utils.py index f77e14812..dfaaa3e3e 100644 --- a/src/lerobot/envs/utils.py +++ b/src/lerobot/envs/utils.py @@ -130,14 +130,6 @@ def env_to_policy_features(env_cfg: EnvConfig) -> dict[str, PolicyFeature]: return policy_features -def _get_sub_env_attr(env: gym.vector.VectorEnv, attr: str, index: int = 0): - """Retrieve an attribute from a sub-environment, works for both Sync and Async.""" - try: - return env.get_attr(attr)[index] - except (AttributeError, Exception): - return None - - def _sub_env_has_attr(env: gym.vector.VectorEnv, attr: str) -> bool: try: env.get_attr(attr)