From 9f14ca76e74104bfc0ab1f25579b3a1b7873a8b1 Mon Sep 17 00:00:00 2001 From: alexhroom Date: Mon, 4 Nov 2024 14:45:21 +0000 Subject: [PATCH] ruff format --- rascal2/widgets/delegates.py | 1 + rascal2/widgets/project.py | 8 ++++---- tests/widgets/test_project.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/rascal2/widgets/delegates.py b/rascal2/widgets/delegates.py index adf34a8..f98dd1c 100644 --- a/rascal2/widgets/delegates.py +++ b/rascal2/widgets/delegates.py @@ -43,6 +43,7 @@ class ValueSpinBoxDelegate(QtWidgets.QStyledItemDelegate): The field of the parameter """ + def __init__(self, field: Literal["min", "value", "max"], parent): super().__init__(parent) self.table = parent diff --git a/rascal2/widgets/project.py b/rascal2/widgets/project.py index 65a03d4..5dd328d 100644 --- a/rascal2/widgets/project.py +++ b/rascal2/widgets/project.py @@ -217,7 +217,6 @@ def handle_controls_update(self): for tab in self.tabs: self.view_tabs[tab].handle_controls_update(controls) self.edit_tabs[tab].handle_controls_update(controls) - def show_project_view(self) -> None: """Show project view""" @@ -299,7 +298,6 @@ def setData(self, index, value, role=QtCore.Qt.ItemDataRole.EditRole) -> bool: return False return True return False - def headerData(self, section, orientation, role=QtCore.Qt.ItemDataRole.DisplayRole): if ( @@ -435,7 +433,7 @@ def delete_item(self, index): if self.model is not None: self.model.delete_item(index) - # call edit again to recreate delete buttons + # call edit again to recreate delete buttons self.edit() def edit(self): @@ -473,7 +471,9 @@ def set_item_delegates(self): def update_model(self, classlist): super().update_model(classlist) header = self.table.horizontalHeader() - header.setSectionResizeMode(self.model.headers.index("fit")+1, QtWidgets.QHeaderView.ResizeMode.ResizeToContents) + header.setSectionResizeMode( + self.model.headers.index("fit") + 1, QtWidgets.QHeaderView.ResizeMode.ResizeToContents + ) def handle_bayesian_columns(self, procedure: Procedures): """Hide or show Bayes-related columns based on procedure. diff --git a/tests/widgets/test_project.py b/tests/widgets/test_project.py index 160f019..51dfec4 100644 --- a/tests/widgets/test_project.py +++ b/tests/widgets/test_project.py @@ -408,7 +408,7 @@ def test_hidden_bayesian_columns(param_classlist): index = widget.model.headers.index(item) assert widget.table.isColumnHidden(index + 1) - widget.handle_bayesian_columns("dream") + widget.handle_bayesian_columns("dream") for item in bayesian_columns: index = widget.model.headers.index(item)