diff --git a/force_bdss/data_sources/base_data_source.py b/force_bdss/data_sources/base_data_source.py index 6c6f5daed054fdcf6ec0b05abc6b51c4940a0be9..e0283b5da75b9d2fb7a42f69049c54b482d4f00d 100644 --- a/force_bdss/data_sources/base_data_source.py +++ b/force_bdss/data_sources/base_data_source.py @@ -37,3 +37,26 @@ class BaseDataSource(ABCHasStrictTraits): List(DataValue) A list containing the computed Data Values. """ + + @abc.abstractmethod + def slots(self, model): + """Returns the input (and output) slots of the DataSource. + Slots are the entities that are needed (and produced) by this + DataSource. + + The slots may depend on the configuration options, and thus the model. + This allows, for example, to change the slots depending if an option + is enabled or not. + + Parameters + ---------- + model: BaseDataSourceModel + The model of the DataSource, instantiated through create_model() + + Returns + ------- + list[tuple, tuple] + A list containing two tuples, the first element is the input slots, + the second element is the output slots. Each slot must be an + instance of the Slot class. + """