diff --git a/src/datastore.py b/src/datastore.py index bb8474a04b503b1ff50fcea1b7e5f8bbd1d9ebea..5f0df67573dd510fdc4f04d0cc632b36c5082959 100644 --- a/src/datastore.py +++ b/src/datastore.py @@ -2,7 +2,7 @@ __author__ = 'Lukas Leufen' __date__ = '2019-11-22' -from typing import Any, List, Tuple +from typing import Any, List, Tuple, Dict from abc import ABC @@ -36,7 +36,7 @@ class AbstractDataStore(ABC): """ def __init__(self): # empty initialise the data-store variables - self._store = {} + self._store: Dict = {} def put(self, name: str, obj: Any, scope: str) -> None: """ @@ -89,6 +89,15 @@ class AbstractDataStore(ABC): def clear_data_store(self) -> None: self._store = {} + def create_args_dict(self, arg_list: List[str], scope: str = "general"): + args = {} + for arg in arg_list: + try: + args[arg] = self.get(arg, scope) + except (NameNotFoundInDataStore, NameNotFoundInScope): + pass + return args + class DataStoreByVariable(AbstractDataStore): diff --git a/test/test_modules.py b/test/test_modules.py deleted file mode 100644 index b28b04f643122b019e912540f228c8ed20be9eeb..0000000000000000000000000000000000000000 --- a/test/test_modules.py +++ /dev/null @@ -1,3 +0,0 @@ - - -