Repository navigation
Conversation
1b98e80 to
e5c431d
Compare
|
Closely related to #807 (merged). This is a next step to help use LeRobot with external projects 😊 @imstevenpmwork I'm not sure who to tag who could review this, let me know if you think I should tag someone in particular! |
bc58fb7 to
e69070a
Compare
|
Hi @AdilZouitine , thanks for the approval! I had to rebase this commit due to the Can you take a look again? What needs to happen to get this merged? |
|
Hi @AdilZouitine, any update on this? What can I do to help get this merged? |
This commit introduces properties for the gym package/ID associated
with and environment config. They default to the current defaults
(`gym_{package_name}/{task_id}`) to avoid breaking changes, but allow
for easier use of external gym environments.
Subclasses of `EnvConfig` can override the default properties to allow
the factory to import (i.e. register) the gym env from a specific module,
and also instantiate the env from any ID string.
e69070a to
3779f3f
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR introduces explicit gym ID handling in EnvConfig by adding package_name and gym_id properties to support external gym environments. The changes maintain backward compatibility with existing environment configs while enabling subclasses to override these properties for custom gym environments.
- Adds
package_nameandgym_idproperties toEnvConfigwith default implementations - Updates the factory function to use the new properties instead of hardcoded string formatting
- Improves error handling and messaging when environments are not found in the gym registry
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/lerobot/envs/configs.py | Adds package_name and gym_id properties to EnvConfig base class |
| src/lerobot/envs/factory.py | Updates make_env to use new properties and improves error handling |
| tests/envs/test_envs.py | Adds test for custom gym ID functionality with dummy environment |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
for more information, see https://pre-commit.ci
3779f3f to
31e765e
Compare
|
Hi ! I'm closing this PR as it was superseded by #2234 (now merged). Best, Caroline. |
What this does (✨ Feature)
This commit introduces properties for the gym package/ID associated with an environment config. They default to the current defaults (
gym_{package_name}/{task_id}) to avoid breaking changes, but allow for easier use of external gym environments.Subclasses of
EnvConfigcan override the default properties to allow the factory to import (i.e. register) the gym env from a specific module, and also instantiate the env from any ID string.How it was tested
tests/envs/test_envs.py::test_factory_custom_gym_id)How to checkout & try? (for the reviewer)