ra2ce.handler package#
Ra2ceHandler class#
- class Ra2ceHandler(network, analysis)[source]#
Bases:
object
Top level class to handle the RA2CE analysis process. This class is used to orchestrate the analysis process based on the provided network and analysis configuration, including the logging configuration.
- Parameters:
network (Optional[Path])
analysis (Optional[Path])
-
analysis_collection:
AnalysisCollection
#
- configure()[source]#
Configures the ConfigWrapper with the current AnalysisConfigData and NetworkConfigData so that the analyses can be succesfully run. This method will generate files of the network in the folder output_graph if they do not yet exist. This method can also be run if AnalysisConfigData is None.
- Return type:
None
- classmethod from_config(network, analysis)[source]#
Create a handler from the provided network and analysis configuration.
- Parameters:
network (
NetworkConfigData
) – Network configuration.analysis (
AnalysisConfigData
) – Analysis configuration. This input is only required when running analyses.
- Returns:
The configured handler object.
- Return type:
-
input_config:
ConfigWrapper
#
- run_analysis()[source]#
Runs a Ra2ce analysis based on the provided network and analysis files.
- Return type:
list
[AnalysisResultWrapper
]
- Raises:
ValueError: If the input files are not valid
- Returns:
list[AnalysisResultWrapper]: A list of analysis results
- static run_with_config_data(network, analysis)[source]#
Streamlined method to directly run a Ra2ce analysis based on the dataclasses for Network and Analysis.
This streamlined method allows for automatic initialization of the logger.
- Return type:
list
[AnalysisResultWrapper
]- Parameters:
network (NetworkConfigData | None)
analysis (AnalysisConfigData | None)
- Args:
- network (NetworkConfigData | None):
Dataclass containing all the information for the network.
- analysis (AnalysisConfigData | None):
Dataclass containing all the information related to analyses.
- Returns:
list[AnalysisResultWrapper]: A list of analyses results.
- static run_with_ini_files(network_ini_file, analysis_ini_file)[source]#
[Deprecated: .ini files are no longer supported] Streamlined method to directly run a Ra2ce analysis based on the provided network and analysis .ini files.
This streamlined method allows for automatic initialization of the logger.
- Return type:
list
[AnalysisResultWrapper
]- Parameters:
network_ini_file (Path | None)
analysis_ini_file (Path | None)
- Args:
network_ini_file (Path | None): Location of the network file (*.ini). analysis_ini_file (Path | None): Location of the analysis file (*.ini).
- Returns:
list[AnalysisResultWrapper]: A list of analyses results.