Commit b6d6d27
committed
Refactor Grid interface
Previously, the Grid interface returned `None` if the microgrid was
configured as an island.
This update ensures that the interface consistently returns a Grid
instance.
This change is necessary to treat the grid connection uniformly within
the microgrid, regardless of whether the microgrid is configured as
an island or not. Moreover, it guarantees that the `microgrid.grid()`
function always yields a Grid instance for metric retrieval.
Now the rated current of the fuse is set to zero in case of an
islanded microgrid.
And the fuse of the grid connection point is now set to `None` when
the grid connection component metadata lacks information about the
fuse. Thus, a fuse set to `None` won't prevent the initialization
of the Grid instance.
Signed-off-by: Daniel Zullo <[email protected]>1 parent 594c8bf commit b6d6d27
File tree
3 files changed
+52
-23
lines changed- src/frequenz/sdk
- microgrid
- timeseries
- tests/microgrid
3 files changed
+52
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
195 | | - | |
196 | | - | |
| 194 | + | |
197 | 195 | | |
198 | 196 | | |
199 | 197 | | |
| |||
479 | 477 | | |
480 | 478 | | |
481 | 479 | | |
482 | | - | |
| 480 | + | |
483 | 481 | | |
484 | 482 | | |
485 | 483 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
| |||
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
65 | | - | |
66 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
| |||
134 | 139 | | |
135 | 140 | | |
136 | 141 | | |
137 | | - | |
138 | | - | |
| 142 | + | |
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
| |||
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
| 154 | + | |
| 155 | + | |
150 | 156 | | |
| 157 | + | |
151 | 158 | | |
152 | 159 | | |
153 | 160 | | |
| |||
159 | 166 | | |
160 | 167 | | |
161 | 168 | | |
162 | | - | |
163 | | - | |
164 | 169 | | |
165 | 170 | | |
166 | 171 | | |
| |||
172 | 177 | | |
173 | 178 | | |
174 | 179 | | |
175 | | - | |
| 180 | + | |
176 | 181 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
183 | 188 | | |
184 | | - | |
| 189 | + | |
185 | 190 | | |
186 | 191 | | |
187 | | - | |
| 192 | + | |
188 | 193 | | |
189 | 194 | | |
190 | | - | |
191 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
192 | 199 | | |
193 | 200 | | |
194 | 201 | | |
195 | 202 | | |
| 203 | + | |
196 | 204 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
84 | 107 | | |
85 | 108 | | |
86 | 109 | | |
| |||
0 commit comments