36
36
37
37
38
38
class RayClusterManagerWidgets :
39
+ """
40
+ The RayClusterManagerWidgets class is responsible for initialising the ToggleButtons, Button, and Output widgets.
41
+ It also handles the user interactions and displays the cluster details.
42
+ Used when calling the view_clusters function.
43
+ """
39
44
def __init__ (self , ray_clusters_df : pd .DataFrame , namespace : str = None ):
40
45
from ...ray .cluster .cluster import get_current_namespace
41
46
@@ -74,6 +79,10 @@ def __init__(self, ray_clusters_df: pd.DataFrame, namespace: str = None):
74
79
self ._trigger_initial_display ()
75
80
76
81
def _initialize_callbacks (self ):
82
+ """
83
+ Called upon RayClusterManagerWidgets initialisation.
84
+ Sets up event handlers and callbacks for UI interactions.
85
+ """
77
86
# Observe cluster selection
78
87
self .classification_widget .observe (
79
88
lambda selection_change : self ._on_cluster_click (selection_change ),
@@ -87,6 +96,10 @@ def _initialize_callbacks(self):
87
96
)
88
97
89
98
def _trigger_initial_display (self ):
99
+ """
100
+ Called upon RayClusterManagerWidgets initialisation.
101
+ Triggers an initial display update with the current cluster value.
102
+ """
90
103
# Trigger display with initial cluster value
91
104
initial_value = self .classification_widget .value
92
105
self ._on_cluster_click ({"new" : initial_value })
0 commit comments