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

Allow for empty names to be used and discard the associated information

parent a35e1c0d
No related branches found
No related tags found
1 merge request!78Discard data value for empty name.
...@@ -137,7 +137,9 @@ class CoreEvaluationDriver(BaseCoreDriver): ...@@ -137,7 +137,9 @@ class CoreEvaluationDriver(BaseCoreDriver):
for dv, output_slot_name in zip(res, model.output_slot_names): for dv, output_slot_name in zip(res, model.output_slot_names):
dv.name = output_slot_name dv.name = output_slot_name
results.extend(res) # If the name was not specified, simply discard the value,
# because apparently the user is not interested in it.
results.extend([r for r in res if r.name != ""])
# Finally, return all the computed data values from all evaluators, # Finally, return all the computed data values from all evaluators,
# properly named. # properly named.
......
from traits.api import ABCHasStrictTraits, Instance, List, String from traits.api import ABCHasStrictTraits, Instance, List
from force_bdss.core.input_slot_map import InputSlotMap from force_bdss.core.input_slot_map import InputSlotMap
from force_bdss.local_traits import Identifier
from .i_data_source_factory import IDataSourceFactory from .i_data_source_factory import IDataSourceFactory
...@@ -23,7 +24,10 @@ class BaseDataSourceModel(ABCHasStrictTraits): ...@@ -23,7 +24,10 @@ class BaseDataSourceModel(ABCHasStrictTraits):
#: 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).
output_slot_names = List(String(), visible=False) #: If the name is the empty string, it means that the user is not
#: interested in preserving the information, and should therefore be
#: discarded and not propagated further.
output_slot_names = List(Identifier(), visible=False)
def __init__(self, factory, *args, **kwargs): def __init__(self, factory, *args, **kwargs):
self.factory = factory self.factory = factory
......
from traits.api import ABCHasStrictTraits, Instance, List, String from traits.api import ABCHasStrictTraits, Instance, List
from force_bdss.local_traits import Identifier
from ..core.input_slot_map import InputSlotMap from ..core.input_slot_map import InputSlotMap
from .i_kpi_calculator_factory import IKPICalculatorFactory from .i_kpi_calculator_factory import IKPICalculatorFactory
...@@ -23,7 +24,10 @@ class BaseKPICalculatorModel(ABCHasStrictTraits): ...@@ -23,7 +24,10 @@ class BaseKPICalculatorModel(ABCHasStrictTraits):
#: 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).
output_slot_names = List(String(), visible=False) #: If the name is the empty string, it means that the user is not
#: interested in preserving the information, and should therefore be
#: discarded and not propagated further.
output_slot_names = List(Identifier(), visible=False)
def __init__(self, factory, *args, **kwargs): def __init__(self, factory, *args, **kwargs):
self.factory = factory self.factory = factory
......
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