Index
frequenz.gridpool ¤
High-level interface to grid pools for the Frequenz platform.
Classes¤
frequenz.gridpool.ComponentGraphConfig ¤
Configuration for the component graph.
Source code in frequenz/microgrid_component_graph/__init__.py
Methods:¤
__init__ ¤
__init__(
*,
allow_component_validation_failures: bool = False,
allow_unconnected_components: bool = False,
allow_unspecified_inverters: bool = False,
disable_fallback_components: bool = False,
include_phantom_loads_in_consumer_formula: bool = False,
prefer_meters_in_component_formulas: bool = False,
formula_overrides: FormulaOverrides | None = None
) -> None
Initialize this instance.
| PARAMETER | DESCRIPTION |
|---|---|
allow_component_validation_failures
|
Whether to allow validation errors on
components. When this is
TYPE:
|
allow_unconnected_components
|
Whether to allow unconnected components in the graph, that are not reachable from the root.
TYPE:
|
allow_unspecified_inverters
|
Whether to allow untyped inverters in the
graph. When this is
TYPE:
|
disable_fallback_components
|
Whether to disable fallback components in
generated formulas. When this is
TYPE:
|
include_phantom_loads_in_consumer_formula
|
Whether to consider phantom loads
in the consumer formula. Meters with successors can still have loads
not represented in the component graph. These are called phantom loads.
When this is
TYPE:
|
prefer_meters_in_component_formulas
|
Default policy for the per-category
formulas. When
TYPE:
|
formula_overrides
|
Per-formula overrides for the meter/component preference;
see
TYPE:
|
Source code in frequenz/microgrid_component_graph/__init__.py
frequenz.gridpool.ComponentGraphGenerator ¤
Generates component graphs for microgrids using the Assets API.
Source code in src/frequenz/gridpool/_graph_generator.py
Methods:¤
__init__ ¤
__init__(
client: AssetsApiClient,
config: ComponentGraphConfig | None = None,
) -> None
Initialize this instance.
| PARAMETER | DESCRIPTION |
|---|---|
client
|
The Assets API client to use for fetching components and connections.
TYPE:
|
config
|
How to build the graph and generate its formulas. See
TYPE:
|
Source code in src/frequenz/gridpool/_graph_generator.py
get_component_graph
async
¤
Generate a component graph for the given microgrid ID.
| PARAMETER | DESCRIPTION |
|---|---|
microgrid_id
|
The ID of the microgrid to generate the graph for.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
MicrogridComponentGraph
|
The component graph representing the microgrid's electrical components and their connections. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If any component connections could not be loaded. |
Source code in src/frequenz/gridpool/_graph_generator.py
frequenz.gridpool.FormulaOverrides ¤
Per-formula overrides for the meter/component preference.
Each parameter is None by default, meaning the corresponding formula
follows the global prefer_meters_in_component_formulas setting on
ComponentGraphConfig. Setting True forces the meter as primary
for that formula; False forces the component.
Methods:¤
__init__ ¤
__init__(
*,
prefer_meters_in_pv_formula: bool | None = None,
prefer_meters_in_battery_formula: bool | None = None,
prefer_meters_in_chp_formula: bool | None = None,
prefer_meters_in_ev_charger_formula: bool | None = None,
prefer_meters_in_wind_turbine_formula: (
bool | None
) = None,
prefer_meters_in_steam_boiler_formula: (
bool | None
) = None
) -> None
Initialize this instance.
| PARAMETER | DESCRIPTION |
|---|---|
prefer_meters_in_pv_formula
|
Override for
TYPE:
|
prefer_meters_in_battery_formula
|
Override for
TYPE:
|
prefer_meters_in_chp_formula
|
Override for
TYPE:
|
prefer_meters_in_ev_charger_formula
|
Override for
TYPE:
|
prefer_meters_in_wind_turbine_formula
|
Override for
TYPE:
|
prefer_meters_in_steam_boiler_formula
|
Override for
TYPE:
|