22import json
33import os .path
44import sys
5- from typing import Dict , List , Type
5+ from typing import Dict , List
66
77from project_dilemma .config import ProjectDilemmaConfig
88from project_dilemma .interfaces import Algorithm , Generations , Node , SimulationBase , Simulations
99from project_dilemma .simulations import simulations_map
1010
1111
12- def create_nodes (config : ProjectDilemmaConfig , algorithms_map : Dict [str , Type [Algorithm ]]) -> List [Node ]:
12+ def create_nodes (config : ProjectDilemmaConfig , algorithms_map : Dict [str , type [Algorithm ]]) -> List [type [ Node ] ]:
1313 """create the simulation nodes
1414
1515 :param config: configuration data
1616 :type config: ProjectDilemmaConfig
1717 :param algorithms_map: map of algorithm class names to algorithms
18- :type algorithms_map: Dict[str, Type[Algorithm]]
19- :return:
18+ :type algorithms_map: Dict[str, type[Algorithm]]
19+ :return: list of nodes
20+ :rtype: List[type[Node]]
2021 """
2122 nodes = []
2223
@@ -26,18 +27,18 @@ def create_nodes(config: ProjectDilemmaConfig, algorithms_map: Dict[str, Type[Al
2627 return nodes
2728
2829
29- def load_algorithms (config : ProjectDilemmaConfig ) -> Dict [str , Type [Algorithm ]]:
30+ def load_algorithms (config : ProjectDilemmaConfig ) -> Dict [str , type [Algorithm ]]:
3031 """load all algorithms used
3132
3233 :param config: configuration data
3334 :type config: ProjectDilemmaConfig
3435 :return: map of algorithm class names to algorithms
35- :rtype: Dict[str, Type [Algorithm]]
36+ :rtype: Dict[str, type [Algorithm]]
3637 """
3738 sys .path .append (config ['algorithms_directory' ])
3839
3940 algorithms = [node ['algorithm' ] for node in config ['nodes' ]]
40- algorithm_map : Dict [str , Type [Algorithm ]] = {}
41+ algorithm_map : Dict [str , type [Algorithm ]] = {}
4142
4243 for algorithm in algorithms :
4344 if algorithm_map .get (algorithm ['object' ]):
@@ -76,15 +77,15 @@ def load_simulation_data(config: ProjectDilemmaConfig) -> Generations | Simulati
7677 return data
7778
7879
79- def load_simulation (config : ProjectDilemmaConfig , * , generational : bool = False ) -> Type [SimulationBase ]:
80+ def load_simulation (config : ProjectDilemmaConfig , * , generational : bool = False ) -> type [SimulationBase ]:
8081 """load the simulation
8182
8283 :param config: configuration data
8384 :type config: ProjectDilemmaConfig
8485 :param generational: if the generational simulation should be loaded
8586 :type generational: bool
8687 :return: the configured simulation
87- :rtype: Type [SimulationBase]
88+ :rtype: type [SimulationBase]
8889 """
8990 key = 'simulation'
9091 if generational :
0 commit comments