entry_point does not have to be given, when skipping registration of step-based

This commit is contained in:
Dominik Moritz Roth 2023-07-24 10:30:34 +02:00
parent edd8c75ed3
commit bb20bb53ec

View File

@ -108,13 +108,15 @@ ALL_FANCY_MOVEMENT_PRIMITIVE_ENVIRONMENTS = {mp_type: [] for mp_type in KNOWN_MP
def register( def register(
id, id,
entry_point, entry_point=None,
mp_wrapper=DefaultMPWrapper, mp_wrapper=DefaultMPWrapper,
register_step_based=True, # TODO: Detect register_step_based=True, # TODO: Detect
add_mp_types=KNOWN_MPS, add_mp_types=KNOWN_MPS,
mp_config_override={}, mp_config_override={},
**kwargs **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) 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_name, attr_name = mp_wrapper.split(':')
mod = importlib.import_module(mod_name) mod = importlib.import_module(mod_name)