Skip to content

Commit 87a97cc

Browse files
committed
Make all micrgrid config fields optional
There are no fields that are required so far. Signed-off-by: cwasicki <[email protected]>
1 parent e289a7a commit 87a97cc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/frequenz/data/microgrid/config.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import logging
77
import re
88
import tomllib
9+
from dataclasses import field
910
from pathlib import Path
1011
from typing import Any, Literal, cast, get_args
1112

@@ -207,13 +208,13 @@ class Metadata:
207208
class MicrogridConfig:
208209
"""Configuration of a microgrid."""
209210

210-
meta: Metadata
211+
meta: Metadata | None = None
211212
"""Metadata of the microgrid."""
212213

213-
assets: AssetsConfig
214+
assets: AssetsConfig | None = None
214215
"""Configuration of the assets in the microgrid."""
215216

216-
ctype: dict[str, ComponentTypeConfig]
217+
ctype: dict[str, ComponentTypeConfig] = field(default_factory=dict)
217218
"""Mapping of component category types to ac power component config."""
218219

219220
def __init__(self, config_dict: dict[str, Any]) -> None:

0 commit comments

Comments
 (0)