cratepy.clustering.clusteringphase.CRMP

class CRMP[source]

Bases: ABC

Cluster-Reduced Material Phase interface.

perform_base_clustering(self)[source]

abstract: Perform CRMP base clustering.

get_n_clusters(self)[source]

abstract: Get current number of clusters.

get_clustering_type(self)[source]

abstract: Get cluster-reduced material phase adaptivity type.

get_valid_clust_algs()[source]

abstract: Get valid clustering algorithms to compute the CRMP.

_update_cluster_labels(labels, min_label=0)[source]

Update cluster labels starting with the provided minimum label.

Constructor.

List of Public Methods

get_clustering_type

Get cluster-reduced material phase adaptivity type.

get_n_clusters

Get current number of clusters.

get_valid_clust_algs

Get valid clustering algorithms to compute the CRMP.

perform_base_clustering

Perform CRMP base clustering.

Methods

abstract __init__()[source]

Constructor.

static _update_cluster_labels(labels, min_label=0)[source]

Update cluster labels starting with the provided minimum label.

Parameters:
  • labels (numpy.ndarray (1d)) – Cluster labels (numpy.ndarray[int] of shape (n_items,)).

  • min_label (int, default=0) – Minimum cluster label.

Returns:

  • new_labels (numpy.ndarray (1d)) – Updated cluster labels (numpy.ndarray[int] of shape (n_items,)).

  • max_label (int) – Maximum cluster label.

abstract get_clustering_type()[source]

Get cluster-reduced material phase adaptivity type.

Returns:

clustering_type – Type of cluster-reduced material phase.

Return type:

str

abstract get_n_clusters()[source]

Get current number of clusters.

Returns:

n_clusters – Number of material phase clusters.

Return type:

int

abstract static get_valid_clust_algs()[source]

Get valid clustering algorithms to compute the CRMP.

Returns:

clust_algs – Clustering algorithms identifiers (str).

Return type:

list[str]

abstract perform_base_clustering()[source]

Perform CRMP base clustering.