From bb20bb53ec0c1a69d61fd3d28b2fadad252044f9 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Mon, 24 Jul 2023 10:30:34 +0200 Subject: [PATCH] entry_point does not have to be given, when skipping registration of step-based --- fancy_gym/envs/registry.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fancy_gym/envs/registry.py b/fancy_gym/envs/registry.py index ee52acc..7580e47 100644 --- a/fancy_gym/envs/registry.py +++ b/fancy_gym/envs/registry.py @@ -108,13 +108,15 @@ ALL_FANCY_MOVEMENT_PRIMITIVE_ENVIRONMENTS = {mp_type: [] for mp_type in KNOWN_MP def register( id, - entry_point, + entry_point=None, mp_wrapper=DefaultMPWrapper, register_step_based=True, # TODO: Detect add_mp_types=KNOWN_MPS, mp_config_override={}, **kwargs ): + if register_step_based: + assert entry_point != None, 'You need to provide an entry-point, when registering step-based.' if not callable(mp_wrapper): # mp_wrapper can be given as a String (same notation as for entry_point) mod_name, attr_name = mp_wrapper.split(':') mod = importlib.import_module(mod_name)