fancy_gym.register

fancy_gym.register(id: str, entry_point: ~typing.Optional[~typing.Union[~typing.Callable, str]] = None, mp_wrapper: ~fancy_gym.black_box.raw_interface_wrapper.RawInterfaceWrapper = <class 'fancy_gym.envs.registry.DefaultMPWrapper'>, register_step_based: bool = True, add_mp_types: ~typing.List[str] = ['ProMP', 'DMP', 'ProDMP'], mp_config_override: ~typing.Dict[str, ~typing.Any] = {}, **kwargs)[source]

Registers a Gymnasium environment, including Movement Primitives (MP) versions. If you only want to register MP versions for an already registered environment, use fancy_gym.upgrade instead.

Args:

id (str): The unique identifier for the environment. entry_point (Optional[Union[Callable, str]]): The entry point for creating the environment. mp_wrapper (RawInterfaceWrapper): The MP wrapper for the environment. register_step_based (bool): Whether to also register the raw srtep-based version of the environment (default True). add_mp_types (List[str]): List of additional MP types to register. mp_config_override (Dict[str, Any]): Dictionary for overriding MP configuration. **kwargs: Additional keyword arguments which are passed to the environment constructor.

Notes:
  • When register_step_based is True, the raw environment will also be registered to gymnasium otherwise only mp-versions will be registered.

  • entry_point can be given as a string, allowing the same notation as gymnasium.

  • If id already exists in the Gymnasium registry and register_step_based is True, a warning message will be printed, suggesting to set register_step_based=False or use fancy_gym.upgrade.

Example:

To register a step-based environment with Movement Primitive versions (will use default mp_wrapper): >>> register(“MyEnv-v0”, MyEnvClass”my_module:MyEnvClass”)

The entry point can also be provided as a string: >>> register(“MyEnv-v0”, “my_module:MyEnvClass”)