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)
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:
|
_config_object |
The parsed configuration object (type ConfigObject)
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 cofmupy/config_parser.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
config_dict
property
¶
config_dict
Construct and return dict from protected _config_object
| RETURNS | DESCRIPTION |
|---|---|
config
|
config formatted as a dict
TYPE:
|
fill_data_storage ¶
fill_data_storage(targets, storage_id, storage_title)
Fill data storage with labels and items
Source code in cofmupy/config_parser.py
270 271 272 273 274 275 276 277 278 279 | |