config
frequenz.gridpool.config ¤
Asset configuration data models and loading.
Attributes¤
frequenz.gridpool.config.ComponentCategory
module-attribute
¤
ComponentCategory = Literal[
"meter", "inverter", "component"
]
Valid component categories.
frequenz.gridpool.config.ComponentType
module-attribute
¤
ComponentType = Literal[
"grid", "pv", "battery", "consumption", "chp", "ev"
]
Valid component types.
Classes¤
frequenz.gridpool.config.AssetsConfig ¤
Entities described by a config document, keyed by their ID.
Source code in src/frequenz/gridpool/config/_assets.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 | |
Attributes¤
gridpools
class-attribute
instance-attribute
¤
gridpools: dict[int, GridpoolConfig] = field(
default_factory=dict
)
Gridpools, keyed by gridpool ID.
market_locations
class-attribute
instance-attribute
¤
market_locations: dict[str, MarketLocationConfig] = field(
default_factory=dict
)
Market locations, keyed by their identifier.
microgrids
class-attribute
instance-attribute
¤
microgrids: dict[int, MicrogridConfig] = field(
default_factory=dict
)
Microgrids, keyed by microgrid ID.
relations
class-attribute
instance-attribute
¤
relations: dict[str, RelationConfig] = field(
default_factory=dict
)
Market topology relations, keyed by the composite of the sides they connect.
version
class-attribute
instance-attribute
¤
version: int = _CURRENT_VERSION
Format version of the assets namespace, stamped by the migration.
Classes¤
Meta ¤
Ignore entity tables this version does not know about.
A reader must keep working against files that already carry entities
added after it, so unknown tables are skipped rather than rejected.
_warn_unknown_entities reports them, so a mistyped table is still
visible instead of silently loading as empty.
Source code in src/frequenz/gridpool/config/_assets.py
Methods:¤
__post_init__ ¤
Check that every microgrid is filed under its own ID.
Relations are not checked here: an override names only the fields it
changes, so a single document may hold an incomplete record. check
looks at the merged result.
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If a key is not the ID of the entry it holds. |
Source code in src/frequenz/gridpool/config/_assets.py
check ¤
Check the document as a whole, once every layer has been merged.
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If an entry's identifier disagrees with the key it is filed under, a relation names fewer than two sides, its key disagrees with its fields, a gridpool relation names no delivery area, one market location is placed in two of them, a legacy microgrid gridpool ID disagrees with its relations, or a gridpool's declared and inferred enterprise disagree. |
Source code in src/frequenz/gridpool/config/_assets.py
find_delivery_areas ¤
find_delivery_areas(
*,
gridpool_id: int | None = None,
microgrid_id: int | None = None,
market_location_id: str | None = None,
at: datetime | None = None
) -> list[DeliveryAreaConfig]
List the delivery areas of the matching relations.
| PARAMETER | DESCRIPTION |
|---|---|
gridpool_id
|
Gridpool to match, or
TYPE:
|
microgrid_id
|
Microgrid to match, or
TYPE:
|
market_location_id
|
Market location to match, or
TYPE:
|
at
|
Instant the relations must apply at, or
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[DeliveryAreaConfig]
|
The delivery areas, each with its code and code type, deduplicated, |
list[DeliveryAreaConfig]
|
in document order. |
Source code in src/frequenz/gridpool/config/_assets.py
find_enterprise ¤
Find the configured enterprise owning gridpool_id.
| PARAMETER | DESCRIPTION |
|---|---|
gridpool_id
|
The gridpool to look up.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int | None
|
The owning enterprise ID, or |
Source code in src/frequenz/gridpool/config/_assets.py
find_market_locations ¤
find_market_locations(
*,
gridpool_id: int | None = None,
microgrid_id: int | None = None,
delivery_area: str | DeliveryAreaConfig | None = None,
at: datetime | None = None
) -> list[str]
List the market locations of the matching relations.
| PARAMETER | DESCRIPTION |
|---|---|
gridpool_id
|
Gridpool to match, or
TYPE:
|
microgrid_id
|
Microgrid to match, or
TYPE:
|
delivery_area
|
Delivery area to match, a
TYPE:
|
at
|
Instant the relations must apply at, or
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[str]
|
The market locations, deduplicated, in document order. |
Source code in src/frequenz/gridpool/config/_assets.py
find_microgrids ¤
find_microgrids(
*,
gridpool_id: int | None = None,
market_location_id: str | None = None,
delivery_area: str | DeliveryAreaConfig | None = None,
at: datetime | None = None
) -> list[int]
List the microgrids of the matching relations.
| PARAMETER | DESCRIPTION |
|---|---|
gridpool_id
|
Gridpool to match, or
TYPE:
|
market_location_id
|
Market location to match, or
TYPE:
|
delivery_area
|
Delivery area to match, a
TYPE:
|
at
|
Instant the relations must apply at, or
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[int]
|
The microgrids, deduplicated, in document order. |
Source code in src/frequenz/gridpool/config/_assets.py
find_relations ¤
find_relations(
*,
gridpool_id: int | None = None,
microgrid_id: int | None = None,
market_location_id: str | None = None,
delivery_area: str | DeliveryAreaConfig | None = None,
participation: MarketParticipationType | None = None,
at: datetime | None = None
) -> list[RelationConfig]
Find the relations naming all of the given sides.
| PARAMETER | DESCRIPTION |
|---|---|
gridpool_id
|
Gridpool to match, or
TYPE:
|
microgrid_id
|
Microgrid to match, or
TYPE:
|
market_location_id
|
Market location to match, or
TYPE:
|
delivery_area
|
Delivery area to match, a
TYPE:
|
participation
|
Use case the relation must serve, or
TYPE:
|
at
|
Instant the relations, or the given participation, must apply at,
or
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[RelationConfig]
|
The matching relations, in document order. |
Source code in src/frequenz/gridpool/config/_assets.py
load_from_files
classmethod
¤
Load and validate a config document from one or more TOML files.
Later files take precedence, entry by entry, so a file can override single fields of an entry another defines. The raw tables are merged before they are loaded, so a field left unset in an override keeps the base value rather than being reset to its default. Paths that are not files are skipped with a warning.
| PARAMETER | DESCRIPTION |
|---|---|
config_files
|
A path or list of paths to TOML config files. |
check
|
Whether to run the whole-document
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
The merged document. |
Source code in src/frequenz/gridpool/config/_assets.py
frequenz.gridpool.config.BatteryConfig ¤
Configuration of a battery in a microgrid.
Source code in src/frequenz/gridpool/config/_microgrid.py
frequenz.gridpool.config.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.config.ComponentTypeConfig ¤
Configuration of a microgrid component type.
Source code in src/frequenz/gridpool/config/_microgrid.py
Attributes¤
component
class-attribute
instance-attribute
¤
List of component IDs for this component.
formula
class-attribute
instance-attribute
¤
Formula to calculate the power of this component.
inverter
class-attribute
instance-attribute
¤
List of inverter IDs for this component.
meter
class-attribute
instance-attribute
¤
List of meter IDs for this component.
Methods:¤
__post_init__ ¤
cids ¤
Get component IDs for this component.
By default, the meter IDs are returned if available, otherwise the inverter IDs. For components without meters or inverters, the component IDs are returned.
If a metric is provided, the component IDs are extracted from the formula.
| PARAMETER | DESCRIPTION |
|---|---|
metric
|
Metric name of the formula.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[int]
|
List of component IDs for this component. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the metric is not supported or improperly set. |
Source code in src/frequenz/gridpool/config/_microgrid.py
is_valid_type
classmethod
¤
frequenz.gridpool.config.DeliveryAreaConfig ¤
Configuration of a delivery area.
Mirrors the Assets API DeliveryArea: a grid-zone code and the code_type
that says how to read it. code_type defaults to EIC, so the common case is
just a code. An EIC code is checked for valid syntax and check character;
other code types are taken as given.
Source code in src/frequenz/gridpool/config/_topology.py
Attributes¤
code_type
class-attribute
instance-attribute
¤
Identifier scheme of the code, defaulting to EIC.
Methods:¤
__post_init__ ¤
Check the code against its type.
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the code type is unspecified, no code is given, or an EIC code is malformed. |
Source code in src/frequenz/gridpool/config/_topology.py
frequenz.gridpool.config.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:
|
frequenz.gridpool.config.GridpoolConfig ¤
Configuration of a gridpool.
Source code in src/frequenz/gridpool/config/_gridpool.py
frequenz.gridpool.config.MarketLocationConfig ¤
Configuration of a market location.
Mirrors the Assets API MarketLocationRef: the market area, identifier id
and how to read it. id repeats the key it is filed under, so the object is
self-describing; AssetsConfig.check verifies the two agree. The grid zone
the location sits in is not kept here but on the relations that name it. Raw
IDs must be unique within a document, including across market areas.
Source code in src/frequenz/gridpool/config/_topology.py
Attributes¤
market_area
class-attribute
instance-attribute
¤
market_area: int = _MARKET_AREA_EU_DE
Assets API market area, defaulting to EU_DE (101).
type
class-attribute
instance-attribute
¤
Identifier scheme of the market location.
Methods:¤
__post_init__ ¤
Check that the identifier scheme and market area are specified.
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the identifier scheme or market area is unspecified. |
Source code in src/frequenz/gridpool/config/_topology.py
frequenz.gridpool.config.MicrogridConfig ¤
Configuration of a microgrid.
Source code in src/frequenz/gridpool/config/_microgrid.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | |
Attributes¤
altitude
class-attribute
instance-attribute
¤
altitude: float | None = None
Geographic altitude of the microgrid.
battery
class-attribute
instance-attribute
¤
battery: dict[str, BatteryConfig] | None = None
Configuration of the batteries.
ctype
class-attribute
instance-attribute
¤
ctype: dict[str, ComponentTypeConfig] = field(
default_factory=dict
)
Mapping of component category types to ac power component config.
end_time
class-attribute
instance-attribute
¤
End time of the microgrid operation.
enterprise_id
class-attribute
instance-attribute
¤
enterprise_id: int | None = None
Enterprise ID of the microgrid.
gid
class-attribute
instance-attribute
¤
gid: int | None = None
Legacy ID; if set, all gridpool relations must name it.
latitude
class-attribute
instance-attribute
¤
latitude: float | None = None
Geographic latitude of the microgrid.
longitude
class-attribute
instance-attribute
¤
longitude: float | None = None
Geographic longitude of the microgrid.
pv
class-attribute
instance-attribute
¤
Configuration of the PV system.
start_time
class-attribute
instance-attribute
¤
Start time of the microgrid operation.
wind
class-attribute
instance-attribute
¤
wind: dict[str, WindConfig] | None = None
Configuration of the wind turbines.
Methods:¤
component_type_ids ¤
component_type_ids(
component_type: str,
component_category: str | None = None,
metric: str = "",
) -> list[int]
Get a list of all component IDs for a component type.
| PARAMETER | DESCRIPTION |
|---|---|
component_type
|
Component type to be aggregated.
TYPE:
|
component_category
|
Specific category of component IDs to retrieve (e.g., "meter", "inverter", or "component"). If not provided, the default logic is used.
TYPE:
|
metric
|
Metric name of the formula if CIDs should be extracted from the formula.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[int]
|
List of component IDs for this component type. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the component type is unknown. |
KeyError
|
If |
Source code in src/frequenz/gridpool/config/_microgrid.py
component_types ¤
formula ¤
Get the formula for a component type.
| PARAMETER | DESCRIPTION |
|---|---|
component_type
|
Component type to be aggregated.
TYPE:
|
metric
|
Metric to be aggregated.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Formula to be used for this aggregated component as string. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the component type is unknown or formula is missing. |
Source code in src/frequenz/gridpool/config/_microgrid.py
frequenz.gridpool.config.PVConfig ¤
Configuration of a PV system in a microgrid.
Source code in src/frequenz/gridpool/config/_microgrid.py
Attributes¤
curtailable
class-attribute
instance-attribute
¤
curtailable: bool | None = None
Flag to indicate if PV system can be curtailed.
end_time
class-attribute
instance-attribute
¤
End time of the PV system installation.
peak_power
class-attribute
instance-attribute
¤
peak_power: float | None = None
Peak power of the PV system in Watt.
frequenz.gridpool.config.RelationConfig ¤
A relation between a gridpool, a microgrid and a market location.
It names at least two of the three. The key it is filed under is
G<gridpool>M<microgrid>L<market_location> with the segments of the unset
sides dropped. The key clusters the lines of one record and is never read:
every value comes from the fields, and AssetsConfig.check verifies that the
two agree.
A relation naming a gridpool sits in a delivery_area; the grid zone rides
on the relation, not on the market location, so a gridpool-to-microgrid
relation with no market location still carries one. A gridpool-free
microgrid-to-market-location relation may also carry one to map that market
location to its delivery area. A delivery area names its code type, which
defaults to EIC.
Its validity lives in validity, each entry a period the relation applies
over. A period naming a market use case tells the relation's gridpool
participations apart; one without is a plain window, for a relation that
serves a single use or none, such as a bare microgrid-to-market-location
metering relation. A relation with no periods applies at all times.
Source code in src/frequenz/gridpool/config/_topology.py
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 | |
Attributes¤
delivery_area
class-attribute
instance-attribute
¤
delivery_area: DeliveryAreaConfig | None = None
Delivery area this relation sits in; required once a gridpool is named.
gridpool_id
class-attribute
instance-attribute
¤
gridpool_id: int | None = None
Gridpool participating in this relation.
is_complete
property
¤
is_complete: bool
Whether this relation names at least two of the three sides.
market_location_id
class-attribute
instance-attribute
¤
market_location_id: str | None = None
Market location participating in this relation.
microgrid_id
class-attribute
instance-attribute
¤
microgrid_id: int | None = None
Microgrid participating in this relation.
validity
class-attribute
instance-attribute
¤
validity: dict[str, ValidityConfig] = field(
default_factory=dict
)
Periods this relation applies over, each optionally a market use case.
Methods:¤
__post_init__ ¤
Check the periods against the relation.
A record may be incomplete here, since an override names only the fields
it changes; AssetsConfig.check looks at the merged result.
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If a period names a market use case without a gridpool, or periods of one use case overlap. |
Source code in src/frequenz/gridpool/config/_topology.py
covers ¤
Check whether this relation applies at an instant.
| PARAMETER | DESCRIPTION |
|---|---|
at
|
The instant to check.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
Whether any of its periods covers the instant, or |
bool
|
lists none and so applies always. |
Source code in src/frequenz/gridpool/config/_topology.py
matches ¤
matches(
*,
gridpool_id: int | None = None,
microgrid_id: int | None = None,
market_location_id: str | None = None,
delivery_area: str | DeliveryAreaConfig | None = None,
participation: MarketParticipationType | None = None,
at: datetime | None = None
) -> bool
Check whether this relation has all the given sides.
| PARAMETER | DESCRIPTION |
|---|---|
gridpool_id
|
Gridpool to match, or
TYPE:
|
microgrid_id
|
Microgrid to match, or
TYPE:
|
market_location_id
|
Market location to match, or
TYPE:
|
delivery_area
|
Delivery area to match, either a
TYPE:
|
participation
|
Use case the relation must serve, or
TYPE:
|
at
|
Instant the relation, or the given participation, must apply at,
or
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
Whether every side given matches this relation. |
Source code in src/frequenz/gridpool/config/_topology.py
frequenz.gridpool.config.ValidityConfig ¤
A period a relation applies over, optionally a market use case.
A period naming a participation is a market participation, which applies
only to a gridpool relation; one without is a plain validity window. Filed
under a free label, which is never read or parsed. The half-open interval
[start, end) mirrors the Assets API: the start is inclusive, the end
exclusive, and an unset bound is open.
Source code in src/frequenz/gridpool/config/_topology.py
Attributes¤
end
class-attribute
instance-attribute
¤
Exclusive end of the period.
participation
class-attribute
instance-attribute
¤
The market use case, unset for a plain validity window.
start
class-attribute
instance-attribute
¤
Inclusive start of the period.
Methods:¤
__post_init__ ¤
Check the use case, bounds and order of the period.
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the use case is unspecified, a bound has no UTC offset, or the period ends at or before it starts. |
Source code in src/frequenz/gridpool/config/_topology.py
covers ¤
Check whether this period applies at an instant.
| PARAMETER | DESCRIPTION |
|---|---|
at
|
The instant to check.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
Whether the instant falls within the half-open period. |
Source code in src/frequenz/gridpool/config/_topology.py
overlaps ¤
overlaps(other: ValidityConfig) -> bool
Check whether two periods share an instant.
| PARAMETER | DESCRIPTION |
|---|---|
other
|
The period to compare with.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
Whether the two half-open periods overlap. |
Source code in src/frequenz/gridpool/config/_topology.py
frequenz.gridpool.config.WindConfig ¤
Configuration of a wind turbine in a microgrid.
Source code in src/frequenz/gridpool/config/_microgrid.py
Attributes¤
end_time
class-attribute
instance-attribute
¤
End time of the wind turbine installation.
hellmann_exponent
class-attribute
instance-attribute
¤
hellmann_exponent: float | None = None
Hellmann exponent for wind speed extrapolation. See: https://w.wiki/FMw9
latitude
class-attribute
instance-attribute
¤
latitude: float | None = None
Geographic latitude of the wind turbine.
longitude
class-attribute
instance-attribute
¤
longitude: float | None = None
Geographic longitude of the wind turbine.
number_of_turbines
class-attribute
instance-attribute
¤
number_of_turbines: int = 1
Number of wind turbines.
rated_power
class-attribute
instance-attribute
¤
rated_power: float | None = None
Rated power of the wind turbine in Watt.
start_time
class-attribute
instance-attribute
¤
Start time of the wind turbine installation.
Functions:¤
frequenz.gridpool.config.load_configs
async
¤
load_configs(
default_files: (
str | Path | list[str | Path] | None
) = None,
assets_client: AssetsApiClient | None = None,
override_files: (
str | Path | list[str | Path] | None
) = None,
microgrid_ids: list[int] | None = None,
component_graph_config: (
ComponentGraphConfig | None
) = None,
) -> AssetsConfig
Load configs from up to three sources and merge them in layers.
Combines up to three sources, listed here from lowest to highest precedence: a default config file layer, the Assets API, and an override config file layer. Higher layers win on conflicts, while lower layers fill in anything the higher ones leave unset. This lets callers pick a strategy by choosing which sources to pass, for example:
default_files+assets_client: files provide defaults that the Assets API overrides.assets_client+override_files: the Assets API provides the base that files override.- all three: the Assets API sits between a default and an override file layer.
The microgrid IDs fetched from the Assets API are microgrid_ids when
given, otherwise the IDs found in the default and override files. This
lets the Assets API layer be used even when no files are given.
| PARAMETER | DESCRIPTION |
|---|---|
default_files
|
Optional path or list of paths to config files forming the lowest-precedence layer. |
assets_client
|
Optional Assets API client. When given, microgrid metadata and formulas are fetched and layered above the default files.
TYPE:
|
override_files
|
Optional path or list of paths to config files forming the highest-precedence layer. |
microgrid_ids
|
Optional explicit microgrid IDs to fetch from the Assets API. When given, these replace the IDs derived from the files, so the Assets API layer can be used without any files. |
component_graph_config
|
How to build the component graph and generate its formulas. See
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
AssetsConfig
|
The merged document. Use |
AssetsConfig
|
file layers may also contribute |
AssetsConfig
|
which the Assets API layer does not provide. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If none of the three sources is provided, if |
Source code in src/frequenz/gridpool/config/_load.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 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 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |