environment,worker: remove enable_processors

This commit is contained in:
Sebastien Bourdeauducq 2016-04-16 14:21:01 +08:00
parent 0a259418fb
commit 08f903b8f4
2 changed files with 4 additions and 10 deletions

View File

@ -149,14 +149,13 @@ class HasEnvironment:
"""Provides methods to manage the environment of an experiment (devices, """Provides methods to manage the environment of an experiment (devices,
parameters, results, arguments).""" parameters, results, arguments)."""
def __init__(self, device_mgr=None, dataset_mgr=None, *, parent=None, def __init__(self, device_mgr=None, dataset_mgr=None, *, parent=None,
default_arg_none=False, enable_processors=False, **kwargs): default_arg_none=False, **kwargs):
self.requested_args = OrderedDict() self.requested_args = OrderedDict()
self.__device_mgr = device_mgr self.__device_mgr = device_mgr
self.__dataset_mgr = dataset_mgr self.__dataset_mgr = dataset_mgr
self.__parent = parent self.__parent = parent
self.__default_arg_none = default_arg_none self.__default_arg_none = default_arg_none
self.__enable_processors = enable_processors
self.__kwargs = kwargs self.__kwargs = kwargs
self.__in_build = True self.__in_build = True
@ -215,10 +214,7 @@ class HasEnvironment:
return None return None
else: else:
raise raise
if self.__enable_processors:
return processor.process(argval) return processor.process(argval)
else:
return argval
def setattr_argument(self, key, processor=None, group=None): def setattr_argument(self, key, processor=None, group=None):
"""Sets an argument as attribute. The names of the argument and of the """Sets an argument as attribute. The names of the argument and of the

View File

@ -139,8 +139,7 @@ def examine(device_mgr, dataset_mgr, file):
if name[-1] == ".": if name[-1] == ".":
name = name[:-1] name = name[:-1]
exp_inst = exp_class(device_mgr, dataset_mgr, exp_inst = exp_class(device_mgr, dataset_mgr,
default_arg_none=True, default_arg_none=True)
enable_processors=True)
arginfo = OrderedDict( arginfo = OrderedDict(
(k, (proc.describe(), group)) (k, (proc.describe(), group))
for k, (proc, group) in exp_inst.requested_args.items()) for k, (proc, group) in exp_inst.requested_args.items())
@ -210,8 +209,7 @@ def main():
device_mgr.virtual_devices["scheduler"].set_run_info( device_mgr.virtual_devices["scheduler"].set_run_info(
rid, obj["pipeline_name"], expid, obj["priority"]) rid, obj["pipeline_name"], expid, obj["priority"])
exp_inst = exp( exp_inst = exp(
device_mgr, dataset_mgr, enable_processors=True, device_mgr, dataset_mgr, **expid["arguments"])
**expid["arguments"])
put_object({"action": "completed"}) put_object({"action": "completed"})
elif action == "prepare": elif action == "prepare":
exp_inst.prepare() exp_inst.prepare()