From cfc8272ac288541d1e20c0840bd2ce6fa930897c Mon Sep 17 00:00:00 2001 From: wakonig_k Date: Sat, 12 Apr 2025 21:11:02 +0200 Subject: [PATCH] docs: add missing class doc strings for rpc-enabled widgets --- bec_widgets/cli/client.py | 18 ++++++++++++++++++ .../widgets/containers/dock/dock_area.py | 4 ++++ .../position_indicator/position_indicator.py | 4 ++++ .../control/scan_control/scan_control.py | 4 ++++ bec_widgets/widgets/plots/image/image.py | 4 ++++ .../widgets/plots/motor_map/motor_map.py | 4 ++++ .../plots/multi_waveform/multi_waveform.py | 4 ++++ bec_widgets/widgets/plots/waveform/waveform.py | 4 ++++ .../ring_progress_bar/ring_progress_bar.py | 4 ++++ .../services/device_browser/device_browser.py | 4 ++++ 10 files changed, 54 insertions(+) diff --git a/bec_widgets/cli/client.py b/bec_widgets/cli/client.py index 14094b51..9ae3f1c3 100644 --- a/bec_widgets/cli/client.py +++ b/bec_widgets/cli/client.py @@ -240,6 +240,8 @@ class BECDock(RPCBase): class BECDockArea(RPCBase): + """Container for other widgets. Widgets can be added to the dock area and arranged in a grid layout.""" + @property @rpc_call def _rpc_id(self) -> "str": @@ -660,6 +662,8 @@ class DapComboBox(RPCBase): class DeviceBrowser(RPCBase): + """DeviceBrowser is a widget that displays all available devices in the current BEC session.""" + @rpc_call def remove(self): """ @@ -698,6 +702,8 @@ class DeviceLineEdit(RPCBase): class Image(RPCBase): + """Image widget for displaying 2D data.""" + @property @rpc_call def enable_toolbar(self) -> "bool": @@ -1379,6 +1385,8 @@ class LogPanel(RPCBase): class MotorMap(RPCBase): + """Motor map widget for plotting motor positions in 2D including a trace of the last points.""" + @property @rpc_call def enable_toolbar(self) -> "bool": @@ -1768,6 +1776,8 @@ class MotorMap(RPCBase): class MultiWaveform(RPCBase): + """MultiWaveform widget for displaying multiple waveforms emitted by a single signal.""" + @property @rpc_call def enable_toolbar(self) -> "bool": @@ -2177,6 +2187,8 @@ class MultiWaveform(RPCBase): class PositionIndicator(RPCBase): + """Display a position within a defined range, e.g. motor limits.""" + @rpc_call def set_value(self, position: float): """ @@ -2328,6 +2340,8 @@ class Ring(RPCBase): class RingProgressBar(RPCBase): + """Show the progress of devices, scans or custom values in the form of ring progress bars.""" + @rpc_call def _get_all_rpc(self) -> "dict": """ @@ -2507,6 +2521,8 @@ class RingProgressBar(RPCBase): class ScanControl(RPCBase): + """Widget to submit new scans to the queue.""" + @rpc_call def remove(self): """ @@ -2896,6 +2912,8 @@ class VSCodeEditor(RPCBase): class Waveform(RPCBase): + """Widget for plotting waveforms.""" + @property @rpc_call def _config_dict(self) -> "dict": diff --git a/bec_widgets/widgets/containers/dock/dock_area.py b/bec_widgets/widgets/containers/dock/dock_area.py index 7565b2fd..01d6e69f 100644 --- a/bec_widgets/widgets/containers/dock/dock_area.py +++ b/bec_widgets/widgets/containers/dock/dock_area.py @@ -48,6 +48,10 @@ class DockAreaConfig(ConnectionConfig): class BECDockArea(BECWidget, QWidget): + """ + Container for other widgets. Widgets can be added to the dock area and arranged in a grid layout. + """ + PLUGIN = True USER_ACCESS = [ "_rpc_id", diff --git a/bec_widgets/widgets/control/device_control/position_indicator/position_indicator.py b/bec_widgets/widgets/control/device_control/position_indicator/position_indicator.py index 67230f4f..d86c9560 100644 --- a/bec_widgets/widgets/control/device_control/position_indicator/position_indicator.py +++ b/bec_widgets/widgets/control/device_control/position_indicator/position_indicator.py @@ -8,6 +8,10 @@ from bec_widgets.utils.colors import get_accent_colors, get_theme_palette class PositionIndicator(BECWidget, QWidget): + """ + Display a position within a defined range, e.g. motor limits. + """ + USER_ACCESS = ["set_value", "set_range", "vertical", "indicator_width", "rounded_corners"] PLUGIN = True ICON_NAME = "horizontal_distribute" diff --git a/bec_widgets/widgets/control/scan_control/scan_control.py b/bec_widgets/widgets/control/scan_control/scan_control.py index 9672528f..a2a82b70 100644 --- a/bec_widgets/widgets/control/scan_control/scan_control.py +++ b/bec_widgets/widgets/control/scan_control/scan_control.py @@ -41,6 +41,10 @@ class ScanControlConfig(ConnectionConfig): class ScanControl(BECWidget, QWidget): + """ + Widget to submit new scans to the queue. + """ + PLUGIN = True ICON_NAME = "tune" ARG_BOX_POSITION: int = 2 diff --git a/bec_widgets/widgets/plots/image/image.py b/bec_widgets/widgets/plots/image/image.py index 0e6583c0..29a48c1a 100644 --- a/bec_widgets/widgets/plots/image/image.py +++ b/bec_widgets/widgets/plots/image/image.py @@ -41,6 +41,10 @@ class ImageConfig(ConnectionConfig): class Image(PlotBase): + """ + Image widget for displaying 2D data. + """ + PLUGIN = True RPC = True ICON_NAME = "image" diff --git a/bec_widgets/widgets/plots/motor_map/motor_map.py b/bec_widgets/widgets/plots/motor_map/motor_map.py index 85fe5b7f..31f5da5f 100644 --- a/bec_widgets/widgets/plots/motor_map/motor_map.py +++ b/bec_widgets/widgets/plots/motor_map/motor_map.py @@ -83,6 +83,10 @@ class MotorMapConfig(ConnectionConfig): class MotorMap(PlotBase): + """ + Motor map widget for plotting motor positions in 2D including a trace of the last points. + """ + PLUGIN = True RPC = True ICON_NAME = "my_location" diff --git a/bec_widgets/widgets/plots/multi_waveform/multi_waveform.py b/bec_widgets/widgets/plots/multi_waveform/multi_waveform.py index efcc037f..0e03d9e4 100644 --- a/bec_widgets/widgets/plots/multi_waveform/multi_waveform.py +++ b/bec_widgets/widgets/plots/multi_waveform/multi_waveform.py @@ -45,6 +45,10 @@ class MultiWaveformConfig(ConnectionConfig): class MultiWaveform(PlotBase): + """ + MultiWaveform widget for displaying multiple waveforms emitted by a single signal. + """ + PLUGIN = True RPC = True ICON_NAME = "ssid_chart" diff --git a/bec_widgets/widgets/plots/waveform/waveform.py b/bec_widgets/widgets/plots/waveform/waveform.py index e50e3a69..8f7dee21 100644 --- a/bec_widgets/widgets/plots/waveform/waveform.py +++ b/bec_widgets/widgets/plots/waveform/waveform.py @@ -38,6 +38,10 @@ class WaveformConfig(ConnectionConfig): class Waveform(PlotBase): + """ + Widget for plotting waveforms. + """ + PLUGIN = True RPC = True ICON_NAME = "show_chart" diff --git a/bec_widgets/widgets/progress/ring_progress_bar/ring_progress_bar.py b/bec_widgets/widgets/progress/ring_progress_bar/ring_progress_bar.py index 234cf3be..ad66d658 100644 --- a/bec_widgets/widgets/progress/ring_progress_bar/ring_progress_bar.py +++ b/bec_widgets/widgets/progress/ring_progress_bar/ring_progress_bar.py @@ -71,6 +71,10 @@ class RingProgressBarConfig(ConnectionConfig): class RingProgressBar(BECWidget, QWidget): + """ + Show the progress of devices, scans or custom values in the form of ring progress bars. + """ + PLUGIN = True ICON_NAME = "track_changes" USER_ACCESS = [ diff --git a/bec_widgets/widgets/services/device_browser/device_browser.py b/bec_widgets/widgets/services/device_browser/device_browser.py index ed9755b4..1a4cbedc 100644 --- a/bec_widgets/widgets/services/device_browser/device_browser.py +++ b/bec_widgets/widgets/services/device_browser/device_browser.py @@ -13,6 +13,10 @@ from bec_widgets.widgets.services.device_browser.device_item import DeviceItem class DeviceBrowser(BECWidget, QWidget): + """ + DeviceBrowser is a widget that displays all available devices in the current BEC session. + """ + device_update: Signal = Signal() PLUGIN = True ICON_NAME = "lists"