mirror of https://github.com/m-labs/artiq.git
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:
parent
3c68223337
commit
1deaa758ce
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue