diff --git a/tests/envs/__init__.py b/tests/envs/__init__.py deleted file mode 100644 index adfc257a2..000000000 --- a/tests/envs/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2024 The HuggingFace Inc. team. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - diff --git a/tests/envs/dummy_hub_env.py b/tests/envs/dummy_hub_env.py deleted file mode 100644 index 50b6bc2eb..000000000 --- a/tests/envs/dummy_hub_env.py +++ /dev/null @@ -1,55 +0,0 @@ -# env.py - Upload this to your Hub repository -# Example: huggingface.co/your-username/test-kwargs-env - -import gymnasium as gym -from gymnasium.vector import SyncVectorEnv - - -def make_env( - n_envs=1, - use_async_envs=False, - config_path=None, - config_overrides=None, - **kwargs, -): - """ - Create vectorized CartPole environments with configurable options. - - Args: - n_envs: Number of parallel environments - use_async_envs: Whether to use AsyncVectorEnv or SyncVectorEnv - config_path: Optional path to a config file (for demonstration) - config_overrides: Optional dict of config overrides - **kwargs: Additional configuration options - - Returns: - dict mapping suite name to task environments - """ - # Merge all config sources for demonstration - config = {} - if config_overrides: - config.update(config_overrides) - config.update(kwargs) - - # Store config in a way the test can verify - # In a real env, you'd use these to configure the simulation - stored_config = { - "config_path": config_path, - "config_overrides": config_overrides, - "extra_kwargs": kwargs, - } - - def _mk(): - env = gym.make("CartPole-v1") - # Attach config to env for test verification - env.hub_config = stored_config - return env - - Vec = gym.vector.AsyncVectorEnv if use_async_envs else SyncVectorEnv - vec_env = Vec([_mk for _ in range(n_envs)]) - - # Also attach to vector env for easy access in tests - vec_env.hub_config = stored_config - - return {"cartpole_suite": {0: vec_env}} -