bec-widgets 0.94.2__py3-none-any.whl → 0.94.4__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 CHANGED
@@ -1,5 +1,29 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v0.94.4 (2024-08-14)
4
+
5
+ ### Documentation
6
+
7
+ * docs: review developer section; add introduction ([`2af5c94`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2af5c94913a3435c1839034df4f45f885b56d08b))
8
+
9
+ ### Fix
10
+
11
+ * fix: do not shutdown client in "close"
12
+
13
+ Terminating client connections has to be done at the application level ([`198c1d1`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/198c1d1064cc2dae55de4b941929341faddacb28))
14
+
15
+ ## v0.94.3 (2024-08-13)
16
+
17
+ ### Fix
18
+
19
+ * fix(curve_dialog): async curves are shown in curve dialog after addition. ([`7aeb2b5`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/7aeb2b5c26c7c2851e8d663d32521da8daec95ef))
20
+
21
+ * fix(waveform): async device entry is correctly passed, updated and with new scan the previous data are cleared ([`d56ea95`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/d56ea95ef97bfdd0bc3eeddc4505d20b38e28559))
22
+
23
+ ### Test
24
+
25
+ * test(waveform_widget): added tests for axis setting and curve dialog ([`f285b35`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f285b35b491660549e74349318119f7c2c44f619))
26
+
3
27
  ## v0.94.2 (2024-08-13)
4
28
 
5
29
  ### Fix
