Commit fe029e2
authored
Migrate MicrogridConfig from lib-notebooks repo (#18)
This pull request introduces a new, robust configuration system for
microgrids, centered around the new `MicrogridConfig` class and related
dataclasses. It also removes placeholder code and associated tests, and
adds comprehensive unit tests for the new configuration logic. The
changes improve the structure, maintainability, and test coverage of the
codebase.
Configuration system implementation:
* Added a new `MicrogridConfig` class, along with supporting dataclasses
such as `ComponentTypeConfig`, `PVConfig`, `WindConfig`,
`BatteryConfig`, and `Metadata`. This system provides structured,
validated configuration management for microgrids, including methods for
loading from TOML files and retrieving component information.
* Updated dependencies in `pyproject.toml` to include
`marshmallow-dataclass`, required for schema validation in the new
configuration classes.
Copied from here with minimal adjustments:
https://github.com/frequenz-floss/frequenz-lib-notebooks/blob/17953b89e18dadb9ece1117ca1a6cc28873aea74/src/frequenz/data/microgrid/config.py#L1File tree
6 files changed
+557
-39
lines changed- src/frequenz/gridpool
- tests
6 files changed
+557
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
8 | 7 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 8 | + | |
0 commit comments