Skip to content

Commit b4b8e9e

Browse files
refactor: sklearn-style class API for clustering methods
Each clustering algorithm is now a frozen dataclass configured at construction time and invoked as a callable: result = Gromos(cutoff_nm=0.2)(rmsd_matrix) result = DBSCAN(eps=0.15, backend="numba")(rmsd_matrix) result = KMeans(n_clusters=10)(pca.projections) Distance-matrix methods: Gromos, Hierarchical, DBSCAN, HDBSCAN Feature-vector methods: KMeans, MiniBatchKMeans, RegularSpace DBSCAN supports backend="numba" (default, O(n) aux) and backend="sklearn" (official). Other methods delegate to their official library (scipy/sklearn/deeptime). cluster_conformations and cluster_features remain as backward- compatible wrappers accepting both string names and class instances. Removed all memory guards per user request.
1 parent de3743f commit b4b8e9e

3 files changed

Lines changed: 454 additions & 305 deletions

File tree

src/mdpp/analysis/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
"""Analysis subpackage for molecular dynamics trajectories."""
22

33
from mdpp.analysis.clustering import (
4+
DBSCAN,
5+
HDBSCAN,
6+
Gromos,
7+
Hierarchical,
8+
KMeans,
9+
MiniBatchKMeans,
10+
RegularSpace,
411
cluster_conformations,
512
cluster_features,
613
compute_rmsd_matrix,
@@ -31,6 +38,13 @@
3138
)
3239

3340
__all__ = [
41+
"DBSCAN",
42+
"HDBSCAN",
43+
"Gromos",
44+
"Hierarchical",
45+
"KMeans",
46+
"MiniBatchKMeans",
47+
"RegularSpace",
3448
"cluster_conformations",
3549
"cluster_features",
3650
"compute_contact_frequency",

0 commit comments

Comments
 (0)