diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f8cd10dc6d5954ebe1032696839411c8c395eb9d..3cc8620b35745d4b064883c9637afb642c487ced 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,16 +2,16 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/timothycrosley/isort - rev: 5.10.1 + rev: 5.12.0 hooks: - id: isort args: [-sl] - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 23.1.0 hooks: - id: black - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.4.0 hooks: - id: check-ast - id: check-case-conflict @@ -23,7 +23,7 @@ repos: - id: check-yaml exclude: conda/meta.yaml - repo: https://github.com/PyCQA/flake8/ - rev: 4.0.1 + rev: 6.0.0 hooks: - id: flake8 - repo: https://github.com/PyCQA/bandit diff --git a/beat/editor/test/test_assetmodel.py b/beat/editor/test/test_assetmodel.py index fdc2009a37077ee9be66b6cb15717baf1ddb0b87..fede65711ff94b0ecb0d9437dbc0f0edad25fbb7 100644 --- a/beat/editor/test/test_assetmodel.py +++ b/beat/editor/test/test_assetmodel.py @@ -171,7 +171,6 @@ class TestDataFormatModel: assert len(asset_list) > 0 base_types = dataformat_basetypes() for item in asset_list: - if item in base_types: with pytest.raises(RuntimeError): _ = df_model.json_path(item) diff --git a/beat/editor/test/test_databaseeditor.py b/beat/editor/test/test_databaseeditor.py index d296e60bf0df5cfe8fd751f47d510527c27729c5..167af80cb090e9bb7f6b1a09a926c92376605dc0 100644 --- a/beat/editor/test/test_databaseeditor.py +++ b/beat/editor/test/test_databaseeditor.py @@ -124,7 +124,6 @@ class TestViewEditor: assert not view_editor.remove_button.isEnabled() if "parameters" in reference_view_json: - view_editor.parameters_tablewidget.setCurrentCell(0, 0) assert view_editor.remove_button.isEnabled() diff --git a/beat/editor/test/test_delegates.py b/beat/editor/test/test_delegates.py index 898af0f194571977dbf9bb31bd68e26dbcd45259..57b1170513dcc518b5b397b15445f4190e81f558 100644 --- a/beat/editor/test/test_delegates.py +++ b/beat/editor/test/test_delegates.py @@ -62,6 +62,5 @@ class TestAssetItemDelegate: assert editor_model == asset_model def test_invalid_model(self, qtbot): - with pytest.raises(TypeError): AssetItemDelegate(QStringListModel()) diff --git a/beat/editor/test/test_plotterparameterseditor.py b/beat/editor/test/test_plotterparameterseditor.py index 1ff5446652c353e4cbd7e18fac08e192a8545a5a..b3db3ec9eb8993c6908118fdf24a21f9a13f45b9 100644 --- a/beat/editor/test/test_plotterparameterseditor.py +++ b/beat/editor/test/test_plotterparameterseditor.py @@ -226,7 +226,6 @@ class TestPlotterParametersEditor: def test_remove_plotter_parameter( self, qtbot, monkeypatch, beat_context, plotter_model, test_prefix ): - asset_name = "plot/config/1" asset = Asset(test_prefix, AssetType.PLOTTERPARAMETER, asset_name) diff --git a/beat/editor/test/test_toolchaineditor.py b/beat/editor/test/test_toolchaineditor.py index 110b04d8d594a6d211715b40333ba8bfb7ee5a2d..1390cd7bdd2024e5eb3e34791b8f9998b4f68881 100644 --- a/beat/editor/test/test_toolchaineditor.py +++ b/beat/editor/test/test_toolchaineditor.py @@ -203,7 +203,6 @@ class TestToolchainEditor: @pytest.mark.parametrize("toolchain", get_valid_toolchains(prefix)) def test_load_and_dump(self, qtbot, test_prefix, toolchain): - reference_json = get_toolchain_declaration(test_prefix, toolchain) editor = ToolchainEditor() diff --git a/beat/editor/widgets/algorithmeditor.py b/beat/editor/widgets/algorithmeditor.py index ad9387f49a7896a0366b5ebe6ac6409df13432ab..2b756c67470e5d45fdb02b8b261372b8b0551fd2 100644 --- a/beat/editor/widgets/algorithmeditor.py +++ b/beat/editor/widgets/algorithmeditor.py @@ -146,7 +146,6 @@ def update_code(asset): class PropertyEditor(QWidget): - dataChanged = pyqtSignal() analyzerStateChanged = pyqtSignal(bool) diff --git a/beat/editor/widgets/databaseeditor.py b/beat/editor/widgets/databaseeditor.py index 8c274d83d5bf1183644380499c1772ed20ac0d1c..93508781484f09c4f60ddbe92091588b9aa26a81 100644 --- a/beat/editor/widgets/databaseeditor.py +++ b/beat/editor/widgets/databaseeditor.py @@ -234,7 +234,6 @@ class ParameterValueDelegate(QStyledItemDelegate): class ViewEditor(QWidget): - dataChanged = pyqtSignal() deletionRequested = pyqtSignal() @@ -396,7 +395,6 @@ class ViewEditor(QWidget): class ViewsEditor(QWidget): - dataChanged = pyqtSignal() def __init__(self, parent=None): @@ -490,7 +488,6 @@ class ViewsEditor(QWidget): class ProtocolEditor(QWidget): - dataChanged = pyqtSignal() deletionRequested = pyqtSignal() diff --git a/beat/editor/widgets/dataformateditor.py b/beat/editor/widgets/dataformateditor.py index 8f0f6ec3b5e6c8b25596aa28ae804924110e53a5..9aa351833322942f0df6deb401681a89862499b3 100644 --- a/beat/editor/widgets/dataformateditor.py +++ b/beat/editor/widgets/dataformateditor.py @@ -98,7 +98,6 @@ def default_object_dataformat(): class NameWidget(QWidget): - foldToggled = pyqtSignal(bool) deletionRequested = pyqtSignal() textChanged = pyqtSignal(str) diff --git a/beat/editor/widgets/experimenteditor.py b/beat/editor/widgets/experimenteditor.py index be4d3c75c0d6ce22418ef1c8c53c672042f0c835..b3d801593ad71a410c951b0ef1da0cf8574f2cd4 100644 --- a/beat/editor/widgets/experimenteditor.py +++ b/beat/editor/widgets/experimenteditor.py @@ -179,7 +179,6 @@ class ContainerWidget(ScrollWidget): class AbstractBaseEditor(QWidget): - dataChanged = pyqtSignal() prefixPathChanged = pyqtSignal(str) @@ -427,7 +426,6 @@ class DatasetEditor(AbstractBaseEditor): class AlgorithmParametersEditor(AbstractBaseEditor): - dataChanged = pyqtSignal() parameterCountChanged = pyqtSignal(int) @@ -700,7 +698,6 @@ class ExecutionPropertiesEditor(AbstractBaseEditor): @pyqtSlot(str) def __onAlgorithmChanged(self, algorithm_name): - if not algorithm_name or not self.json_object: return diff --git a/beat/editor/widgets/parameterwidget.py b/beat/editor/widgets/parameterwidget.py index abaec9dadbaf9b92d2d4c2eab2813cfecf9d6e16..49ce0d8f9ae93be1aede189cd14f633ad4802bb7 100644 --- a/beat/editor/widgets/parameterwidget.py +++ b/beat/editor/widgets/parameterwidget.py @@ -362,13 +362,11 @@ class StringSetupWidget(QWidget): self.choices_default_combobox.clear() def __setup_single_ui(self): - layout = QFormLayout() layout.addRow(self.tr("Default:"), self.single_default_lineedit) self.single_conf_widget.setLayout(layout) def __setup_choices_ui(self): - buttons_layout = QHBoxLayout() buttons_layout.addWidget(self.add_button) buttons_layout.addWidget(self.remove_button) @@ -679,13 +677,11 @@ class NumericalSetupWidget(QWidget): self.restrict_set_bounds(min_value, max_value, default_value) def __setup_single_ui(self): - layout = QFormLayout() layout.addRow(self.tr("Default:"), self.single_default_spinbox) self.single_conf_widget.setLayout(layout) def __setup_choices_ui(self): - buttons_layout = QHBoxLayout() buttons_layout.addWidget(self.add_button) buttons_layout.addWidget(self.remove_button) @@ -702,7 +698,6 @@ class NumericalSetupWidget(QWidget): self.choices_conf_widget.setLayout(layout) def __setup_range_ui(self): - layout = QFormLayout() layout.addRow(self.tr("Default:"), self.range_default_spinbox) layout.addRow(self.tr("Minimum:"), self.range_minimum_spinbox) @@ -712,7 +707,6 @@ class NumericalSetupWidget(QWidget): @pyqtSlot() def __onChoiceAddClicked(self): - input_value = None ok = False @@ -730,7 +724,6 @@ class NumericalSetupWidget(QWidget): @pyqtSlot() def __onChoiceRemoveClicked(self): - choices = self.choices_listwidget.selectedItems() for choice in choices: self.choices_default_combobox.removeItem( diff --git a/beat/editor/widgets/plottereditor.py b/beat/editor/widgets/plottereditor.py index 1ce50c6d0e57f086fe781e235df72b2e6e8d92f2..eb5d96923f2710bb9e13bc960e4175181091429a 100644 --- a/beat/editor/widgets/plottereditor.py +++ b/beat/editor/widgets/plottereditor.py @@ -48,7 +48,6 @@ from .validatedhelpers import NameLineEdit class ParameterViewer(QWidget): - dataChanged = pyqtSignal() deletionRequested = pyqtSignal() diff --git a/beat/editor/widgets/plotterparameterseditor.py b/beat/editor/widgets/plotterparameterseditor.py index 3d919c0911164136a3edaac9289254a663de1a31..e4d6ccb9a49eb46699953f38e4b40f9517bcf43a 100644 --- a/beat/editor/widgets/plotterparameterseditor.py +++ b/beat/editor/widgets/plotterparameterseditor.py @@ -175,7 +175,6 @@ class RestrictedParameterWidget(QWidget): self.single_ledit.setText(self.default) elif self._type == "bool": - self.bool_checkbox = QCheckBox() layout.addWidget(self.bool_checkbox) self.bool_checkbox.stateChanged.connect(self.dataChanged) @@ -196,7 +195,6 @@ class RestrictedParameterWidget(QWidget): self.__set_choice_default_value(str(self.default)) else: - min_value = self.current_type.numpy_info.min max_value = self.current_type.numpy_info.max @@ -256,7 +254,6 @@ class RestrictedParameterWidget(QWidget): class PlotterParameterViewer(QWidget): - dataChanged = pyqtSignal() deletionRequested = pyqtSignal() @@ -448,7 +445,6 @@ class PlotterParametersEditor(AbstractAssetEditor): # Fetch plotter json data if selected_plotter: - asset = Asset( self.plotter_model.prefix_path, self.plotter_model.asset_type, @@ -470,7 +466,6 @@ class PlotterParametersEditor(AbstractAssetEditor): reference_plotter_parameters = self.plotter_json_data.get("parameters", {}) for name, data in reference_plotter_parameters.items(): - if name in parameters: parameter_viewer = PlotterParameterViewer(name, data) parameter_viewer.load(parameters[name]) diff --git a/beat/editor/widgets/toolchaineditor.py b/beat/editor/widgets/toolchaineditor.py index aacf1bd7afd8cf81918ab54f9e5c1575887e5d27..d298bac732a1499f13904654f292f995e5b9b7c3 100644 --- a/beat/editor/widgets/toolchaineditor.py +++ b/beat/editor/widgets/toolchaineditor.py @@ -83,7 +83,6 @@ class BasePin(QGraphicsObject): dataChanged = pyqtSignal() def __init__(self, parent, pin, block, pin_brush, pin_pen): - super().__init__(parent=parent) # Highlight @@ -145,7 +144,6 @@ class BasePin(QGraphicsObject): ) if isinstance(target, BasePin): - if isinstance(self, OutputPin): start = self end = target @@ -156,7 +154,6 @@ class BasePin(QGraphicsObject): if Connection(self.block_object.connection_style).check_validity( start, end ): - # Find the corresponding channel connection_settings = {} if start.block_object.type == BlockType.DATASETS: @@ -201,7 +198,6 @@ class BasePin(QGraphicsObject): class InputPin(BasePin): def __init__(self, parent, pin, block, pin_brush, pin_pen): - super().__init__(parent, pin, block, pin_brush, pin_pen) def boundingRect(self): @@ -237,7 +233,6 @@ class InputPin(BasePin): class OutputPin(BasePin): def __init__(self, parent, pin, block, pin_brush, pin_pen): - super().__init__(parent, pin, block, pin_brush, pin_pen) def boundingRect(self): @@ -273,7 +268,6 @@ class OutputPin(BasePin): class Connection(QGraphicsPathItem): def __init__(self, style): - super().__init__() self.start_block_name = None @@ -300,7 +294,6 @@ class Connection(QGraphicsPathItem): return QGraphicsItem.itemChange(self, change, value) def set_style(self, config): - # Highlight self.setAcceptHoverEvents(True) self.setFlag(QGraphicsItem.ItemIsSelectable, True) @@ -313,7 +306,6 @@ class Connection(QGraphicsPathItem): self.connection_pen.setWidth(config["width"]) def drawCubicBezierCurve(self): - self.setPen(self.connection_pen) path = QPainterPath() @@ -344,7 +336,6 @@ class Connection(QGraphicsPathItem): self.drawCubicBezierCurve() def set_new_connection_pins_coordinates(self, selected_pin, mouse_position): - if isinstance(selected_pin, OutputPin): self.start_block_name = selected_pin.block self.start_pin_name = selected_pin.pin @@ -361,7 +352,6 @@ class Connection(QGraphicsPathItem): self.drawCubicBezierCurve() def check_validity(self, start, end): - # remove input-input and output-output connection if type(start) == type(end): return False @@ -379,7 +369,6 @@ class Connection(QGraphicsPathItem): return True def load(self, toolchain, connection_details, channel_colors): - self.start_block_name = connection_details["from"].split(".")[0] self.start_pin_name = connection_details["from"].split(".")[1] self.end_block_name = connection_details["to"].split(".")[0] @@ -617,7 +606,6 @@ class LoopDialog(QDialog): sequential_loop_evaluator_list, autonomous_loop_evaluator_list, ): - self.loop_widget.set_sequential_loop_processor_list( sequential_loop_processor_list ) @@ -848,7 +836,6 @@ class Block(QGraphicsObject): self.create_pins() def create_pins(self): - if self.type == BlockType.LOOPS: for pin_name in self.processor_inputs: input_pin = InputPin( @@ -901,7 +888,6 @@ class Block(QGraphicsObject): output_pin.dataChanged.connect(self.dataChanged) def set_style(self, config): - self.setAcceptHoverEvents(True) self.setFlag(QGraphicsItem.ItemIsSelectable, True) self.setFlag(QGraphicsItem.ItemIsMovable, True) diff --git a/beat/editor/widgets/toolchainscene.py b/beat/editor/widgets/toolchainscene.py index 76cc666ab61c0d5dac643a7a1a9e8a2d62ae2cc9..5a880cef4cc10c96853e23f8e968b6c5397ddfcd 100644 --- a/beat/editor/widgets/toolchainscene.py +++ b/beat/editor/widgets/toolchainscene.py @@ -34,7 +34,6 @@ class ToolchainScene(QGraphicsScene): """Playground scene for block objects""" def __init__(self, configuration): - super().__init__() self.grid_size = configuration.get("grid_size", 36) diff --git a/doc/get_dep_licenses.py b/doc/get_dep_licenses.py index b83cb9d618820c73fa8a70e65d28609f9baca420..cf9327f7e69e4b1e3426ff76719fc717d1e56091 100755 --- a/doc/get_dep_licenses.py +++ b/doc/get_dep_licenses.py @@ -86,7 +86,6 @@ def _clean_pkg_name(name): if __name__ == "__main__": - arguments = sys.argv[1:] prog = os.path.basename(sys.argv[0])