forked from M-Labs/artiq
language: check_unprocessed_arguments after constructing experiment
Signed-off-by: Nico Pulido-Mateo <pulido@iqo.uni-hannover.de>
This commit is contained in:
parent
dee154b35b
commit
88c5109627
|
@ -53,6 +53,8 @@ def main():
|
||||||
arguments = parse_arguments(args.arguments)
|
arguments = parse_arguments(args.arguments)
|
||||||
argument_mgr = ProcessArgumentManager(arguments)
|
argument_mgr = ProcessArgumentManager(arguments)
|
||||||
exp_inst = exp((device_mgr, dataset_mgr, argument_mgr, {}))
|
exp_inst = exp((device_mgr, dataset_mgr, argument_mgr, {}))
|
||||||
|
argument_mgr.check_unprocessed_arguments()
|
||||||
|
|
||||||
|
|
||||||
if not hasattr(exp.run, "artiq_embedded"):
|
if not hasattr(exp.run, "artiq_embedded"):
|
||||||
raise ValueError("Experiment entry point must be a kernel")
|
raise ValueError("Experiment entry point must be a kernel")
|
||||||
|
|
|
@ -184,7 +184,9 @@ def _build_experiment(device_mgr, dataset_mgr, args):
|
||||||
"arguments": arguments
|
"arguments": arguments
|
||||||
}
|
}
|
||||||
device_mgr.virtual_devices["scheduler"].expid = expid
|
device_mgr.virtual_devices["scheduler"].expid = expid
|
||||||
return get_experiment(module, args.class_name)(managers)
|
exp_inst = get_experiment(module, args.class_name)(managers)
|
||||||
|
argument_mgr.check_unprocessed_arguments()
|
||||||
|
return exp_inst
|
||||||
|
|
||||||
|
|
||||||
def run(with_file=False):
|
def run(with_file=False):
|
||||||
|
|
|
@ -209,8 +209,6 @@ class TraceArgumentManager:
|
||||||
self.requested_args[key] = processor, group, tooltip
|
self.requested_args[key] = processor, group, tooltip
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def check_unprocessed_arguments(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
class ProcessArgumentManager:
|
class ProcessArgumentManager:
|
||||||
def __init__(self, unprocessed_arguments):
|
def __init__(self, unprocessed_arguments):
|
||||||
|
@ -252,8 +250,6 @@ class HasEnvironment:
|
||||||
self.__in_build = True
|
self.__in_build = True
|
||||||
self.build(*args, **kwargs)
|
self.build(*args, **kwargs)
|
||||||
self.__in_build = False
|
self.__in_build = False
|
||||||
if self.__argument_mgr is not None:
|
|
||||||
self.__argument_mgr.check_unprocessed_arguments()
|
|
||||||
|
|
||||||
def register_child(self, child):
|
def register_child(self, child):
|
||||||
self.children.append(child)
|
self.children.append(child)
|
||||||
|
|
|
@ -333,6 +333,7 @@ def main():
|
||||||
os.chdir(dirname)
|
os.chdir(dirname)
|
||||||
argument_mgr = ProcessArgumentManager(expid["arguments"])
|
argument_mgr = ProcessArgumentManager(expid["arguments"])
|
||||||
exp_inst = exp((device_mgr, dataset_mgr, argument_mgr, {}))
|
exp_inst = exp((device_mgr, dataset_mgr, argument_mgr, {}))
|
||||||
|
argument_mgr.check_unprocessed_arguments()
|
||||||
put_completed()
|
put_completed()
|
||||||
elif action == "prepare":
|
elif action == "prepare":
|
||||||
exp_inst.prepare()
|
exp_inst.prepare()
|
||||||
|
|
Loading…
Reference in New Issue