0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-14 03:31:50 +02:00

refactor: renamed DeviceMonitor2DMessage

This commit is contained in:
2024-07-24 09:28:16 +02:00
committed by wakonig_k
parent 714e1e139e
commit 4be6fd6b83

View File

@ -17,7 +17,7 @@ def bec_image_show(bec_figure):
def test_on_image_update(bec_image_show):
data = np.random.rand(100, 100)
msg = messages.DeviceMonitorMessage(
msg = messages.DeviceMonitor2DMessage(
device="eiger", data=data, metadata={"scan_id": "12345"}
).model_dump()
bec_image_show.on_image_update(msg)
@ -28,7 +28,7 @@ def test_on_image_update(bec_image_show):
def test_autorange_on_image_update(bec_image_show):
# Check if autorange mode "mean" works, should be default
data = np.random.rand(100, 100)
msg = messages.DeviceMonitorMessage(
msg = messages.DeviceMonitor2DMessage(
device="eiger", data=data, metadata={"scan_id": "12345"}
).model_dump()
bec_image_show.on_image_update(msg)
@ -47,7 +47,7 @@ def test_autorange_on_image_update(bec_image_show):
assert np.isclose(img.color_bar.getLevels(), (vmin, vmax), rtol=(1e-5, 1e-5)).all()
# Change the input data, and switch to autorange False, colormap levels should stay untouched
data *= 100
msg = messages.DeviceMonitorMessage(
msg = messages.DeviceMonitor2DMessage(
device="eiger", data=data, metadata={"scan_id": "12345"}
).model_dump()
bec_image_show.set_autorange(False)