bec-widgets 0.65.1__py3-none-any.whl → 0.66.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- CHANGELOG.md +12 -8
- PKG-INFO +1 -1
- bec_widgets/cli/rpc_wigdet_handler.py +33 -13
- bec_widgets/utils/__init__.py +2 -0
- bec_widgets/widgets/dock/dock.py +3 -3
- {bec_widgets-0.65.1.dist-info → bec_widgets-0.66.0.dist-info}/METADATA +1 -1
- {bec_widgets-0.65.1.dist-info → bec_widgets-0.66.0.dist-info}/RECORD +12 -11
- pyproject.toml +1 -1
- tests/unit_tests/test_rpc_widget_handler.py +7 -0
- {bec_widgets-0.65.1.dist-info → bec_widgets-0.66.0.dist-info}/WHEEL +0 -0
- {bec_widgets-0.65.1.dist-info → bec_widgets-0.66.0.dist-info}/entry_points.txt +0 -0
- {bec_widgets-0.65.1.dist-info → bec_widgets-0.66.0.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## v0.66.0 (2024-06-20)
|
4
|
+
|
5
|
+
### Feature
|
6
|
+
|
7
|
+
* feat(rpc): discover widgets automatically ([`ef25f56`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ef25f5638032f931ceb292540ada618508bb2aed))
|
8
|
+
|
9
|
+
## v0.65.2 (2024-06-20)
|
10
|
+
|
11
|
+
### Fix
|
12
|
+
|
13
|
+
* fix(pyqt): webengine must be imported before qcoreapplication ([`cbbd23a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/cbbd23aa33095141e4c265719d176c4aa8c25996))
|
14
|
+
|
3
15
|
## v0.65.1 (2024-06-20)
|
4
16
|
|
5
17
|
### Fix
|
@@ -145,20 +157,12 @@ This reverts commit abc6caa2d0b6141dfbe1f3d025f78ae14deddcb3 ([`fe04dd8`](https:
|
|
145
157
|
|
146
158
|
* feat: added isort to bw-generate-cli ([`f0391f5`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f0391f59c9eb0a51b693fccfe2e399e869d35dda))
|
147
159
|
|
148
|
-
* feat: added entry point for bw-generate-cli ([`1c7f491`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/1c7f4912ce5998e666276969bf4af8656d619a91))
|
149
|
-
|
150
|
-
* feat(cli): auto-discover rpc-enabled widgets ([`df1be10`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/df1be10057a5e85a3f35bef1c1b27366b6727276))
|
151
|
-
|
152
160
|
### Fix
|
153
161
|
|
154
162
|
* fix: removed BECConnector from rpc client interface ([`6428e38`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6428e38ab94c15a2c904e75cc6404bb6d0394e04))
|
155
163
|
|
156
164
|
* fix: added bec_ipython_client as dependency; needed for jupyter widget ([`006a089`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/006a0894b85cba3b2773737ed6fe3e92c81cdee0))
|
157
165
|
|
158
|
-
* fix(BECFigure): removed duplicated user access for plot ([`954c576`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/954c576131f7deac669ddf9f51eeb1d41b6f92b7))
|
159
|
-
|
160
|
-
* fix(bec_connector): field validator should be a classmethod ([`867720a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/867720a897b6713bd0df9af71ffdd11a6a380f7d))
|
161
|
-
|
162
166
|
### Refactor
|
163
167
|
|
164
168
|
* refactor: minor cleanup ([`3adf6cf`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3adf6cfd586355c8b8ce7fdc9722f868e22287c5))
|
PKG-INFO
CHANGED
@@ -1,22 +1,37 @@
|
|
1
1
|
from bec_widgets.utils import BECConnector
|
2
|
-
from bec_widgets.widgets.figure import BECFigure
|
3
|
-
from bec_widgets.widgets.spiral_progress_bar.spiral_progress_bar import SpiralProgressBar
|
4
|
-
from bec_widgets.widgets.text_box.text_box import TextBox
|
5
|
-
from bec_widgets.widgets.website.website import WebsiteWidget
|
6
2
|
|
7
3
|
|
8
4
|
class RPCWidgetHandler:
|
9
5
|
"""Handler class for creating widgets from RPC messages."""
|
10
6
|
|
11
|
-
|
12
|
-
|
13
|
-
"SpiralProgressBar": SpiralProgressBar,
|
14
|
-
"Website": WebsiteWidget,
|
15
|
-
"TextBox": TextBox,
|
16
|
-
}
|
7
|
+
def __init__(self):
|
8
|
+
self._widget_classes = None
|
17
9
|
|
18
|
-
@
|
19
|
-
def
|
10
|
+
@property
|
11
|
+
def widget_classes(self):
|
12
|
+
"""
|
13
|
+
Get the available widget classes.
|
14
|
+
|
15
|
+
Returns:
|
16
|
+
dict: The available widget classes.
|
17
|
+
"""
|
18
|
+
if self._widget_classes is None:
|
19
|
+
self.update_available_widgets()
|
20
|
+
return self._widget_classes
|
21
|
+
|
22
|
+
def update_available_widgets(self):
|
23
|
+
"""
|
24
|
+
Update the available widgets.
|
25
|
+
|
26
|
+
Returns:
|
27
|
+
None
|
28
|
+
"""
|
29
|
+
from bec_widgets.utils.plugin_utils import get_rpc_classes
|
30
|
+
|
31
|
+
clss = get_rpc_classes("bec_widgets")
|
32
|
+
self._widget_classes = {cls.__name__: cls for cls in clss["top_level_classes"]}
|
33
|
+
|
34
|
+
def create_widget(self, widget_type, **kwargs) -> BECConnector:
|
20
35
|
"""
|
21
36
|
Create a widget from an RPC message.
|
22
37
|
|
@@ -27,7 +42,12 @@ class RPCWidgetHandler:
|
|
27
42
|
Returns:
|
28
43
|
widget(BECConnector): The created widget.
|
29
44
|
"""
|
30
|
-
|
45
|
+
if self._widget_classes is None:
|
46
|
+
self.update_available_widgets()
|
47
|
+
widget_class = self._widget_classes.get(widget_type)
|
31
48
|
if widget_class:
|
32
49
|
return widget_class(**kwargs)
|
33
50
|
raise ValueError(f"Unknown widget type: {widget_type}")
|
51
|
+
|
52
|
+
|
53
|
+
widget_handler = RPCWidgetHandler()
|
bec_widgets/utils/__init__.py
CHANGED
bec_widgets/widgets/dock/dock.py
CHANGED
@@ -5,7 +5,7 @@ from typing import TYPE_CHECKING, Any, Literal, Optional
|
|
5
5
|
from pydantic import Field
|
6
6
|
from pyqtgraph.dockarea import Dock
|
7
7
|
|
8
|
-
from bec_widgets.cli.rpc_wigdet_handler import
|
8
|
+
from bec_widgets.cli.rpc_wigdet_handler import widget_handler
|
9
9
|
from bec_widgets.utils import BECConnector, ConnectionConfig, GridLayoutManager
|
10
10
|
|
11
11
|
if TYPE_CHECKING:
|
@@ -149,7 +149,7 @@ class BECDock(BECConnector, Dock):
|
|
149
149
|
Returns:
|
150
150
|
list: The list of eligible widgets.
|
151
151
|
"""
|
152
|
-
return list(
|
152
|
+
return list(widget_handler.widget_classes.keys())
|
153
153
|
|
154
154
|
def add_widget(
|
155
155
|
self,
|
@@ -178,7 +178,7 @@ class BECDock(BECConnector, Dock):
|
|
178
178
|
self.layout_manager.shift_widgets(shift, start_row=row)
|
179
179
|
|
180
180
|
if isinstance(widget, str):
|
181
|
-
widget =
|
181
|
+
widget = widget_handler.create_widget(widget)
|
182
182
|
else:
|
183
183
|
widget = widget
|
184
184
|
|
@@ -2,11 +2,11 @@
|
|
2
2
|
.gitlab-ci.yml,sha256=RnYDz4zKXjlqltTryprlB1s5vLXxI2-seW-Vb70NNF0,8162
|
3
3
|
.pylintrc,sha256=OstrgmEyP0smNFBKoIN5_26-UmNZgMHnbjvAWX0UrLs,18535
|
4
4
|
.readthedocs.yaml,sha256=aSOc277LqXcsTI6lgvm_JY80lMlr69GbPKgivua2cS0,603
|
5
|
-
CHANGELOG.md,sha256=
|
5
|
+
CHANGELOG.md,sha256=P5wRvE4GZafd9QiYxHEs_VrdmlN8nfBuhSRoIoiVbBg,7087
|
6
6
|
LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
7
|
-
PKG-INFO,sha256=
|
7
|
+
PKG-INFO,sha256=zGYdWrGWioZkJQL84cTkSoYLziwjhiDoVOCpJ2wCdL0,1302
|
8
8
|
README.md,sha256=y4jB6wvArS7N8_iTbKWnSM_oRAqLA2GqgzUR-FMh5sU,2645
|
9
|
-
pyproject.toml,sha256=
|
9
|
+
pyproject.toml,sha256=yQfeKopRkLxKI3bBz3HoECNUXBRbatDouMvIoBjRej8,2162
|
10
10
|
.git_hooks/pre-commit,sha256=n3RofIZHJl8zfJJIUomcMyYGFi_rwq4CC19z0snz3FI,286
|
11
11
|
.gitlab/issue_templates/bug_report_template.md,sha256=gAuyEwl7XlnebBrkiJ9AqffSNOywmr8vygUFWKTuQeI,386
|
12
12
|
.gitlab/issue_templates/documentation_update_template.md,sha256=FHLdb3TS_D9aL4CYZCjyXSulbaW5mrN2CmwTaeLPbNw,860
|
@@ -21,7 +21,7 @@ bec_widgets/cli/client.py,sha256=GJRzys0DVHQp8X9QxociTrshPm4CvaPtEprxWEpEKCs,564
|
|
21
21
|
bec_widgets/cli/client_utils.py,sha256=D076XKwcukKBKknd11B1UyOcQN_9sN7ZKMVttyCxS9Q,11586
|
22
22
|
bec_widgets/cli/generate_cli.py,sha256=Bi8HxHhge1I87vbdYHZUZiZwvbB-OSkLYS5Xfmwiz9M,4922
|
23
23
|
bec_widgets/cli/rpc_register.py,sha256=QxXUZu5XNg00Yf5O3UHWOXg3-f_pzKjjoZYMOa-MOJc,2216
|
24
|
-
bec_widgets/cli/rpc_wigdet_handler.py,sha256=
|
24
|
+
bec_widgets/cli/rpc_wigdet_handler.py,sha256=1qQOGrM8rozaWLkoxAW8DTVLv_L_DZdZgUMDPy5MOek,1486
|
25
25
|
bec_widgets/cli/server.py,sha256=4sigviIyJgZOgikWHc1X998vWAWayKF6S61oAY_mVDQ,5727
|
26
26
|
bec_widgets/examples/__init__.py,sha256=WWQ0cu7m8sA4Ehy-DWdTIqSISjaHsbxhsNmNrMnhDZU,202
|
27
27
|
bec_widgets/examples/jupyter_console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -30,7 +30,7 @@ bec_widgets/examples/jupyter_console/jupyter_console_window.ui,sha256=2A2mNTUMZB
|
|
30
30
|
bec_widgets/examples/motor_movement/__init__.py,sha256=LzPJkxLAxOsZCbXR-fRCPmeYobp7Yqds6tDxW4W1gSw,214
|
31
31
|
bec_widgets/examples/motor_movement/motor_control_compilations.py,sha256=8rpA7a2xVZTDMrx7YQIj3IJew78J1gcVMkHvloS0U_Q,9055
|
32
32
|
bec_widgets/examples/motor_movement/motor_controller.ui,sha256=83XX6NGILwntoUIghvzWnMuGf80O8khK3SduVKTAEFM,29105
|
33
|
-
bec_widgets/utils/__init__.py,sha256=
|
33
|
+
bec_widgets/utils/__init__.py,sha256=1930ji1Jj6dVuY81Wd2kYBhHYNV-2R0bN_L4o9zBj1U,533
|
34
34
|
bec_widgets/utils/bec_connector.py,sha256=RxHJNF7JjtY5pRbTMu2eQTiRXvoyJ53QuTYxHjZba38,5357
|
35
35
|
bec_widgets/utils/bec_dispatcher.py,sha256=tFRd-rfOpyijr1iCGq31kLUjHRr9Y_h2HYYEZKZCgvo,5803
|
36
36
|
bec_widgets/utils/bec_table.py,sha256=nA2b8ukSeUfquFMAxGrUVOqdrzMoDYD6O_4EYbOG2zk,717
|
@@ -57,7 +57,7 @@ bec_widgets/widgets/device_inputs/device_combobox/device_combobox.py,sha256=_XL4
|
|
57
57
|
bec_widgets/widgets/device_inputs/device_line_edit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
58
58
|
bec_widgets/widgets/device_inputs/device_line_edit/device_line_edit.py,sha256=cvvFg9HS7yN9kn-lWI_Uvj_dq2xlqNhuDi21e73k2xo,3249
|
59
59
|
bec_widgets/widgets/dock/__init__.py,sha256=B7foHt02gnhM7mFksa7GJVwT7n0j_JvYDCt6wc6XR5g,61
|
60
|
-
bec_widgets/widgets/dock/dock.py,sha256=
|
60
|
+
bec_widgets/widgets/dock/dock.py,sha256=lEl6ppy0v-8X5bVX7EQIYka8rAakjkZyh6ufgr7YxKs,7595
|
61
61
|
bec_widgets/widgets/dock/dock_area.py,sha256=9c_tLzyBRllLfc4H5o9-4bvasWp5hWe1NWg4mupXVtU,7911
|
62
62
|
bec_widgets/widgets/figure/__init__.py,sha256=3hGx_KOV7QHCYAV06aNuUgKq4QIYCjUTad-DrwkUaBM,44
|
63
63
|
bec_widgets/widgets/figure/figure.py,sha256=3bf1TyzIE8kVRDgjLqdlvCoE4wrozyfbeCWLjCo1Fwo,31821
|
@@ -166,6 +166,7 @@ tests/unit_tests/test_motor_control.py,sha256=NBekcGALo5mYkuyBJvBhvJkWiQDV82hI4G
|
|
166
166
|
tests/unit_tests/test_plot_base.py,sha256=Akr_JgglUCrtERtdtsMqWko_MLUYoAYRGzV2sum-YHo,3836
|
167
167
|
tests/unit_tests/test_plugin_utils.py,sha256=PonKNpu4fZaFmKbI2v0tZJjZrsTvBGSF96bPHvKJvrE,608
|
168
168
|
tests/unit_tests/test_rpc_register.py,sha256=hECjZEimd440mwRrO0rg7L3PKN7__3DgjmESN6wx3bo,1179
|
169
|
+
tests/unit_tests/test_rpc_widget_handler.py,sha256=QC85N48UAFsROKRNkoDIfInzy1mLhp2buLVSJifkhiU,236
|
169
170
|
tests/unit_tests/test_scan_control.py,sha256=Xf8bGt8lRJobRwBoqUdVXxsHno8ejvC77FqprhF7Z6I,7564
|
170
171
|
tests/unit_tests/test_spiral_progress_bar.py,sha256=n5aLSZ2B6K5a1vQuKTERnCSmIz9hYGFyk7jP3TU0AwQ,12438
|
171
172
|
tests/unit_tests/test_stop_button.py,sha256=2OH9dhs_-S5QovPPgU-5hJoViE1YKZa0gxisb4vOY28,712
|
@@ -179,8 +180,8 @@ tests/unit_tests/test_configs/config_device_no_entry.yaml,sha256=hdvue9KLc_kfNzG
|
|
179
180
|
tests/unit_tests/test_configs/config_scan.yaml,sha256=vo484BbWOjA_e-h6bTjSV9k7QaQHrlAvx-z8wtY-P4E,1915
|
180
181
|
tests/unit_tests/test_msgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
181
182
|
tests/unit_tests/test_msgs/available_scans_message.py,sha256=m_z97hIrjHXXMa2Ex-UvsPmTxOYXfjxyJaGkIY6StTY,46532
|
182
|
-
bec_widgets-0.
|
183
|
-
bec_widgets-0.
|
184
|
-
bec_widgets-0.
|
185
|
-
bec_widgets-0.
|
186
|
-
bec_widgets-0.
|
183
|
+
bec_widgets-0.66.0.dist-info/METADATA,sha256=zGYdWrGWioZkJQL84cTkSoYLziwjhiDoVOCpJ2wCdL0,1302
|
184
|
+
bec_widgets-0.66.0.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
|
185
|
+
bec_widgets-0.66.0.dist-info/entry_points.txt,sha256=OvoqiNzNF9bizFQNhbAmmdc_njHrnVewLE-Kl-u9sh0,115
|
186
|
+
bec_widgets-0.66.0.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
187
|
+
bec_widgets-0.66.0.dist-info/RECORD,,
|
pyproject.toml
CHANGED
File without changes
|
File without changes
|
File without changes
|