Skip to content

Commit e7c3444

Browse files
KS-HTKheckstrahler
andauthored
Issues/type in docstring (#2928)
* fixed typos in docstring of get_gc_objects_dict * fixed typos in docstring * fixed missing import --------- Co-authored-by: David Heck <david.heck@iee.fraunhofer.de>
1 parent f91a669 commit e7c3444

1 file changed

Lines changed: 21 additions & 27 deletions

File tree

pandapower/toolbox/element_selection.py

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from packaging.version import Version
1212

1313
from pandapower._version import __version__
14-
from pandapower.auxiliary import ets_to_element_types
14+
from pandapower.auxiliary import ets_to_element_types, pandapowerNet
1515

1616
import logging
1717

@@ -461,34 +461,28 @@ def get_connected_switches(net, buses, consider=('b', 'l', 't', 't3', 'i'), stat
461461

462462

463463
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]:
466467
"""
467468
Returns a dict of lists of connected elements.
468469
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:
485481
"connected_buses", "connected_bus_elements", "connected_branch_elements" and
486-
"connected_other_elements", by default None
482+
"connected_other_elements"
487483
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
492486
"""
493487
if element_types is None:
494488
element_types = pp_elements(
@@ -540,8 +534,8 @@ def get_connecting_branches(net, buses1, buses2, branch_elements=None):
540534
def get_gc_objects_dict():
541535
"""
542536
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.
545539
:return: dictionary with keys corresponding to types and values to the number of objects of the
546540
type
547541
"""
@@ -684,7 +678,7 @@ def element_bus_tuples(bus_elements=True, branch_elements=True, res_elements=Fal
684678

685679

686680
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
688682
689683
Parameters
690684
----------

0 commit comments

Comments
 (0)