get_experiment() is able to get nested experiment classes using dots in class names.

Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
This commit is contained in:
Leon Riesebos 2021-02-27 15:05:02 -05:00 committed by Sébastien Bourdeauducq
parent 3c68223337
commit 1deaa758ce

View File

@ -89,7 +89,10 @@ def file_import(filename, prefix="file_import_"):
def get_experiment(module, class_name=None):
if class_name:
return getattr(module, class_name)
obj = module
for name in class_name.split('.'):
obj = getattr(obj, name)
return obj
exps = inspect.getmembers(module, is_public_experiment)