VeraGridEngine.Simulations.Clustering package

Submodules

VeraGridEngine.Simulations.Clustering.clustering module

VeraGridEngine.Simulations.Clustering.clustering.kmeans_approximate_sampling(x_input: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], n_points: int = 10) Tuple[ndarray[tuple[Any, ...], dtype[int64]], ndarray[tuple[Any, ...], dtype[float64]]][source]

K-Means clustering, corrected to the closest points :param x_input: Injections matrix (time, bus) :param n_points: number of clusters :return: indices of the closest to the cluster centers, deviation of the closest representatives

VeraGridEngine.Simulations.Clustering.clustering.kmeans_sampling(x_input: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], n_points: int = 10) Tuple[ndarray[tuple[Any, ...], dtype[int64]], ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[int64]]][source]

K-Means clustering, fit to the closest points :param x_input: matrix to evaluate (time, params) :param n_points: number of clusters :return: indices of the closest to the cluster centers,

deviation of the closest representatives, array signifying to which cluster does each simulation belong

VeraGridEngine.Simulations.Clustering.clustering.spectral_approximate_sampling(x_input: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], n_points: int = 10) Tuple[ndarray[tuple[Any, ...], dtype[int64]], ndarray[tuple[Any, ...], dtype[float64]], int][source]

K-Means clustering, corrected to the closest points :param x_input: Injections matrix (time, bus) :param n_points: number of clusters :return: indices of the closest to the cluster centers, deviation of the closest representatives

VeraGridEngine.Simulations.Clustering.clustering_driver module

class VeraGridEngine.Simulations.Clustering.clustering_driver.ClusteringDriver(grid: MultiCircuit, options: ClusteringAnalysisOptions)[source]

Bases: DriverTemplate

get_steps()[source]

Get variations list of strings

name = 'Clustering analysis'
options: ClusteringAnalysisOptions
run()[source]

Run thread

tpe = 'Clustering Analysis'

VeraGridEngine.Simulations.Clustering.clustering_options module

class VeraGridEngine.Simulations.Clustering.clustering_options.ClusteringAnalysisOptions(n_points: int)[source]

Bases: OptionsTemplate

CLASS_NON_EDITABLE_PROPERTIES: Tuple[str, ...] = ('idtag', 'diff_changes')
CLASS_PROPERTIES_WITH_PROFILE: Dict[str, str] = {}
CLASS_PROPERTY_DECLARATIONS: Tuple[GCProp, ...] = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:comment, prop:diff_changes, prop:n_points)
CLASS_PROPERTY_LIST: Tuple[GCProp, ...] = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:comment, prop:diff_changes, prop:n_points)
CLASS_REGISTERED_PROPERTIES: Dict[str, GCProp] = {'action': prop:action, 'code': prop:code, 'comment': prop:comment, 'diff_changes': prop:diff_changes, 'idtag': prop:idtag, 'n_points': prop:n_points, 'name': prop:name, 'rdfid': prop:rdfid}
LOCAL_PROPERTY_DECLARATIONS: Tuple[GCProp, ...] = (prop:n_points,)
action: ActionType
comment: str
device_type: DeviceType
diff_changes
selected_to_merge

VeraGridEngine.Simulations.Clustering.clustering_results module

class VeraGridEngine.Simulations.Clustering.clustering_results.ClusteringResults(time_indices: ndarray[tuple[Any, ...], dtype[int64]], sampled_probabilities: ndarray[tuple[Any, ...], dtype[float64]], time_array: DatetimeIndex, original_sample_idx: ndarray[tuple[Any, ...], dtype[int64]])[source]

Bases: ResultsTemplate

CLASS_DATA_VARIABLES = {'original_sample_idx': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'sampled_probabilities': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'time_indices': <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>)
LOCAL_RESULTS_DECLARATIONS = (<VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>)
mdl(result_type: ResultTypes) ResultsTable[source]

Plot the results. :param result_type: ResultTypes :return: ResultsModel

original_sample_idx: IntVec | None
sampled_probabilities: Vec | None
time_indices: IntVec | None

Module contents