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
+ """
44
+
39
45
def __init__ (self , ray_clusters_df : pd .DataFrame , namespace : str = None ):
40
46
from ...ray .cluster .cluster import get_current_namespace
41
47
@@ -74,6 +80,10 @@ def __init__(self, ray_clusters_df: pd.DataFrame, namespace: str = None):
74
80
self ._trigger_initial_display ()
75
81
76
82
def _initialize_callbacks (self ):
83
+ """
84
+ Called upon RayClusterManagerWidgets initialisation.
85
+ Sets up event handlers and callbacks for UI interactions.
86
+ """
77
87
# Observe cluster selection
78
88
self .classification_widget .observe (
79
89
lambda selection_change : self ._on_cluster_click (selection_change ),
@@ -87,6 +97,10 @@ def _initialize_callbacks(self):
87
97
)
88
98
89
99
def _trigger_initial_display (self ):
100
+ """
101
+ Called upon RayClusterManagerWidgets initialisation.
102
+ Triggers an initial display update with the current cluster value.
103
+ """
90
104
# Trigger display with initial cluster value
91
105
initial_value = self .classification_widget .value
92
106
self ._on_cluster_click ({"new" : initial_value })
0 commit comments