bec-widgets 0.76.0__py3-none-any.whl → 0.77.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.
Files changed (40) hide show
  1. CHANGELOG.md +42 -44
  2. PKG-INFO +2 -1
  3. bec_widgets/cli/client.py +73 -196
  4. bec_widgets/examples/jupyter_console/jupyter_console_window.py +25 -4
  5. bec_widgets/utils/bec_connector.py +66 -8
  6. bec_widgets/utils/colors.py +38 -0
  7. bec_widgets/utils/generate_designer_plugin.py +15 -14
  8. bec_widgets/utils/yaml_dialog.py +27 -3
  9. bec_widgets/widgets/console/console.py +496 -0
  10. bec_widgets/widgets/dock/dock.py +2 -2
  11. bec_widgets/widgets/dock/dock_area.py +2 -2
  12. bec_widgets/widgets/figure/figure.py +149 -195
  13. bec_widgets/widgets/figure/plots/image/image.py +62 -49
  14. bec_widgets/widgets/figure/plots/image/image_item.py +4 -3
  15. bec_widgets/widgets/figure/plots/motor_map/motor_map.py +98 -29
  16. bec_widgets/widgets/figure/plots/plot_base.py +1 -1
  17. bec_widgets/widgets/figure/plots/waveform/waveform.py +7 -8
  18. bec_widgets/widgets/figure/plots/waveform/waveform_curve.py +2 -2
  19. bec_widgets/widgets/ring_progress_bar/ring.py +3 -3
  20. bec_widgets/widgets/ring_progress_bar/ring_progress_bar.py +3 -3
  21. {bec_widgets-0.76.0.dist-info → bec_widgets-0.77.0.dist-info}/METADATA +2 -1
  22. {bec_widgets-0.76.0.dist-info → bec_widgets-0.77.0.dist-info}/RECORD +40 -38
  23. pyproject.toml +2 -1
  24. tests/end-2-end/test_bec_dock_rpc_e2e.py +16 -16
  25. tests/end-2-end/test_bec_figure_rpc_e2e.py +7 -7
  26. tests/end-2-end/test_rpc_register_e2e.py +8 -8
  27. tests/unit_tests/client_mocks.py +1 -0
  28. tests/unit_tests/test_bec_figure.py +49 -26
  29. tests/unit_tests/test_bec_motor_map.py +179 -41
  30. tests/unit_tests/test_color_validation.py +15 -0
  31. tests/unit_tests/test_device_input_base.py +1 -1
  32. tests/unit_tests/test_device_input_widgets.py +2 -0
  33. tests/unit_tests/test_generate_plugin.py +155 -0
  34. tests/unit_tests/test_motor_control.py +5 -4
  35. tests/unit_tests/test_plot_base.py +3 -3
  36. tests/unit_tests/test_waveform1d.py +18 -17
  37. tests/unit_tests/test_yaml_dialog.py +7 -7
  38. {bec_widgets-0.76.0.dist-info → bec_widgets-0.77.0.dist-info}/WHEEL +0 -0
  39. {bec_widgets-0.76.0.dist-info → bec_widgets-0.77.0.dist-info}/entry_points.txt +0 -0
  40. {bec_widgets-0.76.0.dist-info → bec_widgets-0.77.0.dist-info}/licenses/LICENSE +0 -0
@@ -11,7 +11,7 @@ from .test_bec_figure import bec_figure
11
11
 
12
12
 
13
13
  def test_adding_curve_to_waveform(bec_figure):
14
- w1 = bec_figure.add_plot()
14
+ w1 = bec_figure.plot()
15
15
 
16
16
  # adding curve which is in bec - only names
17
17
  c1 = w1.add_curve_scan(x_name="samx", y_name="bpm4i")
@@ -39,7 +39,7 @@ def test_adding_curve_to_waveform(bec_figure):
39
39
 
40
40
 
41
41
  def test_adding_curve_with_same_id(bec_figure):
42
- w1 = bec_figure.add_plot()
42
+ w1 = bec_figure.plot()
43
43
  c1 = w1.add_curve_scan(x_name="samx", y_name="bpm4i", gui_id="test_curve")
44
44
 
45
45
  with pytest.raises(ValueError) as excinfo:
@@ -122,9 +122,10 @@ def test_create_waveform1D_by_config(bec_figure):
122
122
  },
123
123
  }
124
124
 
125
- w1 = bec_figure.add_plot(config=w1_config_input)
125
+ w1 = bec_figure.plot(config=w1_config_input)
126
126
 
127
127
  w1_config_output = w1.get_config()
