refactor(env): introduce explicit gym ID handling in EnvConfig/factory
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 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.
How it was tested
- Tested to make sure existing environment configs still work with this change (ran test suite)
- Added a test for a dummy external env config in (
tests/envs/test_envs.py::test_factory_custom_gym_id)
How to checkout & try? (for the reviewer)
pytest -sx tests/envs/test_envs.py
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!
Hi @AdilZouitine , thanks for the approval!
I had to rebase this commit due to the common->src folder structure change. Otherwise, the code is exactly the same as when you approved it.
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?