Skip to content
Snippets Groups Projects
Commit 03dd5fb4 authored by Stefano Borini's avatar Stefano Borini
Browse files

Fixed tests and other occurrences of the member var name

parent ed991763
No related branches found
No related tags found
1 merge request!116Renamed InputSlotMap to InputSlotInfo
...@@ -111,13 +111,13 @@ def _compute_layer_results(environment_data_values, ...@@ -111,13 +111,13 @@ def _compute_layer_results(environment_data_values,
# Binding performs the extraction of the specified data values # Binding performs the extraction of the specified data values
# satisfying the above input slots from the environment data values # satisfying the above input slots from the environment data values
# considering what the user specified in terms of names (which is # considering what the user specified in terms of names (which is
# in the model input slot maps. # in the model input slot info
# The resulting data are the ones picked by name from the # The resulting data are the ones picked by name from the
# environment data values, and in the appropriate ordering as # environment data values, and in the appropriate ordering as
# needed by the input slots. # needed by the input slots.
passed_data_values = _bind_data_values( passed_data_values = _bind_data_values(
environment_data_values, environment_data_values,
model.input_slot_maps, model.input_slot_info,
in_slots) in_slots)
# execute data source, passing only relevant data values. # execute data source, passing only relevant data values.
......
...@@ -20,7 +20,7 @@ class BaseDataSourceModel(ABCHasStrictTraits): ...@@ -20,7 +20,7 @@ class BaseDataSourceModel(ABCHasStrictTraits):
#: Specifies binding between input slots and source for that value. #: Specifies binding between input slots and source for that value.
#: Each InputSlotMap instance specifies this information for each of the #: Each InputSlotMap instance specifies this information for each of the
#: slots. #: slots.
input_slot_maps = List(Instance(InputSlotInfo), visible=False) input_slot_info = List(Instance(InputSlotInfo), visible=False)
#: Allows to assign names to the output slots, so that they can be #: Allows to assign names to the output slots, so that they can be
#: referenced somewhere else (e.g. the KPICalculators). #: referenced somewhere else (e.g. the KPICalculators).
...@@ -41,7 +41,7 @@ class BaseDataSourceModel(ABCHasStrictTraits): ...@@ -41,7 +41,7 @@ class BaseDataSourceModel(ABCHasStrictTraits):
def __getstate__(self): def __getstate__(self):
state = super(BaseDataSourceModel, self).__getstate__() state = super(BaseDataSourceModel, self).__getstate__()
state["input_slot_maps"] = [ state["input_slot_info"] = [
x.__getstate__() for x in self.input_slot_maps x.__getstate__() for x in self.input_slot_info
] ]
return state return state
...@@ -23,11 +23,11 @@ class TestBaseDataSourceModel(unittest.TestCase): ...@@ -23,11 +23,11 @@ class TestBaseDataSourceModel(unittest.TestCase):
model.__getstate__(), model.__getstate__(),
{ {
"__traits_version__": "4.6.0", "__traits_version__": "4.6.0",
"input_slot_maps": [], "input_slot_info": [],
"output_slot_names": [] "output_slot_names": []
}) })
model.input_slot_maps = [ model.input_slot_info = [
InputSlotInfo( InputSlotInfo(
name="foo" name="foo"
), ),
...@@ -41,7 +41,7 @@ class TestBaseDataSourceModel(unittest.TestCase): ...@@ -41,7 +41,7 @@ class TestBaseDataSourceModel(unittest.TestCase):
model.__getstate__(), model.__getstate__(),
{ {
"__traits_version__": "4.6.0", "__traits_version__": "4.6.0",
"input_slot_maps": [ "input_slot_info": [
{ {
"__traits_version__": "4.6.0", "__traits_version__": "4.6.0",
"source": "Environment", "source": "Environment",
......
...@@ -154,8 +154,8 @@ class WorkflowReader(HasStrictTraits): ...@@ -154,8 +154,8 @@ class WorkflowReader(HasStrictTraits):
ds_id = ds_entry["id"] ds_id = ds_entry["id"]
ds_factory = registry.data_source_factory_by_id(ds_id) ds_factory = registry.data_source_factory_by_id(ds_id)
model_data = ds_entry["model_data"] model_data = ds_entry["model_data"]
model_data["input_slot_maps"] = self._extract_input_slot_maps( model_data["input_slot_info"] = self._extract_input_slot_info(
model_data["input_slot_maps"] model_data["input_slot_info"]
) )
layer.append(ds_factory.create_model(model_data)) layer.append(ds_factory.create_model(model_data))
layers.append(layer) layers.append(layer)
...@@ -183,8 +183,8 @@ class WorkflowReader(HasStrictTraits): ...@@ -183,8 +183,8 @@ class WorkflowReader(HasStrictTraits):
kpic_id = kpic_entry["id"] kpic_id = kpic_entry["id"]
kpic_factory = registry.kpi_calculator_factory_by_id(kpic_id) kpic_factory = registry.kpi_calculator_factory_by_id(kpic_id)
model_data = kpic_entry["model_data"] model_data = kpic_entry["model_data"]
model_data["input_slot_maps"] = self._extract_input_slot_maps( model_data["input_slot_info"] = self._extract_input_slot_info(
model_data["input_slot_maps"] model_data["input_slot_info"]
) )
kpi_calculators.append( kpi_calculators.append(
...@@ -217,8 +217,8 @@ class WorkflowReader(HasStrictTraits): ...@@ -217,8 +217,8 @@ class WorkflowReader(HasStrictTraits):
return parameters return parameters
def _extract_input_slot_maps(self, maps_data): def _extract_input_slot_info(self, info):
return [InputSlotInfo(**d) for d in maps_data] return [InputSlotInfo(**d) for d in info]
def _extract_notification_listeners(self, wf_data): def _extract_notification_listeners(self, wf_data):
registry = self.factory_registry registry = self.factory_registry
......
...@@ -20,7 +20,7 @@ class BaseKPICalculatorModel(ABCHasStrictTraits): ...@@ -20,7 +20,7 @@ class BaseKPICalculatorModel(ABCHasStrictTraits):
#: Specifies binding between input slots and source for that value. #: Specifies binding between input slots and source for that value.
#: Each InputSlotMap instance specifies this information for each of the #: Each InputSlotMap instance specifies this information for each of the
#: slots. #: slots.
input_slot_maps = List(Instance(InputSlotInfo), visible=False) input_slot_info = List(Instance(InputSlotInfo), visible=False)
#: Allows to assign names to the output slots, so that they can be #: Allows to assign names to the output slots, so that they can be
#: referenced somewhere else (e.g. the KPICalculators). #: referenced somewhere else (e.g. the KPICalculators).
...@@ -41,7 +41,7 @@ class BaseKPICalculatorModel(ABCHasStrictTraits): ...@@ -41,7 +41,7 @@ class BaseKPICalculatorModel(ABCHasStrictTraits):
def __getstate__(self): def __getstate__(self):
state = super(BaseKPICalculatorModel, self).__getstate__() state = super(BaseKPICalculatorModel, self).__getstate__()
state["input_slot_maps"] = [ state["input_slot_info"] = [
x.__getstate__() for x in self.input_slot_maps x.__getstate__() for x in self.input_slot_info
] ]
return state return state
...@@ -22,11 +22,11 @@ class TestBaseKPICalculatorModel(unittest.TestCase): ...@@ -22,11 +22,11 @@ class TestBaseKPICalculatorModel(unittest.TestCase):
model.__getstate__(), model.__getstate__(),
{ {
"__traits_version__": "4.6.0", "__traits_version__": "4.6.0",
"input_slot_maps": [], "input_slot_info": [],
"output_slot_names": [] "output_slot_names": []
}) })
model.input_slot_maps = [ model.input_slot_info = [
InputSlotInfo( InputSlotInfo(
name="foo" name="foo"
), ),
...@@ -40,7 +40,7 @@ class TestBaseKPICalculatorModel(unittest.TestCase): ...@@ -40,7 +40,7 @@ class TestBaseKPICalculatorModel(unittest.TestCase):
model.__getstate__(), model.__getstate__(),
{ {
"__traits_version__": "4.6.0", "__traits_version__": "4.6.0",
"input_slot_maps": [ "input_slot_info": [
{ {
"__traits_version__": "4.6.0", "__traits_version__": "4.6.0",
"source": "Environment", "source": "Environment",
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
{ {
"id": "force.bdss.enthought.factory.test_ds", "id": "force.bdss.enthought.factory.test_ds",
"model_data": { "model_data": {
"input_slot_maps": [ "input_slot_info": [
], ],
"output_slot_names": [ "output_slot_names": [
] ]
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
{ {
"id": "force.bdss.enthought.factory.test_kpic", "id": "force.bdss.enthought.factory.test_kpic",
"model_data": { "model_data": {
"input_slot_maps": [ "input_slot_info": [
], ],
"output_slot_names": [ "output_slot_names": [
] ]
......
...@@ -213,7 +213,7 @@ class TestCoreEvaluationDriver(unittest.TestCase): ...@@ -213,7 +213,7 @@ class TestCoreEvaluationDriver(unittest.TestCase):
run_function=run) run_function=run)
evaluator_model = ds_factory.create_model() evaluator_model = ds_factory.create_model()
evaluator_model.input_slot_maps = [ evaluator_model.input_slot_info = [
InputSlotInfo(name="foo"), InputSlotInfo(name="foo"),
InputSlotInfo(name="quux") InputSlotInfo(name="quux")
] ]
...@@ -288,7 +288,7 @@ class TestCoreEvaluationDriver(unittest.TestCase): ...@@ -288,7 +288,7 @@ class TestCoreEvaluationDriver(unittest.TestCase):
) )
# Layer 0 # Layer 0
model = adder_factory.create_model() model = adder_factory.create_model()
model.input_slot_maps = [ model.input_slot_info = [
InputSlotInfo(name="in1"), InputSlotInfo(name="in1"),
InputSlotInfo(name="in2") InputSlotInfo(name="in2")
] ]
...@@ -296,7 +296,7 @@ class TestCoreEvaluationDriver(unittest.TestCase): ...@@ -296,7 +296,7 @@ class TestCoreEvaluationDriver(unittest.TestCase):
wf.execution_layers[0].append(model) wf.execution_layers[0].append(model)
model = adder_factory.create_model() model = adder_factory.create_model()
model.input_slot_maps = [ model.input_slot_info = [
InputSlotInfo(name="in3"), InputSlotInfo(name="in3"),
InputSlotInfo(name="in4") InputSlotInfo(name="in4")
] ]
...@@ -305,7 +305,7 @@ class TestCoreEvaluationDriver(unittest.TestCase): ...@@ -305,7 +305,7 @@ class TestCoreEvaluationDriver(unittest.TestCase):
# layer 1 # layer 1
model = adder_factory.create_model() model = adder_factory.create_model()
model.input_slot_maps = [ model.input_slot_info = [
InputSlotInfo(name="res1"), InputSlotInfo(name="res1"),
InputSlotInfo(name="res2") InputSlotInfo(name="res2")
] ]
...@@ -314,7 +314,7 @@ class TestCoreEvaluationDriver(unittest.TestCase): ...@@ -314,7 +314,7 @@ class TestCoreEvaluationDriver(unittest.TestCase):
# layer 2 # layer 2
model = multiplier_factory.create_model() model = multiplier_factory.create_model()
model.input_slot_maps = [ model.input_slot_info = [
InputSlotInfo(name="res3"), InputSlotInfo(name="res3"),
InputSlotInfo(name="res1") InputSlotInfo(name="res1")
] ]
...@@ -323,7 +323,7 @@ class TestCoreEvaluationDriver(unittest.TestCase): ...@@ -323,7 +323,7 @@ class TestCoreEvaluationDriver(unittest.TestCase):
# KPI layer # KPI layer
model = multiplier_kpi_factory.create_model() model = multiplier_kpi_factory.create_model()
model.input_slot_maps = [ model.input_slot_info = [
InputSlotInfo(name="res4"), InputSlotInfo(name="res4"),
InputSlotInfo(name="res2") InputSlotInfo(name="res2")
] ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment