From 452124b528c41db14d1e34ab98db95f6f7230ad6 Mon Sep 17 00:00:00 2001 From: wakonig_k Date: Thu, 1 May 2025 15:02:40 +0200 Subject: [PATCH] chore(formatter): upgrade to black v25 --- bec_widgets/utils/bec_plugin_helper.py | 2 +- bec_widgets/utils/bec_signal_proxy.py | 4 ++-- bec_widgets/utils/linear_region_selector.py | 4 ++-- .../positioner_group/positioner_group.py | 2 +- .../dap/dap_combo_box/dap_combo_box.py | 2 +- .../widgets/editors/console/console.py | 24 +++++++++---------- .../services/bec_status_box/status_item.py | 2 +- bec_widgets/widgets/utility/logpanel/_util.py | 2 +- pyproject.toml | 2 +- tests/end-2-end/test_bec_gui_ipython.py | 2 +- tests/unit_tests/test_scan_metadata.py | 4 ++-- 11 files changed, 25 insertions(+), 25 deletions(-) diff --git a/bec_widgets/utils/bec_plugin_helper.py b/bec_widgets/utils/bec_plugin_helper.py index 5d50fdcf..d9641af8 100644 --- a/bec_widgets/utils/bec_plugin_helper.py +++ b/bec_widgets/utils/bec_plugin_helper.py @@ -21,7 +21,7 @@ def _submodule_specs(module: ModuleType) -> tuple[ModuleSpec | None, ...]: def _loaded_submodules_from_specs( - submodule_specs: tuple[ModuleSpec | None, ...] + submodule_specs: tuple[ModuleSpec | None, ...], ) -> Generator[ModuleType, None, None]: """Load all submodules from the given specs.""" for submodule in ( diff --git a/bec_widgets/utils/bec_signal_proxy.py b/bec_widgets/utils/bec_signal_proxy.py index a6fac61d..bd6c6397 100644 --- a/bec_widgets/utils/bec_signal_proxy.py +++ b/bec_widgets/utils/bec_signal_proxy.py @@ -1,6 +1,6 @@ -""" This custom class is a thin wrapper around the SignalProxy class to allow signal calls to be blocked. +"""This custom class is a thin wrapper around the SignalProxy class to allow signal calls to be blocked. Unblocking the proxy needs to be done through the slot unblock_proxy. The most likely use case for this class is -when the callback function is potentially initiating a slower progress, i.e. requesting a data analysis routine to +when the callback function is potentially initiating a slower progress, i.e. requesting a data analysis routine to analyse data. Requesting a new fit may lead to request piling up and an overall slow done of performance. This proxy will allow you to decide by yourself when to unblock and execute the callback again.""" diff --git a/bec_widgets/utils/linear_region_selector.py b/bec_widgets/utils/linear_region_selector.py index a60e5b36..1ffdf14f 100644 --- a/bec_widgets/utils/linear_region_selector.py +++ b/bec_widgets/utils/linear_region_selector.py @@ -1,5 +1,5 @@ -""" Module for a thin wrapper (LinearRegionWrapper) around the LinearRegionItem in pyqtgraph. -The class is mainly designed for usage with the BECWaveform and 1D plots. """ +"""Module for a thin wrapper (LinearRegionWrapper) around the LinearRegionItem in pyqtgraph. +The class is mainly designed for usage with the BECWaveform and 1D plots.""" from __future__ import annotations diff --git a/bec_widgets/widgets/control/device_control/positioner_group/positioner_group.py b/bec_widgets/widgets/control/device_control/positioner_group/positioner_group.py index 1cbf871f..2e4174c5 100644 --- a/bec_widgets/widgets/control/device_control/positioner_group/positioner_group.py +++ b/bec_widgets/widgets/control/device_control/positioner_group/positioner_group.py @@ -1,4 +1,4 @@ -""" Module for a PositionerGroup widget to control a positioner device.""" +"""Module for a PositionerGroup widget to control a positioner device.""" from __future__ import annotations diff --git a/bec_widgets/widgets/dap/dap_combo_box/dap_combo_box.py b/bec_widgets/widgets/dap/dap_combo_box/dap_combo_box.py index df122446..c9892ba3 100644 --- a/bec_widgets/widgets/dap/dap_combo_box/dap_combo_box.py +++ b/bec_widgets/widgets/dap/dap_combo_box/dap_combo_box.py @@ -1,4 +1,4 @@ -""" Module for DapComboBox widget class to select a DAP model from a combobox. """ +"""Module for DapComboBox widget class to select a DAP model from a combobox.""" from bec_lib.logger import bec_logger from qtpy.QtCore import Property, Signal, Slot diff --git a/bec_widgets/widgets/editors/console/console.py b/bec_widgets/widgets/editors/console/console.py index b7cf5205..d1d0d390 100644 --- a/bec_widgets/widgets/editors/console/console.py +++ b/bec_widgets/widgets/editors/console/console.py @@ -1,5 +1,5 @@ """ -BECConsole is a Qt widget that runs a Bash shell. +BECConsole is a Qt widget that runs a Bash shell. BECConsole VT100 emulation is powered by Pyte, (https://github.com/selectel/pyte). @@ -56,12 +56,12 @@ control_keys_mapping = { QtCore.Qt.Key_G: b"\x07", # Ctrl-G (Bell) QtCore.Qt.Key_H: b"\x08", # Ctrl-H (Backspace) QtCore.Qt.Key_I: b"\x09", # Ctrl-I (Tab) - QtCore.Qt.Key_J: b"\x0A", # Ctrl-J (Line Feed) - QtCore.Qt.Key_K: b"\x0B", # Ctrl-K (Vertical Tab) - QtCore.Qt.Key_L: b"\x0C", # Ctrl-L (Form Feed) - QtCore.Qt.Key_M: b"\x0D", # Ctrl-M (Carriage Return) - QtCore.Qt.Key_N: b"\x0E", # Ctrl-N - QtCore.Qt.Key_O: b"\x0F", # Ctrl-O + QtCore.Qt.Key_J: b"\x0a", # Ctrl-J (Line Feed) + QtCore.Qt.Key_K: b"\x0b", # Ctrl-K (Vertical Tab) + QtCore.Qt.Key_L: b"\x0c", # Ctrl-L (Form Feed) + QtCore.Qt.Key_M: b"\x0d", # Ctrl-M (Carriage Return) + QtCore.Qt.Key_N: b"\x0e", # Ctrl-N + QtCore.Qt.Key_O: b"\x0f", # Ctrl-O QtCore.Qt.Key_P: b"\x10", # Ctrl-P QtCore.Qt.Key_Q: b"\x11", # Ctrl-Q QtCore.Qt.Key_R: b"\x12", # Ctrl-R @@ -72,10 +72,10 @@ control_keys_mapping = { QtCore.Qt.Key_W: b"\x17", # Ctrl-W QtCore.Qt.Key_X: b"\x18", # Ctrl-X QtCore.Qt.Key_Y: b"\x19", # Ctrl-Y - QtCore.Qt.Key_Z: b"\x1A", # Ctrl-Z - QtCore.Qt.Key_Escape: b"\x1B", # Ctrl-Escape - QtCore.Qt.Key_Backslash: b"\x1C", # Ctrl-\ - QtCore.Qt.Key_Underscore: b"\x1F", # Ctrl-_ + QtCore.Qt.Key_Z: b"\x1a", # Ctrl-Z + QtCore.Qt.Key_Escape: b"\x1b", # Ctrl-Escape + QtCore.Qt.Key_Backslash: b"\x1c", # Ctrl-\ + QtCore.Qt.Key_Underscore: b"\x1f", # Ctrl-_ } normal_keys_mapping = { @@ -89,7 +89,7 @@ normal_keys_mapping = { QtCore.Qt.Key_Left: b"\x02", QtCore.Qt.Key_Up: b"\x10", QtCore.Qt.Key_Right: b"\x06", - QtCore.Qt.Key_Down: b"\x0E", + QtCore.Qt.Key_Down: b"\x0e", QtCore.Qt.Key_PageUp: b"\x49", QtCore.Qt.Key_PageDown: b"\x51", QtCore.Qt.Key_F1: b"\x1b\x31", diff --git a/bec_widgets/widgets/services/bec_status_box/status_item.py b/bec_widgets/widgets/services/bec_status_box/status_item.py index cec7150e..2858683a 100644 --- a/bec_widgets/widgets/services/bec_status_box/status_item.py +++ b/bec_widgets/widgets/services/bec_status_box/status_item.py @@ -1,4 +1,4 @@ -""" Module for a StatusItem widget to display status and metrics for a BEC service. +"""Module for a StatusItem widget to display status and metrics for a BEC service. The widget is bound to be used with the BECStatusBox widget.""" import enum diff --git a/bec_widgets/widgets/utility/logpanel/_util.py b/bec_widgets/widgets/utility/logpanel/_util.py index 547ee208..a3f674ee 100644 --- a/bec_widgets/widgets/utility/logpanel/_util.py +++ b/bec_widgets/widgets/utility/logpanel/_util.py @@ -1,4 +1,4 @@ -""" Utilities for filtering and formatting in the LogPanel""" +"""Utilities for filtering and formatting in the LogPanel""" from __future__ import annotations diff --git a/pyproject.toml b/pyproject.toml index 94fe0f81..a02f29a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ dependencies = [ "bec_ipython_client>=2.21.4, <=4.0", # needed for jupyter console "bec_lib>=3.29, <=4.0", "bec_qthemes~=0.7, >=0.7", - "black~=24.0", # needed for bw-generate-cli + "black~=25.0", # needed for bw-generate-cli "isort~=5.13, >=5.13.2", # needed for bw-generate-cli "pydantic~=2.0", "pyqtgraph~=0.13", diff --git a/tests/end-2-end/test_bec_gui_ipython.py b/tests/end-2-end/test_bec_gui_ipython.py index 9cd22a26..8ec35282 100644 --- a/tests/end-2-end/test_bec_gui_ipython.py +++ b/tests/end-2-end/test_bec_gui_ipython.py @@ -1,5 +1,5 @@ """ -Test module for the gui object within the BEC IPython client. +Test module for the gui object within the BEC IPython client. """ from unittest import mock diff --git a/tests/unit_tests/test_scan_metadata.py b/tests/unit_tests/test_scan_metadata.py index 0a89c5f9..0a93f2bd 100644 --- a/tests/unit_tests/test_scan_metadata.py +++ b/tests/unit_tests/test_scan_metadata.py @@ -116,7 +116,7 @@ def fill_commponents(components: dict[str, DynamicFormItem]): def test_griditems_are_correct_class( - metadata_widget: tuple[ScanMetadata, dict[str, DynamicFormItem]] + metadata_widget: tuple[ScanMetadata, dict[str, DynamicFormItem]], ): _, components = metadata_widget assert isinstance(components["sample_name"], StrMetadataField) @@ -162,7 +162,7 @@ def test_validation(metadata_widget: tuple[ScanMetadata, dict[str, DynamicFormIt def test_numbers_clipped_to_limits( - metadata_widget: tuple[ScanMetadata, dict[str, DynamicFormItem]] + metadata_widget: tuple[ScanMetadata, dict[str, DynamicFormItem]], ): widget, components = metadata_widget = metadata_widget fill_commponents(components)