Skip to content

Commit

Permalink
ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhroom committed Nov 4, 2024
1 parent d371271 commit 9f14ca7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions rascal2/widgets/delegates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions rascal2/widgets/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down Expand Up @@ -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 (
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tests/widgets/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9f14ca7

Please sign in to comment.