VeraGridEngine.Simulations.Topology package

Submodules

VeraGridEngine.Simulations.Topology.node_groups_driver module

class VeraGridEngine.Simulations.Topology.node_groups_driver.NodeGroupsDriver[source]

Bases: DriverTemplate

build_weighted_graph() Graph[source]

Build the topology graph used by the Dijkstra-based distance mode.

Returns:

Weighted graph whose nodes are bus indices.

min_group_size
name = 'Node groups'
ptdf_results
run() None[source]

Execute the node grouping study.

Returns:

None.

sigmas
tpe = 'Node groups'
use_ptdf

VeraGridEngine.Simulations.Topology.node_groups_results module

class VeraGridEngine.Simulations.Topology.node_groups_results.NodeGroupsResults(n: int)[source]

Bases: ResultsTemplate

Store the reusable data produced by the node grouping simulation.

CLASS_DATA_VARIABLES = {'X_train': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'groups_by_index': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'groups_by_name': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'sigma': <VeraGridEngine.Simulations.results_template.ResultsProperty object>}
CLASS_RESULTS_DECLARATIONS = (<VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>)
LOCAL_RESULTS_DECLARATIONS = (<VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>)
X_train: Mat
get_groups_by_index() list[list[int]][source]

Get the bus groups represented by bus indices.

Returns:

Bus groups represented by bus indices.

get_groups_by_name() list[list[str]][source]

Get the bus groups represented by bus names.

Returns:

Bus groups represented by bus names.

get_sigma() float[source]

Get the characteristic distance scale of the training matrix.

Returns:

Standard deviation of the training matrix.

get_training_matrix() ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]][source]

Get the matrix used by the clustering algorithm.

Returns:

Training matrix prepared for DBSCAN.

groups_by_index: list[list[int]]
groups_by_name: list[list[str]]
mdl(result_type: ResultTypes | None = None) None[source]

Build a tabular representation of the stored results.

Parameters:

result_type – Unused result type placeholder kept for API compatibility with the rest of the simulations package.

Returns:

None because no table view is defined for this study yet.

set_groups(groups_by_name: list[list[str]], groups_by_index: list[list[int]]) None[source]

Store the resulting bus group assignments.

Parameters:
  • groups_by_name – Bus groups represented by bus names.

  • groups_by_index – Bus groups represented by bus indices.

set_sigma(sigma: float) None[source]

Store the characteristic distance scale of the training matrix.

Parameters:

sigma – Standard deviation of the training matrix.

set_training_matrix(training_matrix: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]]) None[source]

Store the matrix used by the clustering algorithm.

Parameters:

training_matrix – Training matrix prepared for DBSCAN.

sigma: float

VeraGridEngine.Simulations.Topology.topology_reduction_driver module

class VeraGridEngine.Simulations.Topology.topology_reduction_driver.DeleteAndReduce(grid: MultiCircuit, objects, sel_idx)[source]

Bases: DriverTemplate

buses_merged
cancel()[source]

Cancel the simulation :return:

objects
run()[source]

Run the monte carlo simulation @return:

sel_idx
start()[source]
class VeraGridEngine.Simulations.Topology.topology_reduction_driver.TopologyReduction(grid: MultiCircuit, branch_indices)[source]

Bases: DriverTemplate

br_to_remove
cancel()[source]

Cancel the simulation :return:

run()[source]

Run the monte carlo simulation @return:

tpe = 'Topology reduction'
class VeraGridEngine.Simulations.Topology.topology_reduction_driver.TopologyReductionOptions[source]

Bases: object

rx_criteria
rx_threshold
selected_type
VeraGridEngine.Simulations.Topology.topology_reduction_driver.get_branches_of_bus(B, j)[source]

Get the indices of the Branches connected to the bus j :param B: Branch-bus CSC matrix :param j: bus index :return: list of Branches in the bus

VeraGridEngine.Simulations.Topology.topology_reduction_driver.reduce_buses(circuit: MultiCircuit, buses_to_reduce: List[Bus], text_func=None, prog_func=None)[source]

Reduce the uses in the grid This function removes the buses but whenever a bus is removed, the devices connected to it are inherited by the bus of higher voltage that is connected. If the bus is isolated, those devices are lost. :param circuit: MultiCircuit instance :param buses_to_reduce: list of Bus objects :param text_func: :param prog_func: :return: Nothing

VeraGridEngine.Simulations.Topology.topology_reduction_driver.reduce_grid_brute(circuit: MultiCircuit, removed_br_idx)[source]

Remove the first branch found to be removed. this function is meant to be called until it returns false Args:

circuit: Circuit to modify in-place removed_br_idx: branch index

Returns: Nothing

VeraGridEngine.Simulations.Topology.topology_reduction_driver.select_branches_to_reduce(circuit: MultiCircuit, rx_criteria=True, rx_threshold=1e-05, selected_types=branch)[source]

Find Branches to delete Args:

circuit: Circuit to modify in-place rx_criteria: use the r+x threshold to select Branches? rx_threshold: r+x threshold selected_types: branch types to select

Module contents