bec-widgets 0.92.3__py3-none-any.whl → 0.92.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 +6 -6
- PKG-INFO +1 -1
- bec_widgets/widgets/figure/plots/image/image.py +3 -2
- bec_widgets/widgets/figure/plots/motor_map/motor_map.py +3 -2
- {bec_widgets-0.92.3.dist-info → bec_widgets-0.92.4.dist-info}/METADATA +1 -1
- {bec_widgets-0.92.3.dist-info → bec_widgets-0.92.4.dist-info}/RECORD +12 -12
- pyproject.toml +1 -1
- tests/unit_tests/test_bec_image.py +8 -14
- tests/unit_tests/test_bec_motor_map.py +17 -8
- {bec_widgets-0.92.3.dist-info → bec_widgets-0.92.4.dist-info}/WHEEL +0 -0
- {bec_widgets-0.92.3.dist-info → bec_widgets-0.92.4.dist-info}/entry_points.txt +0 -0
- {bec_widgets-0.92.3.dist-info → bec_widgets-0.92.4.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## v0.92.4 (2024-07-31)
|
4
|
+
|
5
|
+
### Fix
|
6
|
+
|
7
|
+
* fix: fix missmatch of signal/slot in image and motormap ([`dcc5fd7`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/dcc5fd71ee9f51767a7b2b1ed6200e89d1ef754c))
|
8
|
+
|
3
9
|
## v0.92.3 (2024-07-28)
|
4
10
|
|
5
11
|
### Fix
|
@@ -130,12 +136,6 @@ This reverts commit 3798714369adf4023f833b7749d2f46a0ec74eee ([`fd6ae91`](https:
|
|
130
136
|
|
131
137
|
## v0.88.0 (2024-07-19)
|
132
138
|
|
133
|
-
### Feature
|
134
|
-
|
135
|
-
* feat(waveform_widget): designer plugin added ([`1f8ef52`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/1f8ef52b606283038052640849094f515a463403))
|
136
|
-
|
137
|
-
* feat(waveform_widget): switch between drag and rectangle mode ([`2be009c`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2be009c6477ba26c5cfb4d827534c5d5eb428999))
|
138
|
-
|
139
139
|
### Fix
|
140
140
|
|
141
141
|
* fix(waveform_widget): plot API unified with BECFigure ([`2c8764a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2c8764a27de89b39b717032b58465e120ec57fbc))
|
PKG-INFO
CHANGED
@@ -500,13 +500,14 @@ class BECImageShow(BECPlotBase):
|
|
500
500
|
self.update_image(device, data)
|
501
501
|
self.update_vrange(device, self.processor.config.stats)
|
502
502
|
|
503
|
-
@Slot(dict)
|
504
|
-
def on_image_update(self, msg: dict):
|
503
|
+
@Slot(dict, dict)
|
504
|
+
def on_image_update(self, msg: dict, metadata: dict):
|
505
505
|
"""
|
506
506
|
Update the image of the device monitor from bec.
|
507
507
|
|
508
508
|
Args:
|
509
509
|
msg(dict): The message from bec.
|
510
|
+
metadata(dict): The metadata of the message.
|
510
511
|
"""
|
511
512
|
data = msg["data"]
|
512
513
|
device = msg["device"]
|
@@ -493,13 +493,14 @@ class BECMotorMap(BECPlotBase):
|
|
493
493
|
f"Motor position: ({round(float(current_x),precision)}, {round(float(current_y),precision)})"
|
494
494
|
)
|
495
495
|
|
496
|
-
@Slot(dict)
|
497
|
-
def on_device_readback(self, msg: dict) -> None:
|
496
|
+
@Slot(dict, dict)
|
497
|
+
def on_device_readback(self, msg: dict, metadata: dict) -> None:
|
498
498
|
"""
|
499
499
|
Update the motor map plot with the new motor position.
|
500
500
|
|
501
501
|
Args:
|
502
502
|
msg(dict): Message from the device readback.
|
503
|
+
metadata(dict): Metadata of the message.
|
503
504
|
"""
|
504
505
|
if self.motor_x is None or self.motor_y is None:
|
505
506
|
return
|
@@ -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=
|
5
|
+
CHANGELOG.md,sha256=k_Qc9SJskOynb-AMHgD3xJG-keXM4MuKjXLy4wdVGyQ,6875
|
6
6
|
LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
7
|
-
PKG-INFO,sha256=
|
7
|
+
PKG-INFO,sha256=XV0Gw1L20hWv_OA290dq_2dyMJceFPXRML6EubLQgwA,1308
|
8
8
|
README.md,sha256=Od69x-RS85Hph0-WwWACwal4yUd67XkEn4APEfHhHFw,2649
|
9
|
-
pyproject.toml,sha256=
|
9
|
+
pyproject.toml,sha256=0CZsuhJd44ZIok69huLV4wKss9CfqHMH4Xo0eeH8Uqg,2357
|
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
|
@@ -181,11 +181,11 @@ bec_widgets/widgets/figure/plots/axis_settings.py,sha256=QxRpQwgfBr1H0HTjfOpiXi_
|
|
181
181
|
bec_widgets/widgets/figure/plots/axis_settings.ui,sha256=a2qIuK9lyi9HCyrSvPr6wxzmm1FymaWcpmyOhMIiFt8,11013
|
182
182
|
bec_widgets/widgets/figure/plots/plot_base.py,sha256=AxzH2J-bLngxlWcgWWgNpLhIQxQzFz-H6yLf5Dou93Y,10921
|
183
183
|
bec_widgets/widgets/figure/plots/image/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
184
|
-
bec_widgets/widgets/figure/plots/image/image.py,sha256=
|
184
|
+
bec_widgets/widgets/figure/plots/image/image.py,sha256=o_tOWIVlsxdoTeY6qdp-6i6qnXZgaR5RWGJH_gHG-4s,24462
|
185
185
|
bec_widgets/widgets/figure/plots/image/image_item.py,sha256=RljjbkqJEr2cKDlqj1j5GQ1h89jpqOV-OpFz1TbED8I,10937
|
186
186
|
bec_widgets/widgets/figure/plots/image/image_processor.py,sha256=GeTtWjbldy6VejMwPGQgM-o3d6bmLglCjdoktu19xfA,5262
|
187
187
|
bec_widgets/widgets/figure/plots/motor_map/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
188
|
-
bec_widgets/widgets/figure/plots/motor_map/motor_map.py,sha256=
|
188
|
+
bec_widgets/widgets/figure/plots/motor_map/motor_map.py,sha256=wgARzsm98Y8SHPPwVp1LzNlXCxKEi6a8by8yYzIWsbY,18319
|
189
189
|
bec_widgets/widgets/figure/plots/waveform/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
190
190
|
bec_widgets/widgets/figure/plots/waveform/waveform.py,sha256=EjKwD_pOhZYmXU2M_LdIv9A9cbVYxR1Y9lH0tbMNuJE,51710
|
191
191
|
bec_widgets/widgets/figure/plots/waveform/waveform_curve.py,sha256=ZwRxSfPHbMWEvgUC-mL2orpZvtxR-DcrYAFikkdWEzk,8654
|
@@ -329,9 +329,9 @@ tests/unit_tests/test_bec_connector.py,sha256=5uqBfjgMeOlGvqJlFbytxEpZ1El7_Y2q8f
|
|
329
329
|
tests/unit_tests/test_bec_dispatcher.py,sha256=rYPiRizHaswhGZw55IBMneDFxmPiCCLAZQBqjEkpdyY,3992
|
330
330
|
tests/unit_tests/test_bec_dock.py,sha256=j52o5ZhGzcSJ2VTtRPjVf9ZpQTdMLO4w-eXc6GB2c90,5593
|
331
331
|
tests/unit_tests/test_bec_figure.py,sha256=8AojxszCIzMi6EYB5mVFMQjk4pjgBCSp6PH2JZsuDkw,8724
|
332
|
-
tests/unit_tests/test_bec_image.py,sha256=
|
332
|
+
tests/unit_tests/test_bec_image.py,sha256=gMoIuKSSSql2EhRrqk7i-iUMNozc9v2jJ2XGAnR0Oyw,2576
|
333
333
|
tests/unit_tests/test_bec_image_widget.py,sha256=4-fdbsJsPuzJs8EFw9C1llcF4Zmv3vzJcA9t34J0WD4,7478
|
334
|
-
tests/unit_tests/test_bec_motor_map.py,sha256=
|
334
|
+
tests/unit_tests/test_bec_motor_map.py,sha256=lIyUeEroJKUZ8CPil-s6ASWmpjTMwzkUz6y5ev43klY,9047
|
335
335
|
tests/unit_tests/test_bec_queue.py,sha256=u-uc-iZeGAS8P90o6Cxy5oz_60zHpirGAu04OgQPDXw,4598
|
336
336
|
tests/unit_tests/test_bec_status_box.py,sha256=gZdjyy9DNuUP9UwleTLj2Dp5HUImiqnkHjXWiqL0Q-o,4868
|
337
337
|
tests/unit_tests/test_client_utils.py,sha256=CBdWIVJ_UiyFzTJnX3XJm4PGw2uXhFvRCP_Y9ifckbw,2630
|
@@ -369,8 +369,8 @@ tests/unit_tests/test_configs/config_device_no_entry.yaml,sha256=hdvue9KLc_kfNzG
|
|
369
369
|
tests/unit_tests/test_configs/config_scan.yaml,sha256=vo484BbWOjA_e-h6bTjSV9k7QaQHrlAvx-z8wtY-P4E,1915
|
370
370
|
tests/unit_tests/test_msgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
371
371
|
tests/unit_tests/test_msgs/available_scans_message.py,sha256=m_z97hIrjHXXMa2Ex-UvsPmTxOYXfjxyJaGkIY6StTY,46532
|
372
|
-
bec_widgets-0.92.
|
373
|
-
bec_widgets-0.92.
|
374
|
-
bec_widgets-0.92.
|
375
|
-
bec_widgets-0.92.
|
376
|
-
bec_widgets-0.92.
|
372
|
+
bec_widgets-0.92.4.dist-info/METADATA,sha256=XV0Gw1L20hWv_OA290dq_2dyMJceFPXRML6EubLQgwA,1308
|
373
|
+
bec_widgets-0.92.4.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
374
|
+
bec_widgets-0.92.4.dist-info/entry_points.txt,sha256=3otEkCdDB9LZJuBLzG4pFLK5Di0CVybN_12IsZrQ-58,166
|
375
|
+
bec_widgets-0.92.4.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
376
|
+
bec_widgets-0.92.4.dist-info/RECORD,,
|
pyproject.toml
CHANGED
@@ -17,10 +17,8 @@ def bec_image_show(bec_figure):
|
|
17
17
|
|
18
18
|
def test_on_image_update(bec_image_show):
|
19
19
|
data = np.random.rand(100, 100)
|
20
|
-
msg = messages.DeviceMonitor2DMessage(
|
21
|
-
|
22
|
-
).model_dump()
|
23
|
-
bec_image_show.on_image_update(msg)
|
20
|
+
msg = messages.DeviceMonitor2DMessage(device="eiger", data=data, metadata={"scan_id": "12345"})
|
21
|
+
bec_image_show.on_image_update(msg.content, msg.metadata)
|
24
22
|
img = bec_image_show.images[0]
|
25
23
|
assert np.array_equal(img.get_data(), data)
|
26
24
|
|
@@ -28,10 +26,8 @@ def test_on_image_update(bec_image_show):
|
|
28
26
|
def test_autorange_on_image_update(bec_image_show):
|
29
27
|
# Check if autorange mode "mean" works, should be default
|
30
28
|
data = np.random.rand(100, 100)
|
31
|
-
msg = messages.DeviceMonitor2DMessage(
|
32
|
-
|
33
|
-
).model_dump()
|
34
|
-
bec_image_show.on_image_update(msg)
|
29
|
+
msg = messages.DeviceMonitor2DMessage(device="eiger", data=data, metadata={"scan_id": "12345"})
|
30
|
+
bec_image_show.on_image_update(msg.content, msg.metadata)
|
35
31
|
img = bec_image_show.images[0]
|
36
32
|
assert np.array_equal(img.get_data(), data)
|
37
33
|
vmin = max(np.mean(data) - 2 * np.std(data), 0)
|
@@ -39,7 +35,7 @@ def test_autorange_on_image_update(bec_image_show):
|
|
39
35
|
assert np.isclose(img.color_bar.getLevels(), (vmin, vmax), rtol=(1e-5, 1e-5)).all()
|
40
36
|
# Test general update with autorange True, mode "max"
|
41
37
|
bec_image_show.set_autorange_mode("max")
|
42
|
-
bec_image_show.on_image_update(msg)
|
38
|
+
bec_image_show.on_image_update(msg.content, msg.metadata)
|
43
39
|
img = bec_image_show.images[0]
|
44
40
|
vmin = np.min(data)
|
45
41
|
vmax = np.max(data)
|
@@ -47,18 +43,16 @@ def test_autorange_on_image_update(bec_image_show):
|
|
47
43
|
assert np.isclose(img.color_bar.getLevels(), (vmin, vmax), rtol=(1e-5, 1e-5)).all()
|
48
44
|
# Change the input data, and switch to autorange False, colormap levels should stay untouched
|
49
45
|
data *= 100
|
50
|
-
msg = messages.DeviceMonitor2DMessage(
|
51
|
-
device="eiger", data=data, metadata={"scan_id": "12345"}
|
52
|
-
).model_dump()
|
46
|
+
msg = messages.DeviceMonitor2DMessage(device="eiger", data=data, metadata={"scan_id": "12345"})
|
53
47
|
bec_image_show.set_autorange(False)
|
54
|
-
bec_image_show.on_image_update(msg)
|
48
|
+
bec_image_show.on_image_update(msg.content, msg.metadata)
|
55
49
|
img = bec_image_show.images[0]
|
56
50
|
assert np.array_equal(img.get_data(), data)
|
57
51
|
assert np.isclose(img.color_bar.getLevels(), (vmin, vmax), rtol=(1e-3, 1e-3)).all()
|
58
52
|
# Reactivate autorange, should now scale the new data
|
59
53
|
bec_image_show.set_autorange(True)
|
60
54
|
bec_image_show.set_autorange_mode("mean")
|
61
|
-
bec_image_show.on_image_update(msg)
|
55
|
+
bec_image_show.on_image_update(msg.content, msg.metadata)
|
62
56
|
img = bec_image_show.images[0]
|
63
57
|
vmin = max(np.mean(data) - 2 * np.std(data), 0)
|
64
58
|
vmax = np.mean(data) + 2 * np.std(data)
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import numpy as np
|
2
2
|
import pytest
|
3
|
+
from bec_lib.messages import DeviceMessage
|
3
4
|
|
4
5
|
from bec_widgets.widgets.figure.plots.motor_map.motor_map import BECMotorMap, MotorMapConfig
|
5
6
|
from bec_widgets.widgets.figure.plots.waveform.waveform_curve import SignalData
|
@@ -72,7 +73,8 @@ def test_motor_movement_updates_position_and_database(bec_figure):
|
|
72
73
|
|
73
74
|
# Simulate motor movement for 'samx' only
|
74
75
|
new_position_samx = 4.0
|
75
|
-
|
76
|
+
msg = DeviceMessage(signals={"samx": {"value": new_position_samx}}, metadata={})
|
77
|
+
mm.on_device_readback(msg.content, msg.metadata)
|
76
78
|
|
77
79
|
init_positions["samx"].append(new_position_samx)
|
78
80
|
init_positions["samy"].append(init_positions["samy"][-1])
|
@@ -96,7 +98,8 @@ def test_scatter_plot_rendering(bec_figure):
|
|
96
98
|
|
97
99
|
# Simulate motor movement for 'samx' only
|
98
100
|
new_position_samx = 4.0
|
99
|
-
|
101
|
+
msg = DeviceMessage(signals={"samx": {"value": new_position_samx}}, metadata={})
|
102
|
+
mm.on_device_readback(msg.content, msg.metadata)
|
100
103
|
mm._update_plot()
|
101
104
|
|
102
105
|
# Get the scatter plot item
|
@@ -116,8 +119,10 @@ def test_plot_visualization_consistency(bec_figure):
|
|
116
119
|
mm = bec_figure.motor_map("samx", "samy")
|
117
120
|
mm.change_motors("samx", "samy")
|
118
121
|
# Simulate updating the plot with new data
|
119
|
-
|
120
|
-
mm.on_device_readback(
|
122
|
+
msg = DeviceMessage(signals={"samx": {"value": 5}}, metadata={})
|
123
|
+
mm.on_device_readback(msg.content, msg.metadata)
|
124
|
+
msg = DeviceMessage(signals={"samy": {"value": 9}}, metadata={})
|
125
|
+
mm.on_device_readback(msg.content, msg.metadata)
|
121
126
|
mm._update_plot()
|
122
127
|
|
123
128
|
scatter_plot_item = mm.plot_components["scatter"]
|
@@ -234,10 +239,14 @@ def test_motor_map_get_data_max_points(bec_figure, qtbot):
|
|
234
239
|
"samx": [motor_map_dev["samx"].read()["samx"]["value"]],
|
235
240
|
"samy": [motor_map_dev["samy"].read()["samy"]["value"]],
|
236
241
|
}
|
237
|
-
|
238
|
-
mm.on_device_readback(
|
239
|
-
|
240
|
-
mm.on_device_readback(
|
242
|
+
msg = DeviceMessage(signals={"samx": {"value": 5.0}}, metadata={})
|
243
|
+
mm.on_device_readback(msg.content, msg.metadata)
|
244
|
+
msg = DeviceMessage(signals={"samy": {"value": 9.0}}, metadata={})
|
245
|
+
mm.on_device_readback(msg.content, msg.metadata)
|
246
|
+
msg = DeviceMessage(signals={"samx": {"value": 6.0}}, metadata={})
|
247
|
+
mm.on_device_readback(msg.content, msg.metadata)
|
248
|
+
msg = DeviceMessage(signals={"samy": {"value": 7.0}}, metadata={})
|
249
|
+
mm.on_device_readback(msg.content, msg.metadata)
|
241
250
|
|
242
251
|
expected_x = [init_positions["samx"][-1], 5.0, 5.0, 6.0, 6.0]
|
243
252
|
expected_y = [init_positions["samy"][-1], init_positions["samy"][-1], 9.0, 9.0, 7.0]
|
File without changes
|
File without changes
|
File without changes
|