bec-widgets 0.99.8__py3-none-any.whl → 0.99.10__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 (157) hide show
  1. CHANGELOG.md +18 -20
  2. PKG-INFO +1 -1
  3. bec_widgets/widgets/positioner_box/positioner_box.py +23 -11
  4. bec_widgets/widgets/stop_button/stop_button.py +30 -13
  5. {bec_widgets-0.99.8.dist-info → bec_widgets-0.99.10.dist-info}/METADATA +1 -1
  6. {bec_widgets-0.99.8.dist-info → bec_widgets-0.99.10.dist-info}/RECORD +10 -157
  7. pyproject.toml +6 -1
  8. docs/Makefile +0 -20
  9. docs/_static/custom.css +0 -170
  10. docs/_templates/custom-class-template.rst +0 -34
  11. docs/_templates/custom-module-template.rst +0 -66
  12. docs/api_reference/api_reference.md +0 -12
  13. docs/assets/apps_48dp.svg +0 -1
  14. docs/assets/display_settings_48dp.svg +0 -1
  15. docs/assets/index_api.svg +0 -97
  16. docs/assets/index_contribute.svg +0 -76
  17. docs/assets/index_getting_started.svg +0 -66
  18. docs/assets/index_user_guide.svg +0 -67
  19. docs/assets/rocket_launch_48dp.svg +0 -1
  20. docs/assets/widget_screenshots/buttons.png +0 -0
  21. docs/assets/widget_screenshots/device_box.png +0 -0
  22. docs/assets/widget_screenshots/device_browser.png +0 -0
  23. docs/assets/widget_screenshots/device_inputs.png +0 -0
  24. docs/assets/widget_screenshots/dock_area.png +0 -0
  25. docs/assets/widget_screenshots/figure.png +0 -0
  26. docs/assets/widget_screenshots/image_widget.png +0 -0
  27. docs/assets/widget_screenshots/motor_map_widget.png +0 -0
  28. docs/assets/widget_screenshots/position_indicator.png +0 -0
  29. docs/assets/widget_screenshots/queue.png +0 -0
  30. docs/assets/widget_screenshots/ring_progress_bar.png +0 -0
  31. docs/assets/widget_screenshots/scan_controller.png +0 -0
  32. docs/assets/widget_screenshots/spinner.gif +0 -0
  33. docs/assets/widget_screenshots/status_box.png +0 -0
  34. docs/assets/widget_screenshots/text_box.png +0 -0
  35. docs/assets/widget_screenshots/toggle.png +0 -0
  36. docs/assets/widget_screenshots/waveform_widget.png +0 -0
  37. docs/assets/widget_screenshots/website.png +0 -0
  38. docs/conf.py +0 -82
  39. docs/developer/developer.md +0 -52
  40. docs/developer/introduction/concepts.md +0 -14
  41. docs/developer/introduction/contributing.md +0 -28
  42. docs/developer/introduction/introduction.md +0 -16
  43. docs/developer/introduction/useful_links.md +0 -23
  44. docs/developer/widget_development/bec_dispatcher.md +0 -143
  45. docs/developer/widget_development/widget_base_class.md +0 -171
  46. docs/developer/widget_development/widget_development.md +0 -14
  47. docs/index.md +0 -74
  48. docs/introduction/introduction.md +0 -18
  49. docs/make.bat +0 -35
  50. docs/requirements.txt +0 -12
  51. docs/user/api_reference/api_reference.md +0 -11
  52. docs/user/applications/applications.md +0 -10
  53. docs/user/customisation.md +0 -123
  54. docs/user/getting_started/BECDockArea.png +0 -0
  55. docs/user/getting_started/auto_updates.md +0 -82
  56. docs/user/getting_started/getting_started.md +0 -15
  57. docs/user/getting_started/gui_complex_gui.gif +0 -0
  58. docs/user/getting_started/installation.md +0 -33
  59. docs/user/getting_started/quick_start.md +0 -110
  60. docs/user/getting_started/video_tutorials.md +0 -17
  61. docs/user/user.md +0 -71
  62. docs/user/widgets/bec_figure/BECFigure.png +0 -0
  63. docs/user/widgets/bec_figure/bec_figure.md +0 -105
  64. docs/user/widgets/bec_status_box/bec_status_box.gif +0 -0
  65. docs/user/widgets/bec_status_box/bec_status_box.md +0 -38
  66. docs/user/widgets/buttons/buttons.md +0 -90
  67. docs/user/widgets/buttons/dark_mode_disabled.png +0 -0
  68. docs/user/widgets/buttons/dark_mode_enabled.png +0 -0
  69. docs/user/widgets/device_browser/device_browser.md +0 -36
  70. docs/user/widgets/device_browser/device_browser.png +0 -0
  71. docs/user/widgets/device_input/device_input.md +0 -100
  72. docs/user/widgets/dock_area/BECDockArea.png +0 -0
  73. docs/user/widgets/dock_area/bec_dock_area.md +0 -109
  74. docs/user/widgets/image/image_plot.gif +0 -0
  75. docs/user/widgets/image/image_widget.md +0 -84
  76. docs/user/widgets/motor_map/motor.gif +0 -0
  77. docs/user/widgets/motor_map/motor_map.md +0 -80
  78. docs/user/widgets/position_indicator/position_indicator.md +0 -69
  79. docs/user/widgets/positioner_box/positioner_box.md +0 -63
  80. docs/user/widgets/progress_bar/progress_bar.gif +0 -0
  81. docs/user/widgets/progress_bar/ring_progress_bar.md +0 -103
  82. docs/user/widgets/queue/queue.md +0 -41
  83. docs/user/widgets/scan_control/hide_scan_control.png +0 -0
  84. docs/user/widgets/scan_control/scan_control.gif +0 -0
  85. docs/user/widgets/scan_control/scan_control.md +0 -54
  86. docs/user/widgets/spinner/spinner.md +0 -68
  87. docs/user/widgets/text_box/text_box.md +0 -74
  88. docs/user/widgets/toggle/toggle.md +0 -66
  89. docs/user/widgets/waveform/bec_figure_dap.gif +0 -0
  90. docs/user/widgets/waveform/scatter_2D.gif +0 -0
  91. docs/user/widgets/waveform/w1D.gif +0 -0
  92. docs/user/widgets/waveform/waveform_widget.md +0 -132
  93. docs/user/widgets/website/website.md +0 -69
  94. docs/user/widgets/widgets.md +0 -220
  95. tests/__init__.py +0 -0
  96. tests/end-2-end/__init__.py +0 -0
  97. tests/end-2-end/conftest.py +0 -53
  98. tests/end-2-end/test_bec_dock_rpc_e2e.py +0 -298
  99. tests/end-2-end/test_bec_figure_rpc_e2e.py +0 -212
  100. tests/end-2-end/test_rpc_register_e2e.py +0 -40
  101. tests/end-2-end/test_scan_control_e2e.py +0 -71
  102. tests/references/SpinnerWidget/SpinnerWidget_darwin.png +0 -0
  103. tests/references/SpinnerWidget/SpinnerWidget_linux.png +0 -0
  104. tests/references/SpinnerWidget/SpinnerWidget_started_darwin.png +0 -0
  105. tests/references/SpinnerWidget/SpinnerWidget_started_linux.png +0 -0
  106. tests/unit_tests/__init__.py +0 -0
  107. tests/unit_tests/client_mocks.py +0 -189
  108. tests/unit_tests/conftest.py +0 -64
  109. tests/unit_tests/test_bec_connector.py +0 -80
  110. tests/unit_tests/test_bec_dispatcher.py +0 -119
  111. tests/unit_tests/test_bec_dock.py +0 -155
  112. tests/unit_tests/test_bec_figure.py +0 -270
  113. tests/unit_tests/test_bec_image.py +0 -63
  114. tests/unit_tests/test_bec_image_widget.py +0 -217
  115. tests/unit_tests/test_bec_motor_map.py +0 -282
  116. tests/unit_tests/test_bec_queue.py +0 -111
  117. tests/unit_tests/test_bec_status_box.py +0 -123
  118. tests/unit_tests/test_client_utils.py +0 -76
  119. tests/unit_tests/test_color_map_selector.py +0 -42
  120. tests/unit_tests/test_color_validation.py +0 -75
  121. tests/unit_tests/test_configs/config_device.yaml +0 -33
  122. tests/unit_tests/test_configs/config_device_no_entry.yaml +0 -27
  123. tests/unit_tests/test_configs/config_scan.yaml +0 -82
  124. tests/unit_tests/test_crosshair.py +0 -143
  125. tests/unit_tests/test_dark_mode_button.py +0 -70
  126. tests/unit_tests/test_device_browser.py +0 -83
  127. tests/unit_tests/test_device_input_base.py +0 -76
  128. tests/unit_tests/test_device_input_widgets.py +0 -178
  129. tests/unit_tests/test_error_utils.py +0 -63
  130. tests/unit_tests/test_generate_cli_client.py +0 -123
  131. tests/unit_tests/test_generate_plugin.py +0 -155
  132. tests/unit_tests/test_motor_map_widget.py +0 -194
  133. tests/unit_tests/test_msgs/__init__.py +0 -0
  134. tests/unit_tests/test_msgs/available_scans_message.py +0 -989
  135. tests/unit_tests/test_plot_base.py +0 -95
  136. tests/unit_tests/test_plugin_utils.py +0 -13
  137. tests/unit_tests/test_positioner_box.py +0 -130
  138. tests/unit_tests/test_ring_progress_bar.py +0 -337
  139. tests/unit_tests/test_rpc_register.py +0 -52
  140. tests/unit_tests/test_rpc_server.py +0 -42
  141. tests/unit_tests/test_rpc_widget_handler.py +0 -7
  142. tests/unit_tests/test_scan_control.py +0 -324
  143. tests/unit_tests/test_scan_control_group_box.py +0 -160
  144. tests/unit_tests/test_setting_dialog.py +0 -96
  145. tests/unit_tests/test_spinner.py +0 -31
  146. tests/unit_tests/test_stop_button.py +0 -27
  147. tests/unit_tests/test_text_box_widget.py +0 -54
  148. tests/unit_tests/test_toggle.py +0 -38
  149. tests/unit_tests/test_vscode_widget.py +0 -75
  150. tests/unit_tests/test_waveform1d.py +0 -712
  151. tests/unit_tests/test_waveform_widget.py +0 -462
  152. tests/unit_tests/test_website_widget.py +0 -25
  153. tests/unit_tests/test_widget_io.py +0 -90
  154. tests/unit_tests/test_yaml_dialog.py +0 -163
  155. {bec_widgets-0.99.8.dist-info → bec_widgets-0.99.10.dist-info}/WHEEL +0 -0
  156. {bec_widgets-0.99.8.dist-info → bec_widgets-0.99.10.dist-info}/entry_points.txt +0 -0
  157. {bec_widgets-0.99.8.dist-info → bec_widgets-0.99.10.dist-info}/licenses/LICENSE +0 -0
