The Parser for Configuration File¶
This module is designed to parse, validate, and structure a JSON configuration file for the co-simulation framework. It ensures that all necessary configurations for GraphEngine, Master DataStreamHandlers, and DataStorages are correctly formatted and ready for execution. Additionally, it performs sanity checks to detect missing keys, redundant endpoints, and orphaned connections.
ConfigParser ¶
ConfigParser(
file_path, edge_sep=" -> ", loop_solver="jacobi"
)
Parses and validates JSON configuration files.
This class handles loading, validation, and transformation of configuration data for various components such as the Graph Engine, Master Solver, Data Storages, and Stream Handlers.
ATTRIBUTE | DESCRIPTION |
---|---|
file_path |
Path to the configuration file. Can also be a dictionary if the user prefers to provide the configuration directly without using a JSON file.
TYPE:
|
edge_sep |
Edge separator for connections. Defaults to " -> ".
TYPE:
|
loop_solver |
Method used to solve algebrauc loops. Defaults to "jacobi".
TYPE:
|
config_dict |
The parsed configuration dictionary.
TYPE:
|
graph_config |
Configuration for the graph engine.
TYPE:
|
master_config |
Configuration for the master solver.
TYPE:
|
data_storages |
Storage settings for external data.
TYPE:
|
stream_handlers |
Handlers for external data streams.
TYPE:
|
error_in_config |
Indicates whether errors exist in the configuration.
TYPE:
|
Source code in cofmpy/config_parser.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|