Skip to content

Commit 747e6b1

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

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/codeflare_sdk/common/widgets/widgets.py

+14
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
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+
"""
44+
3945
def __init__(self, ray_clusters_df: pd.DataFrame, namespace: str = None):
4046
from ...ray.cluster.cluster import get_current_namespace
4147

@@ -74,6 +80,10 @@ def __init__(self, ray_clusters_df: pd.DataFrame, namespace: str = None):
7480
self._trigger_initial_display()
7581

7682
def _initialize_callbacks(self):
83+
"""
84+
Called upon RayClusterManagerWidgets initialisation.
85+
Sets up event handlers and callbacks for UI interactions.
86+
"""
7787
# Observe cluster selection
7888
self.classification_widget.observe(
7989
lambda selection_change: self._on_cluster_click(selection_change),
@@ -87,6 +97,10 @@ def _initialize_callbacks(self):
8797
)
8898

8999
def _trigger_initial_display(self):
100+
"""
101+
Called upon RayClusterManagerWidgets initialisation.
102+
Triggers an initial display update with the current cluster value.
103+
"""
90104
# Trigger display with initial cluster value
91105
initial_value = self.classification_widget.value
92106
self._on_cluster_click({"new": initial_value})

0 commit comments

Comments
 (0)