@@ -1,54 +0,0 @@
1
- import re
2
- from unittest import mock
3
-
4
- import pytest
5
-
6
- from bec_widgets.widgets.text_box.text_box import TextBox
7
-
8
- from .client_mocks import mocked_client
9
-
10
-
11
- @pytest.fixture
12
- def text_box_widget(qtbot, mocked_client):
13
- widget = TextBox(client=mocked_client)
14
- qtbot.addWidget(widget)
15
- qtbot.waitExposed(widget)
16
- yield widget
17
-
18
-
19
- def test_textbox_widget(text_box_widget):
20
- """Test the TextBox widget."""
21
- text = "Hello World!"
22
- text_box_widget.set_text(text)
23
- assert text_box_widget.toPlainText() == text
24
-
25
- text_box_widget.set_color("#FFDDC1", "#123456")
26
- text_box_widget.set_font_size(20)
27
- assert (
28
- text_box_widget.styleSheet() == "background-color: #FFDDC1; color: #123456; font-size: 20px"
29
- )
30
- text_box_widget.set_color("white", "blue")
31
- text_box_widget.set_font_size(14)
32
- assert text_box_widget.styleSheet() == "background-color: white; color: blue; font-size: 14px"
33
- text = "<h1>Welcome to PyQt6</h1><p>This is an example of displaying <strong>HTML</strong> text.</p>"
34
- with mock.patch.object(text_box_widget, "setHtml") as mocked_set_html:
35
- text_box_widget.set_text(text)
36
- assert mocked_set_html.call_count == 1
37
- assert mocked_set_html.call_args == mock.call(text)
38
-
39
-
40
- def test_textbox_change_theme(text_box_widget):
41
- """Test change theme functionaility"""
42
- # Default is dark theme
43
- text_box_widget.change_theme()
44
- assert text_box_widget.config.theme == "light"
45
- assert (
46
- text_box_widget.styleSheet()
47
- == f"background-color: #FFF; color: #000; font-size: {text_box_widget.config.font_size}px"
48
- )
49
- text_box_widget.change_theme()
50
- assert text_box_widget.config.theme == "dark"
51
- assert (
52
- text_box_widget.styleSheet()
53
- == f"background-color: #000; color: #FFF; font-size: {text_box_widget.config.font_size}px"
54
- )
@@ -1,38 +0,0 @@
1
- import pytest
2
- from qtpy.QtCore import QPointF, Qt
3
-
4
- from bec_widgets.widgets.toggle.toggle import ToggleSwitch
5
-
6
-
7
- @pytest.fixture
8
- def toggle(qtbot):
9
- widget = ToggleSwitch()
10
- qtbot.addWidget(widget)
11
- qtbot.waitExposed(widget)
12
- yield widget
13
-
14
-
15
- def test_toggle(toggle):
16
- toggle.checked = False
17
- assert toggle.checked is False
18
-
19
- assert toggle.thumb_pos == QPointF(3, 2)
20
-
21
- toggle.checked = True
22
- assert toggle.checked is True
23
-
24
- assert toggle.thumb_pos == QPointF(22, 2)
25
-
26
-
27
- def test_toggle_click(qtbot, toggle):
28
- init_state = toggle.checked
29
-
30
- qtbot.mouseClick(toggle, Qt.LeftButton)
31
- toggle.paintEvent(None)
32
- assert toggle.checked is not init_state
33
-
34
- init_state = toggle.checked
35
-
36
- qtbot.mouseClick(toggle, Qt.LeftButton)
37
- toggle.paintEvent(None)
38
- assert toggle.checked is not init_state
@@ -1,75 +0,0 @@
1
- import os
2
- import shlex
3
- import subprocess
4
- from unittest import mock
5
-
6
- import pytest
7
-
8
- from bec_widgets.widgets.vscode.vscode import VSCodeEditor
9
-
10
- from .client_mocks import mocked_client
11
-
12
-
13
- @pytest.fixture
14
- def vscode_widget(qtbot, mocked_client):
15
- with mock.patch("bec_widgets.widgets.vscode.vscode.subprocess.Popen") as mock_popen:
16
- widget = VSCodeEditor(client=mocked_client)
17
- qtbot.addWidget(widget)
18
- qtbot.waitExposed(widget)
19
- yield widget
20
-
21
-
22
- def test_vscode_widget(qtbot, vscode_widget):
23
- assert vscode_widget.process is not None
24
- assert vscode_widget._url == "http://127.0.0.1:7000?tkn=bec"
25
-
26
-
27
- def test_start_server(qtbot, mocked_client):
28
-
29
- with mock.patch("bec_widgets.widgets.vscode.vscode.subprocess.Popen") as mock_popen:
30
- with mock.patch("bec_widgets.widgets.vscode.vscode.select.select") as mock_select:
31
- mock_process = mock.Mock()
32
- mock_process.stdout.fileno.return_value = 1
33
- mock_process.poll.return_value = None
34
- mock_process.stdout.read.return_value = f"available at http://{VSCodeEditor.host}:{VSCodeEditor.port}?tkn={VSCodeEditor.token}"
35
- mock_popen.return_value = mock_process
36
- mock_select.return_value = [[mock_process.stdout], [], []]
37
-
38
- widget = VSCodeEditor(client=mocked_client)
39
-
40
- mock_popen.assert_called_once_with(
41
- shlex.split(
42
- f"code serve-web --port {widget.port} --connection-token={widget.token} --accept-server-license-terms"
43
- ),
44
- text=True,
45
- stdout=subprocess.PIPE,
46
- stderr=subprocess.DEVNULL,
47
- preexec_fn=os.setsid,
48
- )
49
-
50
-
51
- @pytest.fixture
52
- def patched_vscode_process(qtbot, vscode_widget):
53
- with mock.patch("bec_widgets.widgets.vscode.vscode.os.killpg") as mock_killpg:
54
- with mock.patch("bec_widgets.widgets.vscode.vscode.os.getpgid") as mock_getpgid:
55
- mock_getpgid.return_value = 123
56
- vscode_widget.process = mock.Mock()
57
- yield vscode_widget, mock_killpg
58
-
59
-
60
- def test_vscode_cleanup(qtbot, patched_vscode_process):
61
- vscode_patched, mock_killpg = patched_vscode_process
62
- vscode_patched.process.pid = 123
63
- vscode_patched.process.poll.return_value = None
64
- vscode_patched.cleanup()
65
- mock_killpg.assert_called_once_with(123, 15)
66
- vscode_patched.process.wait.assert_called_once()
67
-
68
-
69
- def test_close_event_on_terminated_code(qtbot, patched_vscode_process):
70
- vscode_patched, mock_killpg = patched_vscode_process
71
- vscode_patched.process.pid = 123
72
- vscode_patched.process.poll.return_value = 0
73
- vscode_patched.cleanup()
74
- mock_killpg.assert_not_called()
75
- vscode_patched.process.wait.assert_not_called()