|
35 | 35 |
|
36 | 36 | from pandapower.network_structure import get_structure_dict |
37 | 37 | from pandapower.std_types import add_basic_std_types |
| 38 | +from pandapower.pp_types import StandardTypesDict |
38 | 39 |
|
39 | 40 | logger = logging.getLogger(__name__) |
40 | 41 |
|
@@ -233,22 +234,28 @@ class pandapowerNet(ADict): |
233 | 234 | """ |
234 | 235 | @overload |
235 | 236 | def __init__( |
236 | | - self, name: str, f_hz: float = 50., sn_mva: float = 1., add_stdtypes: bool = True, custom_data: dict = None |
| 237 | + self, |
| 238 | + name: str, |
| 239 | + f_hz: float = 50., |
| 240 | + sn_mva: float = 1., |
| 241 | + add_stdtypes: bool = True, |
| 242 | + custom_data: dict | None = None |
237 | 243 | ) -> None: ... |
238 | 244 |
|
239 | 245 | @overload |
240 | 246 | @deprecated("Calling pandapowerNet to copy a network is no longer supported. Use copy.deepcopy(net) instead.") |
241 | | - def __init__(self, net: "pandapowerNet") -> None: ... |
| 247 | + def __init__(self, *, net: "pandapowerNet | dict") -> None: ... |
242 | 248 |
|
243 | 249 |
|
244 | 250 | def __init__( |
245 | 251 | self, |
246 | | - net: "pandapowerNet" = None, |
247 | | - name: str = None, |
| 252 | + name: str | None = None, |
248 | 253 | f_hz: float = 50., |
249 | 254 | sn_mva: float = 1., |
250 | 255 | add_stdtypes: bool = True, |
251 | | - custom_data: dict = None, |
| 256 | + custom_data: dict | None = None, |
| 257 | + *, |
| 258 | + net: "pandapowerNet | dict | None" = None, |
252 | 259 | **kwargs |
253 | 260 | ) -> None: |
254 | 261 | # TODO: remove once deprecations are removed |
@@ -297,7 +304,7 @@ def __init__( |
297 | 304 | if add_stdtypes: |
298 | 305 | add_basic_std_types(self) # TODO: Test this |
299 | 306 | else: |
300 | | - self.std_types = {"line": {}, "line_dc": {}, "trafo": {}, "trafo3w": {}, "fuse": {}} # TODO: this should not be set here. a function to return the empty std_types would be sensible |
| 307 | + self.std_types: StandardTypesDict = {"line": {}, "line_dc": {}, "trafo": {}, "trafo3w": {}, "fuse": {}} |
301 | 308 | # reset res_… objects: |
302 | 309 | for suffix in [None, "est", "sc", "3ph"]: |
303 | 310 | elements = [] |
@@ -329,7 +336,7 @@ def __init__( |
329 | 336 | ) |
330 | 337 | if "res_cost" in self.keys(): |
331 | 338 | del self["res_cost"] |
332 | | - self.user_pf_options = {} |
| 339 | + self.user_pf_options: dict = {} |
333 | 340 |
|
334 | 341 |
|
335 | 342 | @staticmethod |
|
0 commit comments