Skip to content

Commit ef12e0e

Browse files
Add comments to widgets class and functions
1 parent 897f82d commit ef12e0e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/codeflare_sdk/common/widgets/widgets.py

+13
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636

3737

3838
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+
"""
3944
def __init__(self, ray_clusters_df: pd.DataFrame, namespace: str = None):
4045
from ...ray.cluster.cluster import get_current_namespace
4146

@@ -74,6 +79,10 @@ def __init__(self, ray_clusters_df: pd.DataFrame, namespace: str = None):
7479
self._trigger_initial_display()
7580

7681
def _initialize_callbacks(self):
82+
"""
83+
Called upon RayClusterManagerWidgets initialisation.
84+
Sets up event handlers and callbacks for UI interactions.
85+
"""
7786
# Observe cluster selection
7887
self.classification_widget.observe(
7988
lambda selection_change: self._on_cluster_click(selection_change),
@@ -87,6 +96,10 @@ def _initialize_callbacks(self):
8796
)
8897

8998
def _trigger_initial_display(self):
99+
"""
100+
Called upon RayClusterManagerWidgets initialisation.
101+
Triggers an initial display update with the current cluster value.
102+
"""
90103
# Trigger display with initial cluster value
91104
initial_value = self.classification_widget.value
92105
self._on_cluster_click({"new": initial_value})

0 commit comments

Comments
 (0)