diff --git a/force_bdss/core_evaluation_driver.py b/force_bdss/core_evaluation_driver.py index e6457cabd1f52bafd7dfc6d25aa5aac02af44e56..a9779ea0be879b56b6d21f2d31e8696127160326 100644 --- a/force_bdss/core_evaluation_driver.py +++ b/force_bdss/core_evaluation_driver.py @@ -137,7 +137,9 @@ class CoreEvaluationDriver(BaseCoreDriver): for dv, output_slot_name in zip(res, model.output_slot_names): 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, # properly named. diff --git a/force_bdss/data_sources/base_data_source_model.py b/force_bdss/data_sources/base_data_source_model.py index ad1bd415ae083810469c71106130deefec757efc..08add5665ddab78e1f99770f2ed0b97e16a28e58 100644 --- a/force_bdss/data_sources/base_data_source_model.py +++ b/force_bdss/data_sources/base_data_source_model.py @@ -1,6 +1,7 @@ -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.local_traits import Identifier from .i_data_source_factory import IDataSourceFactory @@ -23,7 +24,10 @@ class BaseDataSourceModel(ABCHasStrictTraits): #: Allows to assign names to the output slots, so that they can be #: 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): self.factory = factory diff --git a/force_bdss/kpi/base_kpi_calculator_model.py b/force_bdss/kpi/base_kpi_calculator_model.py index bebf5899ed618f43b3d8821dadfe7adc7622e447..afbbbeb578eaaabafa3dceb10db22ef24f088e6c 100644 --- a/force_bdss/kpi/base_kpi_calculator_model.py +++ b/force_bdss/kpi/base_kpi_calculator_model.py @@ -1,5 +1,6 @@ -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 .i_kpi_calculator_factory import IKPICalculatorFactory @@ -23,7 +24,10 @@ class BaseKPICalculatorModel(ABCHasStrictTraits): #: Allows to assign names to the output slots, so that they can be #: 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): self.factory = factory