@@ -129,21 +153,3 @@ This reverts commit fd6ae91993a23a7b8dbb2cf3c4b7c3eda6d2b0f6 ([`5aad401`](https:
129
153
  * fix(widgets): fixed import for tictactoe example ([`995a795`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/995a795060bebe25c17108d80ae0fa30463f03b1))
130
154
 
131
155
  ## v0.92.1 (2024-07-28)
132
-
133
- ### Build
134
-
135
- * build(ci): install ophyd_devices in editable mode for pipelines ([`06205e0`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/06205e07903d93accf40abab153f440059f236ed))
136
-
137
- ### Fix
138
-
139
- * fix: use SafeSlot instead of Slot ([`bc1e239`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/bc1e23944cc0e5a861e3d0b4dc5b4ac6292d5269))
140
-
141
- * fix: linting ([`a3fe205`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a3fe20500ae2ac03dcde07432f7e21ce5262ce46))
142
-
143
- * fix: always add a QApplication for tests ([`61a4e32`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/61a4e32deb337ed27f2f43358b88b7266413b58e))
144
-
145
- * fix: add xvfb to draw offscreen ([`3d681f7`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3d681f77e144e74138fc5fa65630004d7c166878))
146
-
147
- * fix: reset ErrorPopup singleton between tests ([`5a9ccfd`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/5a9ccfd1f6d2aacd5d86c1a34f74163b272d1ae4))
148
-
149
- * fix: metaclass + QObject segfaults PyQt(cpp bindings) ([`fc57b7a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/fc57b7a1262031a2df9e6a99493db87e766b779a))
PKG-INFO CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.94.2
3
+ Version: 0.94.4
4
4
  Summary: BEC Widgets
5
5
  Project-URL: Bug Tracker, https://gitlab.psi.ch/bec/bec_widgets/issues
6
6
  Project-URL: Homepage, https://gitlab.psi.ch/bec/bec_widgets
@@ -46,6 +46,7 @@ class JupyterConsoleWindow(QWidget): # pragma: no cover:
46
46
  "w7": self.w7,
47
47
  "w8": self.w8,
48
48
  "w9": self.w9,
49
+ "w10": self.w10,
49
50
  "d0": self.d0,
50
51
  "d1": self.d1,
51
52
  "d2": self.d2,
@@ -943,7 +943,9 @@ class BECWaveform(BECPlotBase):
943
943
  self.setup_dap(self.old_scan_id, self.scan_id)
944
944
  if self._curves_data["async"]:
945
945
  for curve_id, curve in self._curves_data["async"].items():
946
- self.setup_async(curve.config.signals.y.name)
946
+ self.setup_async(
947
+ name=curve.config.signals.y.name, entry=curve.config.signals.y.entry
948
+ )
947
949
 
948
950
  @Slot(dict, dict)
949
951
  def on_scan_segment(self, msg: dict, metadata: dict):
@@ -1005,18 +1007,18 @@ class BECWaveform(BECPlotBase):
1005
1007
  )
1006
1008
 
1007
1009
  @Slot(str)
1008
- def setup_async(self, device: str):
1010
+ def setup_async(self, name: str, entry: str):
1009
1011
  self.bec_dispatcher.disconnect_slot(
1010
- self.on_async_readback, MessageEndpoints.device_async_readback(self.old_scan_id, device)
1012
+ self.on_async_readback, MessageEndpoints.device_async_readback(self.old_scan_id, name)
1011
1013
  )
1012
1014
  try:
1013
- self._curves_data["async"][f"{device}-{device}"].clear_data()
1015
+ self._curves_data["async"][f"{name}-{entry}"].clear_data()
1014
1016
  except KeyError:
1015
1017
  pass
1016
1018
  if len(self._curves_data["async"]) > 0:
1017
1019
  self.bec_dispatcher.connect_slot(
1018
1020
  self.on_async_readback,
1019
- MessageEndpoints.device_async_readback(self.scan_id, device),
1021
+ MessageEndpoints.device_async_readback(self.scan_id, name),
1020
1022
  from_start=True,
1021
1023
  )
1022
1024
 
@@ -457,7 +457,6 @@ class BECImageWidget(BECWidget, QWidget):
457
457
 
458
458
  def cleanup(self):
459
459
  self.fig.cleanup()
460
- self.client.shutdown()
461
460
  self.toolbar.close()
462
461
  self.toolbar.deleteLater()
463
462
  return super().cleanup()
@@ -63,8 +63,6 @@ class BECJupyterConsole(RichJupyterWidget): # pragma: no cover:
63
63
 
64
64
  def closeEvent(self, event):
65
65
  self.shutdown_kernel()
66
- if self.client:
67
- self.client.shutdown()
68
66
 
69
67
 
70
68
  if __name__ == "__main__": # pragma: no cover
@@ -58,16 +58,17 @@ class CurveSettings(SettingWidget):
58
58
  self.ui.color_map_selector_scan.combo.setCurrentText(cm)
59
59
 
60
60
  # Scan Curve Table
61
- for label, curve in config["scan_segment"].items():
62
- row_count = self.ui.scan_table.rowCount()
63
- self.ui.scan_table.insertRow(row_count)
64
- DialogRow(
65
- parent=self,
66
- table_widget=self.ui.scan_table,
67
- client=self.target_widget.client,
68
- row=row_count,
69
- config=curve.config,
70
- ).add_scan_row()
61
+ for source in ["scan_segment", "async"]:
62
+ for label, curve in config[source].items():
63
+ row_count = self.ui.scan_table.rowCount()
64
+ self.ui.scan_table.insertRow(row_count)
65
+ DialogRow(
66
+ parent=self,
67
+ table_widget=self.ui.scan_table,
68
+ client=self.target_widget.client,
69
+ row=row_count,
70
+ config=curve.config,
71
+ ).add_scan_row()
71
72
 
72
73
  # Add DAP Curves
73
74
  for label, curve in config["DAP"].items():
@@ -132,11 +133,12 @@ class CurveSettings(SettingWidget):
132
133
  self.accept_curve_changes()
133
134
 
134
135
  def accept_curve_changes(self):
135
- old_curves_scans = list(self.target_widget.waveform._curves_data["scan_segment"].values())
136
- old_curves_dap = list(self.target_widget.waveform._curves_data["DAP"].values())
137
- for curve in old_curves_scans:
138
- curve.remove()
139
- for curve in old_curves_dap:
136
+ sources = ["scan_segment", "async", "DAP"]
137
+ old_curves = []
138
+
139
+ for source in sources:
140
+ old_curves += list(self.target_widget.waveform._curves_data[source].values())
141
+ for curve in old_curves:
140
142
  curve.remove()
141
143
  self.get_curve_params()
142
144
 
@@ -561,7 +561,6 @@ class BECWaveformWidget(BECWidget, QWidget):
561
561
 
562
562
  def cleanup(self):
563
563
  self.fig.cleanup()
564
- self.client.shutdown()
565
564
  return super().cleanup()
566
565
 
567
566
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.94.2
3
+ Version: 0.94.4
4
4
  Summary: BEC Widgets
5
5
  Project-URL: Bug Tracker, https://gitlab.psi.ch/bec/bec_widgets/issues
6
6
  Project-URL: Homepage, https://gitlab.psi.ch/bec/bec_widgets
@@ -2,11 +2,11 @@
2
2
  .gitlab-ci.yml,sha256=BtKhZI3dhK09En1BfpglYi-ZJwG6ZdC-iJr7kXFVfCg,8346
3
3
  .pylintrc,sha256=eeY8YwSI74oFfq6IYIbCqnx3Vk8ZncKaatv96n_Y8Rs,18544
4
4
  .readthedocs.yaml,sha256=aSOc277LqXcsTI6lgvm_JY80lMlr69GbPKgivua2cS0,603
5
- CHANGELOG.md,sha256=AIRugJUd4Xfa1kLlZjS-fusom9MqeLaedm5gvCf5Mrg,6460
5
+ CHANGELOG.md,sha256=ZgJSqE7XIvqpjlDINU3jRRCwL5__8y6FOftSs8VgNNs,6463
6
6
  LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
7
- PKG-INFO,sha256=YQCZe2dGXb5ldFsUtd4xjktxqbR5iMSctbZp1j4M1F0,1307
7
+ PKG-INFO,sha256=Fr6w7cyPHrpWO62J-UES9e5wuB2OKrOMWOKshp4VYCM,1307
8
8
  README.md,sha256=Od69x-RS85Hph0-WwWACwal4yUd67XkEn4APEfHhHFw,2649
9
- pyproject.toml,sha256=SNoDaQvOhh_FOEYgsPR_cnJIO-yWIilEjcZYEy4ksSE,2356
9
+ pyproject.toml,sha256=wDEM1QP9Ii5M219IXkmWm2WSgs7BSJ-Wq3qtwQbFt9s,2356
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
@@ -94,7 +94,7 @@ bec_widgets/examples/general_app/general_app.py,sha256=Ks9CKtIQIFOzKosh204zVg1lt
94
94
  bec_widgets/examples/general_app/general_app.ui,sha256=TsejkM3Z8znnixyqxoj4SwhIIpIzTAuGAMkGXSS1aT8,10479
95
95
  bec_widgets/examples/general_app/web_links.py,sha256=d5OgzgI9zb-NAC0pOGanOtJX3nZoe4x8QuQTw-_hK_8,434
96
96
  bec_widgets/examples/jupyter_console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
97
- bec_widgets/examples/jupyter_console/jupyter_console_window.py,sha256=zzeSE4SS-B6p7LTqS91oGbEmYEtEQHewndVscJywL8I,6766
97
+ bec_widgets/examples/jupyter_console/jupyter_console_window.py,sha256=2PDhUevxU5YlZcoVokH5fgGdwFGIQFSN8x0DChhxoxE,6803
98
98
  bec_widgets/examples/plugin_example_pyside/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
99
99
  bec_widgets/examples/plugin_example_pyside/main.py,sha256=zDP5wO7wb3BVsQ15HOCRT1nNmCujIVRvSXZ3Txje8L0,549
100
100
  bec_widgets/examples/plugin_example_pyside/registertictactoe.py,sha256=cVhBnP0qx5j9Jft-VeKvlTFE-bX58hbP45CX0f4r5pM,535
@@ -182,15 +182,15 @@ bec_widgets/widgets/figure/plots/image/image_processor.py,sha256=GeTtWjbldy6VejM
182
182
  bec_widgets/widgets/figure/plots/motor_map/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
183
183
  bec_widgets/widgets/figure/plots/motor_map/motor_map.py,sha256=wgARzsm98Y8SHPPwVp1LzNlXCxKEi6a8by8yYzIWsbY,18319
184
184
  bec_widgets/widgets/figure/plots/waveform/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
185
- bec_widgets/widgets/figure/plots/waveform/waveform.py,sha256=EjKwD_pOhZYmXU2M_LdIv9A9cbVYxR1Y9lH0tbMNuJE,51710
185
+ bec_widgets/widgets/figure/plots/waveform/waveform.py,sha256=-op62_CFX1Gu-Ag6CD5d3ylEDqu_ieTbfoTUF2zf7T8,51800
186
186
  bec_widgets/widgets/figure/plots/waveform/waveform_curve.py,sha256=ZwRxSfPHbMWEvgUC-mL2orpZvtxR-DcrYAFikkdWEzk,8654
187
187
  bec_widgets/widgets/image/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
188
188
  bec_widgets/widgets/image/bec_image_widget.pyproject,sha256=PHisdBo5_5UCApd27GkizzqgfdjsDx2bFZa_p9LiSW8,30
189
189
  bec_widgets/widgets/image/bec_image_widget_plugin.py,sha256=B7whBMsoQ85MyCR_C6YHBl2s1T7odOJJYeiHaLXzmcM,1387
190
- bec_widgets/widgets/image/image_widget.py,sha256=csPtl48uZgSlyomxG68bFJX929Y2WOvgv5risWQuXFI,16319
190
+ bec_widgets/widgets/image/image_widget.py,sha256=TCpTF8v94iSMklG9bYxZOjm9SbO60XZB9X0ldEp8lWE,16288
191
191
  bec_widgets/widgets/image/register_bec_image_widget.py,sha256=01YLZQTMSSIXvH1TSL-1AYsRs1a4EbSwKLVAwh9AjeA,478
192
192
  bec_widgets/widgets/jupyter_console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
193
- bec_widgets/widgets/jupyter_console/jupyter_console.py,sha256=mBKM89H6SuHuFy1lQg1n8s1gQiN5QEkZf0xua8aPDns,2402
193
+ bec_widgets/widgets/jupyter_console/jupyter_console.py,sha256=-e7HQOECeH5eDrJYh4BFIzRL78LDkooU4otabyN0aX4,2343
194
194
  bec_widgets/widgets/motor_map/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
195
195
  bec_widgets/widgets/motor_map/bec_motor_map_widget.pyproject,sha256=NAI8s5gRKz80ED4KY7OgD2OgSH5HEsjt2ux2BYp66yg,63
196
196
  bec_widgets/widgets/motor_map/bec_motor_map_widget_plugin.py,sha256=V6iN82E8Za8BharR_cSyZZShh4fI9yc5ky2TQBGELR0,1316
@@ -256,10 +256,10 @@ bec_widgets/widgets/waveform/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
256
256
  bec_widgets/widgets/waveform/bec_waveform_widget.pyproject,sha256=GLD8GN9dXx9wNbtnevrxqqcwk7vKV-Uv8QYSycdaoaI,33
257
257
  bec_widgets/widgets/waveform/bec_waveform_widget_plugin.py,sha256=D9q3wdBPB5x0iCzyYDo1qdSXzySXdRIc1d5oD3Gv5gY,1420
258
258
  bec_widgets/widgets/waveform/register_bec_waveform_widget.py,sha256=qZHVZH_lP2hvzkG1Ra0EyrXlMeLkRCy0aceH-bfJ1cs,490
259
- bec_widgets/widgets/waveform/waveform_widget.py,sha256=zErnkgwm69QZEVvNRLi57v9-zRQeu0IaJpYRj34mGmA,19125
259
+ bec_widgets/widgets/waveform/waveform_widget.py,sha256=4aHwkLdn7C8BgvKqFIbOB0YaAxAIIFTG_hG0iLougKQ,19094
260
260
  bec_widgets/widgets/waveform/waveform_popups/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
261
261
  bec_widgets/widgets/waveform/waveform_popups/curve_dialog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
262
- bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.py,sha256=jCtWjNxsdOW7fA9BLdMAMrlCKHr2tFMHcVMxpeJ6YZE,13107
262
+ bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.py,sha256=S1j44i1xxJtmCcNtbOsxF8XdklMPsG9t4-1DZ2YfOPw,13128
263
263
  bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.ui,sha256=OaQE5HlyBQ3RQoHqxOFHiUoNcx8SDZP5sHJ9NNGhsPI,10404
264
264
  bec_widgets/widgets/waveform/waveform_popups/dap_summary_dialog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
265
265
  bec_widgets/widgets/waveform/waveform_popups/dap_summary_dialog/dap_summary.ui,sha256=PFEKro61UXd-jmx65U4pqJ5D29DXtVnhQRnsnDvN-wM,6138
@@ -285,10 +285,11 @@ docs/assets/index_contribute.svg,sha256=OCjvYBw_JhcY_D5Zd7f1MctQvq1YNalYlqPNwB1X
285
285
  docs/assets/index_getting_started.svg,sha256=Www1OXmauYlouZD51AR6-VG2vxrEig8-jjuDPhzkNxc,3977
286
286
  docs/assets/index_user_guide.svg,sha256=sRjKwOHVJStBYIQUFVcnfmbeXd2qAp0HYjleSp66XCI,6429
287
287
  docs/assets/rocket_launch_48dp.svg,sha256=pdrPrBcKWUa5OlgWKM0B6TA6qAW7E57d7C7YW2r1OT8,1070
288
- docs/developer/developer.md,sha256=VUdMnQBsSRCawYMFCe0vya5oj1MimLML7Pd58kY6fYY,765
289
- docs/developer/getting_started/development.md,sha256=aYLmuLMYpp5FcIXeDUqCfcStIV8veuiMBjOt5bTW_30,1406
290
- docs/developer/getting_started/getting_started.md,sha256=My_K_6O7LLaXVB_eINrRku5o-jVx95lsmGgHxgZhT7A,378
291
- docs/developer/widgets/widgets.md,sha256=aNsJgG7R-3EerumNB6GH84JLIXfZqGN5GjvpKWDi0Hk,504
288
+ docs/developer/developer.md,sha256=LUbV1dnVI9r8FhsL2htKRqrGZDGkFXA-jo5TJfXz4OI,1099
289
+ docs/developer/introduction/concepts.md,sha256=N23ewZjPx97eJtrU6-0Lou2IvPfkfZ6Nw6n9SwASQ74,1721
290
+ docs/developer/introduction/contributing.md,sha256=ocW5kjBNwD5k_nDkusXUpsW8jJALajrpNSRVJftuF-k,1668
291
+ docs/developer/introduction/introduction.md,sha256=860Sw05t1RGW13IUlM5bJwK8DckYhSABPKZykgmwcpA,774
292
+ docs/developer/widget_development/widget_development.md,sha256=wGfDjbt9EonVxUg59keADy7wCLyS-KzCz7m4hY0OV_A,526
292
293
  docs/introduction/introduction.md,sha256=YBEFDhxqHTcbfbNTo76xDflaFUHIqDs-sToA1HRmCnI,1436
293
294
  docs/user/customisation.md,sha256=wCW8fAbqtlgGE3mURvXOrK67Xo0_B-lxfg0sYuQWB40,3186
294
295
  docs/user/user.md,sha256=uCTcjclIi6rdjYRQebko6bWFEVsjyfshsVU3BDYrC-Y,1403
@@ -367,7 +368,7 @@ tests/unit_tests/test_text_box_widget.py,sha256=OhHy5gu_XgWU2WvcO5ZcGbZcc-tiE-lZ
367
368
  tests/unit_tests/test_toggle.py,sha256=Amzgres7te0tTQIDR2WMKSx9Kce44TxMpIPR6HZygXQ,832
368
369
  tests/unit_tests/test_vscode_widget.py,sha256=BOepZuDzbATK7_yy4wJEkVbz5VWSwVBj9__uxJ5vpM0,2748
369
370
  tests/unit_tests/test_waveform1d.py,sha256=AOfpHvebsEVb-MNf8Shh2bAML5bandtvoXkYqKWe8qc,24470
370
- tests/unit_tests/test_waveform_widget.py,sha256=1FJMo6dDptVk-_Sq4dAhBza4HYe5w6fLQfsOvzWkueg,8573
371
+ tests/unit_tests/test_waveform_widget.py,sha256=EcJim-T6rcMKChleSnolNhXh6AIeIpYyFTsbLl4TmEY,16728
371
372
  tests/unit_tests/test_website_widget.py,sha256=POcHK4INck3quasMD14DBlBBJWD0uKJbkOMt_JsPhXA,708
372
373
  tests/unit_tests/test_widget_io.py,sha256=FeL3ZYSBQnRt6jxj8VGYw1cmcicRQyHKleahw7XIyR0,3475
373
374
  tests/unit_tests/test_yaml_dialog.py,sha256=SEvUgC_poWC6fAoHVWolaORpgMFc7c0Xqqk9cFvHSvo,5826
@@ -376,8 +377,8 @@ tests/unit_tests/test_configs/config_device_no_entry.yaml,sha256=hdvue9KLc_kfNzG
376
377
  tests/unit_tests/test_configs/config_scan.yaml,sha256=vo484BbWOjA_e-h6bTjSV9k7QaQHrlAvx-z8wtY-P4E,1915
377
378
  tests/unit_tests/test_msgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
378
379
  tests/unit_tests/test_msgs/available_scans_message.py,sha256=m_z97hIrjHXXMa2Ex-UvsPmTxOYXfjxyJaGkIY6StTY,46532
379
- bec_widgets-0.94.2.dist-info/METADATA,sha256=YQCZe2dGXb5ldFsUtd4xjktxqbR5iMSctbZp1j4M1F0,1307
380
- bec_widgets-0.94.2.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
381
- bec_widgets-0.94.2.dist-info/entry_points.txt,sha256=3otEkCdDB9LZJuBLzG4pFLK5Di0CVybN_12IsZrQ-58,166
382
- bec_widgets-0.94.2.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
383
- bec_widgets-0.94.2.dist-info/RECORD,,
380
+ bec_widgets-0.94.4.dist-info/METADATA,sha256=Fr6w7cyPHrpWO62J-UES9e5wuB2OKrOMWOKshp4VYCM,1307
381
+ bec_widgets-0.94.4.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
382
+ bec_widgets-0.94.4.dist-info/entry_points.txt,sha256=3otEkCdDB9LZJuBLzG4pFLK5Di0CVybN_12IsZrQ-58,166
383
+ bec_widgets-0.94.4.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
384
+ bec_widgets-0.94.4.dist-info/RECORD,,
@@ -1,7 +1,9 @@
1
1
  (developer)=
2
2
  # Developer
3
3
 
4
- Welcome to the BEC Widgets developer guide! This section is intended for developers who want to contribute to the development of BEC Widgets.
4
+ Welcome to the BEC Widgets developer guide! BEC Widgets is a framework for building graphical user interfaces (GUIs) for [BEC](https://bec.readthedocs.io/en/latest/), a Python package for beamline experiment control.
5
+
6
+ This guide targets readers who want to develop new widgets or extend existing ones. If your goal is to use BEC Widgets to build GUIs for your experiments, please refer to the [user guide](#user).
5
7
 
6
8
  ```{toctree}
7
9
  ---
@@ -9,8 +11,8 @@ maxdepth: 2
9
11
  hidden: true
10
12
  ---
11
13
 
12
- getting_started/getting_started.md
13
- widgets/widgets.md
14
+ introduction/introduction.md
15
+ widget_development/widget_development.md
14
16
  api_reference/api_reference.md
15
17
  ```
16
18
 
@@ -21,26 +23,28 @@ api_reference/api_reference.md
21
23
  :gutter: 5
22
24
 
23
25
  ```{grid-item-card}
24
- :link: developer.getting_started
26
+ :link: developer.introduction
25
27
  :link-type: ref
26
28
  :img-top: /assets/rocket_launch_48dp.svg
27
29
  :text-align: center
28
30
 
29
- ## Getting Started
31
+ ## Introduction
30
32
 
31
- Learn how to install BEC Widgets and get started with the framework.
33
+ An introduction into the single-resposibility principle and the modular design of BEC Widgets.
32
34
  ```
33
35
 
34
36
  ```{grid-item-card}
35
- :link: developer.widgets
37
+ :link: developer.widget_development
36
38
  :link-type: ref
37
39
  :img-top: /assets/apps_48dp.svg
38
40
  :text-align: center
39
41
 
40
- ## Widgets
42
+ ## Widget Development
41
43
 
42
- Learn about the building blocks of larger applications: widgets.
44
+ Learn how to develop a new modular widget for BEC Widgets.
43
45
  ```
44
- ````
46
+
47
+ ````{grid} 2
48
+
45
49
 
46
50
 
@@ -0,0 +1,14 @@
1
+ (developer.concepts)=
2
+ # Concepts
3
+ This section provides an overview of the core concepts of BEC Widgets, which are based on the single-responsibility principle and modular design.
4
+
5
+ ## Moduler Design
6
+ We develop widgets with the single-responsibility principle in mind, meaning each widget is designed for a specific task. Our goal is to keep widgets simple, using them primarily for visualization or to initiate actions within BEC. Following these ideas, widgets should be designed to be reusable in various applications, making them versatile building blocks for larger GUIs.
7
+
8
+ We offer up to three different options for composing larger GUIs from these modular widgets: BECDesigner, DockArea widget, or scripting from the command line interface. More information about these options can be found in the user sections on [applications](user.applications).
9
+
10
+ ## Client-Server Architecture
11
+
12
+ BEC Widgets is built on top of the [BEC](https://bec.readthedocs.io/en/latest/) package, which provides the backend for beamline experiment control. BEC Widgets is a client of BEC, meaning it can interact with the backend through a client-server architecture. To make full usage of the available features of BEC, we recommend to check the documentation about [data access](https://bec.readthedocs.io/en/latest/developer/data_access/data_access.html) in which the messaging and event system of BEC is described.
13
+ In the context of BEC Widgets, the [`BECDispatcher`](/api_reference/_autosummary/bec_widgets.utils.bec_dispatcher.BECDispatcher) connects to this messaging and event system, allowing you to link your Qt [`Slots`](https://www.pythonguis.com/tutorials/pyside6-signals-slots-events/) to messages and event received from BEC.
14
+
@@ -1,5 +1,5 @@
1
- (developer.development)=
2
- # Development
1
+ (developer.contributing)=
2
+ # Contributing
3
3
 
4
4
  If you like to contribute to the development of BEC Widgets, you can follow the steps below to set up your development environment.
5
5
  BEC Widgets works in conjunction with [BEC](https://bec.readthedocs.io/en/latest/).
@@ -10,6 +10,7 @@ If you already have a BEC environment set up, you can install BEC Widgets in edi
10
10
  **Prerequisites**
11
11
  1. **Python Version:** BEC Widgets requires Python version 3.10 or higher. Verify your Python version to ensure compatibility.
12
12
  2. **BEC Installation:** BEC Widgets works in conjunction with BEC. While BEC is a dependency and will be installed automatically, you can find more information about BEC and its installation process in the [BEC documentation](https://beamline-experiment-control.readthedocs.io/en/latest/).
13
+ 3. **Qt Distributions:** BEC Widgets supports [PySide6](https://doc.qt.io/qtforpython-6/quickstart.html) and [PyQt6](https://www.riverbankcomputing.com/static/Docs/PyQt6/introduction.html). We use [qtpy](https://pypi.org/project/QtPy/) to abstract the underlying QT distribution.
13
14
 
14
15
  **Clone the Repository**:
15
16
  ```bash
@@ -20,8 +21,8 @@ cd bec_widgets
20
21
 
21
22
  Please install the package in editable mode into your BEC Python environemnt.
22
23
  ```bash
23
- pip install -e '.[dev,pyqt6]'
24
+ pip install -e '.[dev,pyside6]'
24
25
  ```
25
- This installs the package together with [PyQT6](https://www.riverbankcomputing.com/static/Docs/PyQt6/introduction.html).
26
+ This installs the package together with [PySide6](https://doc.qt.io/qtforpython-6/quickstart.html).
26
27
 
27
28
 
@@ -0,0 +1,15 @@
1
+ (developer.introduction)=
2
+ # Introduction
3
+ BEC Widgets is a framework providing modular components that can be integrated into various larger GUI applications. Each widget serves a specific purpose adhering to the single-responsibility principle as detailed in our [concepts section](developer.concepts), and offers a straightforward, user-friendly interface.
4
+ These widgets provide data visualisation tools and experimental control interfaces by triggering actions within BEC.
5
+ If you're interested in contributing to BEC Widgets, please refer to our [contributing guide](developer.contributing), which provides instructions for setting up your development environment and creating your own widgets.
6
+
7
+ ```{toctree}
8
+ ---
9
+ maxdepth: 2
10
+ hidden: false
11
+ ---
12
+
13
+ concepts/
14
+ contributing/
15
+ ```
@@ -1,5 +1,5 @@
1
- (developer.widgets)=
2
- # Widgets
1
+ (developer.widget_development)=
2
+ # Widget development
3
3
  This section provides an introduction to the building blocks of BEC Widgets: widgets. Widgets are the basic components of the graphical user interface (GUI) and are used to create larger applications. We will cover key topics such as how to develop new widgets or how to customise existing widgets. For details on the already available widgets and their usage, please refer to user section about [widgets](#user.widgets)
4
4
 
5
5
  ```{toctree}
pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "bec_widgets"
7
- version = "0.94.2"
7
+ version = "0.94.4"
8
8
  description = "BEC Widgets"
9
9
  requires-python = ">=3.10"
10
10
  classifiers = [
@@ -3,6 +3,9 @@ from unittest.mock import MagicMock, patch
3
3
  import pyqtgraph as pg
4
4
  import pytest
5
5
 
6
+ from bec_widgets.qt_utils.settings_dialog import SettingsDialog
7
+ from bec_widgets.widgets.figure.plots.axis_settings import AxisSettings
8
+ from bec_widgets.widgets.waveform.waveform_popups.curve_dialog.curve_dialog import CurveSettings
6
9
  from bec_widgets.widgets.waveform.waveform_widget import BECWaveformWidget
7
10
 
8
11
  from .client_mocks import mocked_client
@@ -261,3 +264,199 @@ def test_enable_mouse_pan_mode(qtbot, waveform_widget):
261
264
  assert action_drag.isChecked() == True
262
265
  assert action_rectangle.isChecked() == False
263
266
  mock_view_box.setMouseMode.assert_called_once_with(pg.ViewBox.PanMode)
267
+
268
+
269
+ ###################################
270
+ # Curve Dialog Tests
271
+ ###################################
272
+ def show_curve_dialog(qtbot, waveform_widget):
273
+ curve_dialog = SettingsDialog(
274
+ waveform_widget,
275
+ settings_widget=CurveSettings(),
276
+ window_title="Curve Settings",
277
+ config=waveform_widget.waveform._curves_data,
278
+ )
279
+ qtbot.addWidget(curve_dialog)
280
+ qtbot.waitExposed(curve_dialog)
281
+ return curve_dialog
282
+
283
+
284
+ def test_curve_dialog_scan_curves_interactions(qtbot, waveform_widget):
285
+ waveform_widget.plot(y_name="bpm4i")
286
+ waveform_widget.plot(y_name="bpm3a")
287
+
288
+ curve_dialog = show_curve_dialog(qtbot, waveform_widget)
289
+
290
+ # Check default display of config from waveform widget
291
+ assert curve_dialog is not None
292
+ assert curve_dialog.widget.ui.scan_table.rowCount() == 2
293
+ assert curve_dialog.widget.ui.scan_table.cellWidget(0, 0).text() == "bpm4i"
294
+ assert curve_dialog.widget.ui.scan_table.cellWidget(0, 1).text() == "bpm4i"
295
+ assert curve_dialog.widget.ui.scan_table.cellWidget(1, 0).text() == "bpm3a"
296
+ assert curve_dialog.widget.ui.scan_table.cellWidget(1, 1).text() == "bpm3a"
297
+ assert curve_dialog.widget.ui.x_mode.currentText() == "best_effort"
298
+ assert curve_dialog.widget.ui.x_name.isEnabled() == False
299
+ assert curve_dialog.widget.ui.x_entry.isEnabled() == False
300
+
301
+ # Add a new curve
302
+ curve_dialog.widget.ui.add_curve.click()
303
+ qtbot.wait(200)
304
+ assert curve_dialog.widget.ui.scan_table.rowCount() == 3
305
+
306
+ # Set device to new curve
307
+ curve_dialog.widget.ui.scan_table.cellWidget(2, 0).setText("bpm3i")
308
+
309
+ # Change the x mode to device
310
+ curve_dialog.widget.ui.x_mode.setCurrentText("device")
311
+ qtbot.wait(200)
312
+ assert curve_dialog.widget.ui.x_name.isEnabled() == True
313
+ assert curve_dialog.widget.ui.x_entry.isEnabled() == True
314
+
315
+ # Set the x device
316
+ curve_dialog.widget.ui.x_name.setText("samx")
317
+
318
+ # Delete first curve ('bpm4i')
319
+ curve_dialog.widget.ui.scan_table.cellWidget(0, 6).click()
320
+ qtbot.wait(200)
321
+ assert curve_dialog.widget.ui.scan_table.rowCount() == 2
322
+ assert curve_dialog.widget.ui.scan_table.cellWidget(0, 0).text() == "bpm3a"
323
+ assert curve_dialog.widget.ui.scan_table.cellWidget(0, 1).text() == "bpm3a"
324
+ assert curve_dialog.widget.ui.scan_table.cellWidget(1, 0).text() == "bpm3i"
325
+
326
+ # Close the dialog
327
+ curve_dialog.accept()
328
+ qtbot.wait(200)
329
+
330
+ # Check the curve data in the target widget
331
+ assert list(waveform_widget.waveform._curves_data["scan_segment"].keys()) == [
332
+ "bpm3a-bpm3a",
333
+ "bpm3i-bpm3i",
334
+ ]
335
+ assert len(waveform_widget.curves) == 2
336
+
337
+
338
+ def test_curve_dialog_async(qtbot, waveform_widget):
339
+ waveform_widget.plot(y_name="bpm4i")
340
+ waveform_widget.plot(y_name="async_device")
341
+
342
+ curve_dialog = show_curve_dialog(qtbot, waveform_widget)
343
+
344
+ assert curve_dialog is not None
345
+ assert curve_dialog.widget.ui.scan_table.rowCount() == 2
346
+ assert curve_dialog.widget.ui.scan_table.cellWidget(0, 0).text() == "bpm4i"
347
+ assert curve_dialog.widget.ui.scan_table.cellWidget(0, 1).text() == "bpm4i"
348
+ assert curve_dialog.widget.ui.scan_table.cellWidget(1, 0).text() == "async_device"
349
+ assert curve_dialog.widget.ui.scan_table.cellWidget(1, 1).text() == "async_device"
350
+
351
+
352
+ def test_curve_dialog_dap(qtbot, waveform_widget):
353
+ waveform_widget.plot(x_name="samx", y_name="bpm4i", dap="GaussianModel")
354
+
355
+ curve_dialog = show_curve_dialog(qtbot, waveform_widget)
356
+
357
+ assert curve_dialog is not None
358
+ assert curve_dialog.widget.ui.scan_table.rowCount() == 1
359
+ assert curve_dialog.widget.ui.scan_table.cellWidget(0, 0).text() == "bpm4i"
360
+ assert curve_dialog.widget.ui.scan_table.cellWidget(0, 1).text() == "bpm4i"
361
+ assert curve_dialog.widget.ui.dap_table.isEnabled() == True
362
+ assert curve_dialog.widget.ui.dap_table.rowCount() == 1
363
+ assert curve_dialog.widget.ui.dap_table.cellWidget(0, 0).text() == "bpm4i"
364
+ assert curve_dialog.widget.ui.dap_table.cellWidget(0, 1).text() == "bpm4i"
365
+ assert curve_dialog.widget.ui.x_mode.currentText() == "device"
366
+ assert curve_dialog.widget.ui.x_name.isEnabled() == True
367
+ assert curve_dialog.widget.ui.x_entry.isEnabled() == True
368
+ assert curve_dialog.widget.ui.x_name.text() == "samx"
369
+ assert curve_dialog.widget.ui.x_entry.text() == "samx"
370
+
371
+ curve_dialog.accept()
372
+ qtbot.wait(200)
373
+
374
+ assert list(waveform_widget.waveform._curves_data["scan_segment"].keys()) == ["bpm4i-bpm4i"]
375
+ assert len(waveform_widget.curves) == 2
376
+
377
+
378
+ ###################################
379
+ # Axis Dialog Tests
380
+ ###################################
381
+
382
+
383
+ def show_axis_dialog(qtbot, waveform_widget):
384
+ axis_dialog = SettingsDialog(
385
+ waveform_widget,
386
+ settings_widget=AxisSettings(),
387
+ window_title="Axis Settings",
388
+ config=waveform_widget._config_dict["axis"],
389
+ )
390
+ qtbot.addWidget(axis_dialog)
391
+ qtbot.waitExposed(axis_dialog)
392
+ return axis_dialog
393
+
394
+
395
+ def test_axis_dialog_with_axis_limits(qtbot, waveform_widget):
396
+ waveform_widget.set(
397
+ title="Test Title",
398
+ x_label="X Label",
399
+ y_label="Y Label",
400
+ x_scale="linear",
401
+ y_scale="log",
402
+ x_lim=(0, 10),
403
+ y_lim=(0, 10),
404
+ )
405
+
406
+ axis_dialog = show_axis_dialog(qtbot, waveform_widget)
407
+
408
+ assert axis_dialog is not None
409
+ assert axis_dialog.widget.ui.plot_title.text() == "Test Title"
410
+ assert axis_dialog.widget.ui.x_label.text() == "X Label"
411
+ assert axis_dialog.widget.ui.y_label.text() == "Y Label"
412
+ assert axis_dialog.widget.ui.x_scale.currentText() == "linear"
413
+ assert axis_dialog.widget.ui.y_scale.currentText() == "log"
414
+ assert axis_dialog.widget.ui.x_min.value() == 0
415
+ assert axis_dialog.widget.ui.x_max.value() == 10
416
+ assert axis_dialog.widget.ui.y_min.value() == 0
417
+ assert axis_dialog.widget.ui.y_max.value() == 10
418
+
419
+
420
+ def test_axis_dialog_without_axis_limits(qtbot, waveform_widget):
421
+ waveform_widget.set(
422
+ title="Test Title", x_label="X Label", y_label="Y Label", x_scale="linear", y_scale="log"
423
+ )
424
+ x_range = waveform_widget.fig.widget_list[0].plot_item.viewRange()[0]
425
+ y_range = waveform_widget.fig.widget_list[0].plot_item.viewRange()[1]
426
+
427
+ axis_dialog = show_axis_dialog(qtbot, waveform_widget)
428
+
429
+ assert axis_dialog is not None
430
+ assert axis_dialog.widget.ui.plot_title.text() == "Test Title"
431
+ assert axis_dialog.widget.ui.x_label.text() == "X Label"
432
+ assert axis_dialog.widget.ui.y_label.text() == "Y Label"
433
+ assert axis_dialog.widget.ui.x_scale.currentText() == "linear"
434
+ assert axis_dialog.widget.ui.y_scale.currentText() == "log"
435
+ assert axis_dialog.widget.ui.x_min.value() == x_range[0]
436
+ assert axis_dialog.widget.ui.x_max.value() == x_range[1]
437
+ assert axis_dialog.widget.ui.y_min.value() == y_range[0]
438
+ assert axis_dialog.widget.ui.y_max.value() == y_range[1]
439
+
440
+
441
+ def test_axis_dialog_set_properties(qtbot, waveform_widget):
442
+ axis_dialog = show_axis_dialog(qtbot, waveform_widget)
443
+
444
+ axis_dialog.widget.ui.plot_title.setText("New Title")
445
+ axis_dialog.widget.ui.x_label.setText("New X Label")
446
+ axis_dialog.widget.ui.y_label.setText("New Y Label")
447
+ axis_dialog.widget.ui.x_scale.setCurrentText("log")
448
+ axis_dialog.widget.ui.y_scale.setCurrentText("linear")
449
+ axis_dialog.widget.ui.x_min.setValue(5)
450
+ axis_dialog.widget.ui.x_max.setValue(15)
451
+ axis_dialog.widget.ui.y_min.setValue(5)
452
+ axis_dialog.widget.ui.y_max.setValue(15)
453
+
454
+ axis_dialog.accept()
455
+
456
+ assert waveform_widget._config_dict["axis"]["title"] == "New Title"
457
+ assert waveform_widget._config_dict["axis"]["x_label"] == "New X Label"
458
+ assert waveform_widget._config_dict["axis"]["y_label"] == "New Y Label"
459
+ assert waveform_widget._config_dict["axis"]["x_scale"] == "log"
460
+ assert waveform_widget._config_dict["axis"]["y_scale"] == "linear"
461
+ assert waveform_widget._config_dict["axis"]["x_lim"] == (5, 15)
462
+ assert waveform_widget._config_dict["axis"]["y_lim"] == (5, 15)
@@ -1,12 +0,0 @@
1
- (developer.getting_started)=
2
- # Getting Started
3
- This section provides valuable information for developers who want to contribute to the development of BEC Widgets. The guide will help you set up the development environment, understand the modular development concept of BEC Widgets, and contribute to the project.
4
-
5
- ```{toctree}
6
- ---
7
- maxdepth: 2
8
- hidden: false
9
- ---
10
-
11
- development/
12
- ```