|
11 | 11 | from packaging.version import Version |
12 | 12 |
|
13 | 13 | from pandapower._version import __version__ |
14 | | -from pandapower.auxiliary import ets_to_element_types |
| 14 | +from pandapower.auxiliary import ets_to_element_types, pandapowerNet |
15 | 15 |
|
16 | 16 | import logging |
17 | 17 |
|
@@ -461,34 +461,28 @@ def get_connected_switches(net, buses, consider=('b', 'l', 't', 't3', 'i'), stat |
461 | 461 |
|
462 | 462 |
|
463 | 463 | def get_connected_elements_dict( |
464 | | - net, buses, respect_switches=True, respect_in_service=False, include_empty_lists=False, |
465 | | - element_types=None, **kwargs): |
| 464 | + net: pandapowerNet, buses, respect_switches: bool = True, respect_in_service: bool = False, |
| 465 | + include_empty_lists: bool = False, |
| 466 | + element_types=None, **kwargs) -> dict[str, list]: |
466 | 467 | """ |
467 | 468 | Returns a dict of lists of connected elements. |
468 | 469 |
|
469 | | - Parameters |
470 | | - ---------- |
471 | | - net : _type_ |
472 | | - _description_ |
473 | | - buses : iterable of buses |
474 | | - buses as origin to search for connected elements |
475 | | - respect_switches : bool, optional |
476 | | - _description_, by default True |
477 | | - respect_in_service : bool, optional |
478 | | - _description_, by default False |
479 | | - include_empty_lists : bool, optional |
480 | | - if True, the output doesn't have values of empty lists but may lack of element types as |
481 | | - keys, by default False |
482 | | - element_types : iterable of strings, optional |
483 | | - types elements which are analyzed for connection. If not given, all pandapower element types |
484 | | - are analyzed. That list of all element types can also be restricted by key word arguments |
| 470 | + Parameters: |
| 471 | + net: The pandapower network |
| 472 | + buses: buses as origin to search for connected elements |
| 473 | + respect_switches: |
| 474 | + respect_in_service: |
| 475 | + include_empty_lists: if True, the output doesn't have values of empty lists but may lack of element types as |
| 476 | + keys, by default False |
| 477 | + element_types: types elements which are analysed for connection. If not given, all pandapower element types |
| 478 | + are analysed. That list of all element types can also be restricted by key word arguments |
| 479 | +
|
| 480 | + Keyword arguments: |
485 | 481 | "connected_buses", "connected_bus_elements", "connected_branch_elements" and |
486 | | - "connected_other_elements", by default None |
| 482 | + "connected_other_elements" |
487 | 483 |
|
488 | | - Returns |
489 | | - ------- |
490 | | - dict[str,list] |
491 | | - elements connected to given buses |
| 484 | + Returns: |
| 485 | + elements connected to given buses as dict with element type as key |
492 | 486 | """ |
493 | 487 | if element_types is None: |
494 | 488 | element_types = pp_elements( |
@@ -540,8 +534,8 @@ def get_connecting_branches(net, buses1, buses2, branch_elements=None): |
540 | 534 | def get_gc_objects_dict(): |
541 | 535 | """ |
542 | 536 | This function is based on the code in mem_top module |
543 | | - Summarize object types that are tracket by the garbage collector in the moment. |
544 | | - Useful to test if there are memoly leaks. |
| 537 | + Summarize object types that are tracked by the garbage collector at the moment. |
| 538 | + Useful to test if there are memory leaks. |
545 | 539 | :return: dictionary with keys corresponding to types and values to the number of objects of the |
546 | 540 | type |
547 | 541 | """ |
@@ -684,7 +678,7 @@ def element_bus_tuples(bus_elements=True, branch_elements=True, res_elements=Fal |
684 | 678 |
|
685 | 679 |
|
686 | 680 | def count_elements(net, return_empties=False, **kwargs): |
687 | | - """Counts how much elements of which element type exist in the pandapower net |
| 681 | + """Counts how many elements of which element type exist in the pandapower net |
688 | 682 |
|
689 | 683 | Parameters |
690 | 684 | ---------- |
|
0 commit comments