128
+ w1_config_input["gui_id"] = w1.gui_id
128
129
 
129
130
  assert w1_config_input == w1_config_output
130
131
  assert w1.plot_item.titleLabel.text == "Widget 1"
@@ -132,7 +133,7 @@ def test_create_waveform1D_by_config(bec_figure):
132
133
 
133
134
 
134
135
  def test_change_gui_id(bec_figure):
135
- w1 = bec_figure.add_plot()
136
+ w1 = bec_figure.plot()
136
137
  c1 = w1.add_curve_scan(x_name="samx", y_name="bpm4i")
137
138
  w1.change_gui_id("new_id")
138
139
 
@@ -141,7 +142,7 @@ def test_change_gui_id(bec_figure):
141
142
 
142
143
 
143
144
  def test_getting_curve(bec_figure):
144
- w1 = bec_figure.add_plot()
145
+ w1 = bec_figure.plot()
145
146
  c1 = w1.add_curve_scan(x_name="samx", y_name="bpm4i", gui_id="test_curve")
146
147
  c1_expected_config = CurveConfig(
147
148
  widget_class="BECCurve",
@@ -171,7 +172,7 @@ def test_getting_curve(bec_figure):
171
172
 
172
173
 
173
174
  def test_getting_curve_errors(bec_figure):
174
- w1 = bec_figure.add_plot()
175
+ w1 = bec_figure.plot()
175
176
  c1 = w1.add_curve_scan(x_name="samx", y_name="bpm4i", gui_id="test_curve")
176
177
 
177
178
  with pytest.raises(ValueError) as excinfo:
@@ -188,7 +189,7 @@ def test_getting_curve_errors(bec_figure):
188
189
 
189
190
 
190
191
  def test_add_curve(bec_figure):
191
- w1 = bec_figure.add_plot()
192
+ w1 = bec_figure.plot()
192
193
 
193
194
  c1 = w1.add_curve_scan(x_name="samx", y_name="bpm4i")
194
195
 
@@ -199,7 +200,7 @@ def test_add_curve(bec_figure):
199
200
 
200
201
 
201
202
  def test_change_legend_font_size(bec_figure):
202
- plot = bec_figure.add_plot()
203
+ plot = bec_figure.plot()
203
204
 
204
205
  w1 = plot.add_curve_scan(x_name="samx", y_name="bpm4i")
205
206
  my_func = plot.plot_item.legend
@@ -211,7 +212,7 @@ def test_change_legend_font_size(bec_figure):
211
212
 
212
213
 
213
214
  def test_remove_curve(bec_figure):
214
- w1 = bec_figure.add_plot()
215
+ w1 = bec_figure.plot()
215
216
 
216
217
  w1.add_curve_scan(x_name="samx", y_name="bpm4i")
217
218
  w1.add_curve_scan(x_name="samx", y_name="bpm3a")
@@ -229,7 +230,7 @@ def test_remove_curve(bec_figure):
229
230
 
230
231
 
231
232
  def test_change_curve_appearance_methods(bec_figure, qtbot):
232
- w1 = bec_figure.add_plot()
233
+ w1 = bec_figure.plot()
233
234
 
234
235
  c1 = w1.add_curve_scan(x_name="samx", y_name="bpm4i")
235
236
 
@@ -258,7 +259,7 @@ def test_change_curve_appearance_methods(bec_figure, qtbot):
258
259
 
259
260
 
260
261
  def test_change_curve_appearance_args(bec_figure):
261
- w1 = bec_figure.add_plot()
262
+ w1 = bec_figure.plot()
262
263
 
263
264
  c1 = w1.add_curve_scan(x_name="samx", y_name="bpm4i")
264
265
 
@@ -288,7 +289,7 @@ def test_change_curve_appearance_args(bec_figure):
288
289
 
289
290
 
290
291
  def test_set_custom_curve_data(bec_figure, qtbot):
291
- w1 = bec_figure.add_plot()
292
+ w1 = bec_figure.plot()
292
293
 
293
294
  c1 = w1.add_curve_custom(
294
295
  x=[1, 2, 3],
@@ -336,7 +337,7 @@ def test_custom_data_2D_array(bec_figure, qtbot):
336
337
 
337
338
 
338
339
  def test_get_all_data(bec_figure):
339
- w1 = bec_figure.add_plot()
340
+ w1 = bec_figure.plot()
340
341
 
341
342
  c1 = w1.add_curve_custom(
342
343
  x=[1, 2, 3],
@@ -371,7 +372,7 @@ def test_get_all_data(bec_figure):
371
372
 
372
373
 
373
374
  def test_curve_add_by_config(bec_figure):
374
- w1 = bec_figure.add_plot()
375
+ w1 = bec_figure.plot()
375
376
 
376
377
  c1_config_input = {
377
378
  "widget_class": "BECCurve",
@@ -411,7 +412,7 @@ def test_curve_add_by_config(bec_figure):
411
412
 
412
413
 
413
414
  def test_scan_update(bec_figure, qtbot):
414
- w1 = bec_figure.add_plot()
415
+ w1 = bec_figure.plot()
415
416
 
416
417
  c1 = w1.add_curve_scan(x_name="samx", y_name="bpm4i")
417
418
 
@@ -445,7 +446,7 @@ def test_scan_update(bec_figure, qtbot):
445
446
 
446
447
 
447
448
  def test_scan_history_with_val_access(bec_figure, qtbot):
448
- w1 = bec_figure.add_plot()
449
+ w1 = bec_figure.plot()
449
450
 
450
451
  c1 = w1.add_curve_scan(x_name="samx", y_name="bpm4i")
451
452
 
@@ -470,7 +471,7 @@ def test_scan_history_with_val_access(bec_figure, qtbot):
470
471
 
471
472
 
472
473
  def test_scatter_2d_update(bec_figure, qtbot):
473
- w1 = bec_figure.add_plot()
474
+ w1 = bec_figure.plot()
474
475
 
475
476
  c1 = w1.add_curve_scan(x_name="samx", y_name="samx", z_name="bpm4i")
476
477
 
@@ -7,7 +7,7 @@ import pytest
7
7
  import yaml
8
8
  from qtpy.QtWidgets import QPushButton, QVBoxLayout, QWidget
9
9
 
10
- from bec_widgets.utils.yaml_dialog import load_yaml, save_yaml
10
+ from bec_widgets.utils.yaml_dialog import load_yaml_gui, save_yaml_gui
11
11
 
12
12
 
13
13
  @pytest.fixture(scope="function")
@@ -33,7 +33,7 @@ def test_load_yaml(qtbot, example_widget):
33
33
  temp_file.write(b"name: test\nvalue: 42")
34
34
 
35
35
  def load_yaml_wrapper():
36
- config = load_yaml(example_widget)
36
+ config = load_yaml_gui(example_widget)
37
37
  if config:
38
38
  example_widget.config.update(config)
39
39
 
@@ -49,7 +49,7 @@ def test_load_yaml(qtbot, example_widget):
49
49
 
50
50
  def test_load_yaml_file_not_found(qtbot, example_widget, capsys):
51
51
  def load_yaml_wrapper():
52
- config = load_yaml(example_widget)
52
+ config = load_yaml_gui(example_widget)
53
53
  if config:
54
54
  example_widget.config.update(config)
55
55
 
@@ -76,7 +76,7 @@ def test_load_yaml_general_exception(qtbot, example_widget, capsys, monkeypatch)
76
76
  monkeypatch.setattr("builtins.open", mock_open)
77
77
 
78
78
  def load_yaml_wrapper():
79
- config = load_yaml(example_widget)
79
+ config = load_yaml_gui(example_widget)
80
80
  if config:
81
81
  example_widget.config.update(config)
82
82
 
@@ -96,7 +96,7 @@ def test_load_yaml_permission_error(qtbot, example_widget, monkeypatch, capsys):
96
96
  os.chmod(temp_file_path, 0o000) # Remove permissions
97
97
 
98
98
  def load_yaml_wrapper():
99
- config = load_yaml(example_widget)
99
+ config = load_yaml_gui(example_widget)
100
100
  if config:
101
101
  example_widget.config.update(config)
102
102
 
@@ -120,7 +120,7 @@ def test_load_yaml_invalid_yaml(qtbot, example_widget, capsys):
120
120
  temp_file.write(b"\tinvalid_yaml: [unbalanced_brackets: ]")
121
121
 
122
122
  def load_yaml_wrapper():
123
- config = load_yaml(example_widget)
123
+ config = load_yaml_gui(example_widget)
124
124
  if config:
125
125
  example_widget.config.update(config)
126
126
 
@@ -147,7 +147,7 @@ def test_save_yaml(qtbot, example_widget):
147
147
  example_widget.saved_config = {"name": "test", "value": 42}
148
148
 
149
149
  def save_yaml_wrapper():
150
- save_yaml(example_widget, example_widget.saved_config)
150
+ save_yaml_gui(example_widget, example_widget.saved_config)
151
151
 
152
152
  example_widget.export_button.clicked.connect(save_yaml_wrapper)
153
153