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ο
- 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:
ResultsTemplateStore 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:
Nonebecause 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ο
- objectsο
- sel_idxο
- class VeraGridEngine.Simulations.Topology.topology_reduction_driver.TopologyReduction(grid: MultiCircuit, branch_indices)[source]ο
Bases:
DriverTemplate- br_to_removeο
- 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