Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PowerGridModel/power-grid-model-ds
/ functions
Functions
625 in github.com/PowerGridModel/power-grid-model-ds
⨍
Functions
625
◇
Types & classes
102
↳
Endpoints
5
↓ 96 callers
Method
zeros
Construct an array filled with zeros. If 'empty_id' is True, the 'id' column will be filled with EMPTY_ID values.
src/power_grid_model_ds/_core/model/arrays/base/array.py:194
↓ 87 callers
Method
append
Append an array to the grid. Both 'grid arrays' and 'grid.graphs' will be updated. Args: array (FancyArray): The array to append.
src/power_grid_model_ds/_core/model/grids/base.py:195
↓ 53 callers
Method
empty
Create an empty grid Args: graph_model (type[BaseGraphModel], optional): The graph model to use. Defaults to RustworkxGraphModel.
src/power_grid_model_ds/_core/model/grids/base.py:182
↓ 43 callers
Method
get
( self: Self, *args: int | Iterable[int] | np.ndarray, mode_: Literal["AND", "OR"] = "
src/power_grid_model_ds/_core/model/arrays/base/array.py:275
↓ 36 callers
Method
add_branch
Add a branch to the grid Args: branch (BranchArray): The branch to add
src/power_grid_model_ds/_core/model/grids/base.py:207
↓ 35 callers
Method
add_node
Add a new node to the grid Args: node (NodeArray): The node to add
src/power_grid_model_ds/_core/model/grids/base.py:239
↓ 35 callers
Method
has_branch
Check if a branch exists between two nodes.
src/power_grid_model_ds/_core/model/graphs/models/base.py:125
↓ 30 callers
Method
filter
( self: Self, *args: int | Iterable[int] | np.ndarray, mode_: Literal["AND", "OR"] = "
src/power_grid_model_ds/_core/model/arrays/base/array.py:259
↓ 26 callers
Function
do_performance_test
Generalized performance test runner.
tests/performance/_helpers.py:11
↓ 21 callers
Method
all_arrays
Returns all arrays in the container.
src/power_grid_model_ds/_core/model/containers/base.py:43
↓ 21 callers
Method
external_to_internal
Convert external node id to internal node id (internal) Raises: MissingNodeError: if the external node id does not exist in the g
src/power_grid_model_ds/_core/model/graphs/models/base.py:50
↓ 17 callers
Method
exclude
( self: Self, *args: int | Iterable[int] | np.ndarray, mode_: Literal["AND", "OR"] = "
src/power_grid_model_ds/_core/model/arrays/base/array.py:267
↓ 13 callers
Method
calculate_power_flow
Initialize the PowerGridModel and calculate power flow over input data. If input data is not available, self.create_input_from_grid() will be
src/power_grid_model_ds/_core/load_flow.py:86
↓ 12 callers
Method
from_txt
Build a grid from a list of strings See the documentation for the expected format of the txt_lines Args: *args (str): Th
src/power_grid_model_ds/_core/model/grids/base.py:412
↓ 10 callers
Method
delete_node
Remove a node from the grid Args: node (NodeArray): The node to remove
src/power_grid_model_ds/_core/model/grids/base.py:249
↓ 10 callers
Method
exclude_mask
( self: Self, *args: int | Iterable[int] | np.ndarray, mode_: Literal["AND", "OR"] = "
src/power_grid_model_ds/_core/model/arrays/base/array.py:291
↓ 10 callers
Method
filter_mask
( self: Self, *args: int | Iterable[int] | np.ndarray, mode_: Literal["AND", "OR"] = "
src/power_grid_model_ds/_core/model/arrays/base/array.py:283
↓ 10 callers
Method
update_by_id
(self: Self, ids: ArrayLike, allow_missing: bool = False, **kwargs)
src/power_grid_model_ds/_core/model/arrays/base/array.py:302
↓ 9 callers
Method
check_ids
(self: Self, return_duplicates: bool = False)
src/power_grid_model_ds/_core/model/arrays/base/array.py:315
↓ 9 callers
Method
create_input_from_grid
Create input for the PowerGridModel
src/power_grid_model_ds/_core/load_flow.py:57
↓ 8 callers
Method
cache
Cache Grid to a folder Args: cache_dir (Path): The directory to save the cache to. cache_name (str): The name of the
src/power_grid_model_ds/_core/model/grids/base.py:362
↓ 8 callers
Method
delete_branch
Remove a branch from the grid Args: branch (BranchArray): The branch to remove
src/power_grid_model_ds/_core/model/grids/base.py:218
↓ 8 callers
Method
get_connected
Find all nodes connected to the node_id Args: node_id: node id to start the search from inclusive: whether to include
src/power_grid_model_ds/_core/model/graphs/models/base.py:275
↓ 8 callers
Method
get_dtype
(cls)
src/power_grid_model_ds/_core/model/arrays/base/array.py:79
↓ 8 callers
Method
get_typed_branches
Find a matching LineArray, LinkArray or TransformerArray for the given branch_ids Raises: ValueError: - If no bra
src/power_grid_model_ds/_core/model/grids/base.py:143
↓ 8 callers
Function
is_sequence
Returns True for lists, tuples, sets, arrays Return False for strings, dicts
src/power_grid_model_ds/_core/utils/misc.py:13
↓ 7 callers
Method
get_shortest_path
Calculate the shortest path between two nodes Example: given this graph: [1] - [2] - [3] - [4] >>> graph.get_shortes
src/power_grid_model_ds/_core/model/graphs/models/base.py:215
↓ 7 callers
Method
run
Run the generator to create a random radial grid. if a seed is provided, this will be used to set rng.
src/power_grid_model_ds/_core/data_source/generator/grid_generators.py:41
↓ 6 callers
Method
_has_node
(self, node_id)
src/power_grid_model_ds/_core/model/graphs/models/base.py:386
↓ 6 callers
Function
build_basic_grid
Build a basic grid
tests/fixtures/grids.py:24
↓ 6 callers
Function
empty
Returns the empty value for the given dtype.
src/power_grid_model_ds/_core/model/constants.py:10
↓ 6 callers
Method
from_arrays
Build from arrays
src/power_grid_model_ds/_core/model/graphs/container.py:144
↓ 6 callers
Method
from_cache
Read from cache and build .graphs from arrays Args: cache_path (Path): The path to the cache load_graphs (bool, optio
src/power_grid_model_ds/_core/model/grids/base.py:387
↓ 6 callers
Method
internal_to_external
Convert internal id (internal) to external node id
src/power_grid_model_ds/_core/model/graphs/models/base.py:58
↓ 6 callers
Method
run
Generate nodes in a grid with two possible load scenarios
src/power_grid_model_ds/_core/data_source/generator/arrays/node.py:16
↓ 6 callers
Method
set_feeder_ids
Sets feeder and substation id properties in the grids arrays
src/power_grid_model_ds/_core/model/grids/base.py:438
↓ 5 callers
Method
_internals_to_externals
Convert a list of internal nodes to external nodes
src/power_grid_model_ds/_core/model/graphs/models/base.py:359
↓ 5 callers
Method
find_array_field
Find the Field that holds an array of type array_type. Args: array_type(type[FancyArray]): FancyArray subclass. Raises:
src/power_grid_model_ds/_core/model/containers/base.py:52
↓ 5 callers
Method
has_node
Check if a node exists.
src/power_grid_model_ds/_core/model/graphs/models/base.py:69
↓ 5 callers
Method
tmp_remove_nodes
Context manager that temporarily removes nodes and their branches from the graph. Example: >>> with graph.tmp_remove_nodes([1, 2,
src/power_grid_model_ds/_core/model/graphs/models/base.py:194
↓ 4 callers
Method
_append
(self, array: FancyArray)
src/power_grid_model_ds/_core/model/graphs/container.py:164
↓ 4 callers
Method
_externals_to_internals
Convert a list of external nodes to internal nodes
src/power_grid_model_ds/_core/model/graphs/models/base.py:363
↓ 4 callers
Method
determine_number_of_routes
Decide on a number of routes based on expected route-size
src/power_grid_model_ds/_core/data_source/generator/arrays/line.py:70
↓ 4 callers
Method
find_first_connected
Find the first connected node to the node_id from the candidate_node_ids Note: If multiple candidate nodes are connected to the n
src/power_grid_model_ds/_core/model/graphs/models/base.py:300
↓ 4 callers
Method
get_branches_in_path
Returns all branches within a path of nodes Args: nodes_in_path (list[int]): The nodes in the path Returns:
src/power_grid_model_ds/_core/model/grids/base.py:301
↓ 4 callers
Method
get_components
Returns all separate components when the substation_nodes are removed of the graph as lists
src/power_grid_model_ds/_core/model/graphs/models/base.py:256
↓ 4 callers
Function
get_filter_mask
Returns a mask that matches the input parameters.
src/power_grid_model_ds/_core/model/arrays/base/_filters.py:14
↓ 4 callers
Function
get_pickle_path
Returns the path to the pickle file. If ony a .gz-file is available, the .gz-file is unpacked.
src/power_grid_model_ds/_core/utils/pickle.py:26
↓ 4 callers
Method
is_empty
Check if a column is filled with 'empty' values.
src/power_grid_model_ds/_core/model/arrays/base/array.py:227
↓ 4 callers
Method
make_inactive
Make a branch inactive. This is done by setting from or to status to 0. Args: branch (BranchArray): The branch to make inactive
src/power_grid_model_ds/_core/model/grids/base.py:283
↓ 4 callers
Function
parse_branch_array
Parse the branch array.
src/power_grid_model_ds/_core/visualizer/parsers.py:38
↓ 4 callers
Method
reverse_branches
Reverse the direction of the branches.
src/power_grid_model_ds/_core/model/grids/base.py:161
↓ 4 callers
Method
set_empty
Set a column to its 'empty' value.
src/power_grid_model_ds/_core/model/arrays/base/array.py:238
↓ 3 callers
Function
_rows_to_strings
(rows: "FancyArray", column_widths: list[tuple[str, int]])
src/power_grid_model_ds/_core/model/arrays/base/_string.py:49
↓ 3 callers
Method
add_branch_array
Add a branch to all graphs
src/power_grid_model_ds/_core/model/graphs/container.py:75
↓ 3 callers
Method
add_node_array
Add a node to all graphs
src/power_grid_model_ds/_core/model/graphs/container.py:60
↓ 3 callers
Method
as_table
(self: Self, column_width: int | str = "auto", rows: int = 10)
src/power_grid_model_ds/_core/model/arrays/base/array.py:318
↓ 3 callers
Method
copy
Return a copy of this array including its data
src/power_grid_model_ds/_core/model/arrays/base/array.py:189
↓ 3 callers
Method
create_grid_from_input_data
Create Grid object from PowerGridModel input. Note that for some arrays, not all fields are available in the PowerGridModel input.
src/power_grid_model_ds/_core/load_flow.py:66
↓ 3 callers
Method
in_branches
Return all branches that have the node as an endpoint.
src/power_grid_model_ds/_core/model/graphs/models/base.py:78
↓ 3 callers
Function
parse_node_array
Parse the nodes.
src/power_grid_model_ds/_core/visualizer/parsers.py:12
↓ 3 callers
Method
re_order
(self: Self, new_order: ArrayLike, column: str = "id")
src/power_grid_model_ds/_core/model/arrays/base/array.py:299
↓ 3 callers
Method
run
Generate routes, lines and normally open points (NOPs)
src/power_grid_model_ds/_core/data_source/generator/arrays/line.py:28
↓ 3 callers
Method
search_for_id
Attempts to find a record across all id-arrays within the container. This method is only intended for debugging purposes since it is very ine
src/power_grid_model_ds/_core/model/containers/base.py:145
↓ 3 callers
Method
set_unconnected_nodes
From a line array and total set of nodes determine which are not yet connected
src/power_grid_model_ds/_core/data_source/generator/arrays/line.py:115
↓ 2 callers
Function
_add_branch_array
Add a branch array to the grid
src/power_grid_model_ds/_core/model/grids/base.py:444
↓ 2 callers
Function
_array_to_dict
Stringify the record (required by Dash).
src/power_grid_model_ds/_core/visualizer/parsers.py:56
↓ 2 callers
Function
_center_and_truncate
(string: str, width: int)
src/power_grid_model_ds/_core/model/arrays/base/_string.py:82
↓ 2 callers
Function
_check_missing_columns
(array_columns: tuple[str, ...], defaults: dict[str, np.generic], provided_columns: set[str])
src/power_grid_model_ds/_core/model/arrays/base/_build.py:57
↓ 2 callers
Function
_get_branch3_branches
(branch3: Branch3Array)
src/power_grid_model_ds/_core/model/graphs/models/base.py:426
↓ 2 callers
Method
_get_empty_fields
(cls)
src/power_grid_model_ds/_core/model/containers/base.py:195
↓ 2 callers
Method
_match_dtypes
(first_dtype: np.dtype, second_dtype: np.dtype)
src/power_grid_model_ds/_core/load_flow.py:154
↓ 2 callers
Method
_setup_model
(self)
src/power_grid_model_ds/_core/load_flow.py:157
↓ 2 callers
Function
_to_data_table
(data: dict[str, Any])
src/power_grid_model_ds/_core/visualizer/callbacks/element_selection.py:28
↓ 2 callers
Method
add_branch3
Add a branch to all graphs
src/power_grid_model_ds/_core/model/graphs/container.py:96
↓ 2 callers
Method
add_branch3_array
Add a branch to all graphs
src/power_grid_model_ds/_core/model/graphs/container.py:90
↓ 2 callers
Method
add_branch_array
Add all branches in the branch array to the graph.
src/power_grid_model_ds/_core/model/graphs/models/base.py:164
↓ 2 callers
Method
add_node
Add a node to the graph.
src/power_grid_model_ds/_core/model/graphs/models/base.py:86
↓ 2 callers
Method
append
Append the given asset_array to the corresponding field of ArrayContainer and generate ids. Args: array(FancyArray): the asset_ar
src/power_grid_model_ds/_core/model/containers/base.py:111
↓ 2 callers
Function
apply_filter
Return an array with the records that match the input parameters. Note: output could be an empty array.
src/power_grid_model_ds/_core/model/arrays/base/_filters.py:38
↓ 2 callers
Method
connect_nodes
Add a new line between an active and inactive line
src/power_grid_model_ds/_core/data_source/generator/arrays/line.py:78
↓ 2 callers
Method
create_nop_lines
Create the inactive lines between different routes (Normally Open Points)
src/power_grid_model_ds/_core/data_source/generator/arrays/line.py:98
↓ 2 callers
Method
create_routes
Create a number of lines from the substation to unconnected nodes
src/power_grid_model_ds/_core/data_source/generator/arrays/line.py:51
↓ 2 callers
Method
delete_branch3
Remove a branch3 from the grid Args: branch (Branch3Array): The branch3 to remove
src/power_grid_model_ds/_core/model/grids/base.py:230
↓ 2 callers
Method
delete_branch_array
Delete all branches in branch_array from the graph.
src/power_grid_model_ds/_core/model/graphs/models/base.py:181
↓ 2 callers
Method
delete_node
Remove a node from the graph. Args: ext_node_id(int): id of the node to remove raise_on_fail(bool): whether to raise
src/power_grid_model_ds/_core/model/graphs/models/base.py:95
↓ 2 callers
Method
filter_parallel
Return branches that have n_parallel connections. Args: branches: BranchArray. n_parallel: the number of connections
src/power_grid_model_ds/_core/model/arrays/pgm_arrays.py:61
↓ 2 callers
Method
find_fundamental_cycles
Find all fundamental cycles in the graph. Returns: list[list[int]]: list of cycles, each cycle is a list of (external) node ids
src/power_grid_model_ds/_core/model/graphs/models/base.py:340
↓ 2 callers
Method
get_all_paths
Retrieves all paths between two (external) nodes. Returns a list of paths, each path containing a list of external nodes.
src/power_grid_model_ds/_core/model/graphs/models/base.py:242
↓ 2 callers
Function
get_app_layout
Get the app layout.
src/power_grid_model_ds/_core/visualizer/app.py:68
↓ 2 callers
Function
get_cytoscape_html
Get the Cytoscape HTML element
src/power_grid_model_ds/_core/visualizer/layout/cytoscape_html.py:19
↓ 2 callers
Method
get_defaults
(cls)
src/power_grid_model_ds/_core/model/arrays/base/array.py:74
↓ 2 callers
Method
get_downstream_nodes
Get the downstream nodes from a node. Assuming each node has a single feeding substation and the grid is radial Example:
src/power_grid_model_ds/_core/model/grids/base.py:332
↓ 2 callers
Method
get_empty_value
(self, column: str)
src/power_grid_model_ds/_core/model/arrays/base/array.py:234
↓ 2 callers
Function
get_inherited_attrs
Get the attribute from the object and all its parents
src/power_grid_model_ds/_core/utils/misc.py:26
↓ 2 callers
Method
get_nearest_substation_node
Find the nearest substation node. Args: node_id(int): The id of the node to find the nearest substation node for. Return
src/power_grid_model_ds/_core/model/grids/base.py:312
↓ 2 callers
Method
get_updated_by_id
(self: Self, ids: ArrayLike, allow_missing: bool = False, **kwargs)
src/power_grid_model_ds/_core/model/arrays/base/array.py:308
↓ 2 callers
Function
gzip2file
unzip a gzip (.gz) file
src/power_grid_model_ds/_core/utils/zip.py:53
↓ 2 callers
Method
load_from_txt
Load a grid from text
src/power_grid_model_ds/_core/model/grids/_text_sources.py:37
↓ 2 callers
Method
make_active
Make a branch active Args: branch (BranchArray): The branch to make active
src/power_grid_model_ds/_core/model/grids/base.py:267
next →
1–100 of 625, ranked by callers