Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 26, 2024
1 parent 2e43346 commit 2d32bcc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion reflectivity_ui/interfaces/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ def open_polarization_window(self):

def open_rawdata_dialog(self):
return NotImplemented

def open_deadtime_settings(self):
r"""Show the dialog for dead-time options. Update attribue deadtime options upon closing the dialog."""
view = DeadTimeSettingsView(parent=self)
Expand Down
6 changes: 3 additions & 3 deletions reflectivity_ui/ui/deadtime_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


class DeadTimeEntryPoint(QGroupBox):
def __init__(self, title='Dead Time Correction'):
def __init__(self, title="Dead Time Correction"):
super().__init__(title)
self.initUI()

Expand All @@ -22,9 +22,9 @@ def initUI(self):
"}"
)

self.applyCheckBox = QCheckBox('Apply', self)
self.applyCheckBox = QCheckBox("Apply", self)
self.applyCheckBox.stateChanged.connect(self.toggleSettingsButton)
self.settingsButton = QPushButton('Settings', self)
self.settingsButton = QPushButton("Settings", self)
self.settingsButton.setEnabled(self.applyCheckBox.isChecked()) # enabled if we use the correction

# Create a horizontal layout for the checkbox and settings button
Expand Down
9 changes: 5 additions & 4 deletions reflectivity_ui/ui/deadtime_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
from qtpy.uic import loadUi


class DeadTimeSettingsModel():
class DeadTimeSettingsModel:
"""Stores all options for the dead time correction. These are global options"""

apply_deadtime: bool = False
paralyzable: bool = True
dead_time: float = 4.2
tof_step: float = 100.0


class DeadTimeSettingsView(QDialog):
"""
Dialog to choose the dead time correction options.
Expand Down Expand Up @@ -47,9 +48,9 @@ def get_state_from_form(self) -> dict:
Dictionary whose keys must match fields of class `DeadTimeSettingsModel`
"""
return {
'paralyzable': self.ui.use_paralyzable.isChecked(),
'dead_time': self.ui.dead_time_value.value(),
'tof_step': self.ui.dead_time_tof.value(),
"paralyzable": self.ui.use_paralyzable.isChecked(),
"dead_time": self.ui.dead_time_value.value(),
"tof_step": self.ui.dead_time_tof.value(),
}

def accept(self):
Expand Down

0 comments on commit 2d32bcc

Please sign in to comment.