mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-15 08:39:49 +00:00
refactor(envs): remove unused _get_sub_env_attr helper
_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 <noreply@anthropic.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user