Skip to content

Commit

Permalink
Update deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
JHolba committed Dec 30, 2024
1 parent 28e191c commit 6a7dbe9
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/ert/gui/ertwidgets/analysismoduleedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ def showVariablesPopup(self) -> None:
variable_dialog,
self.parent(), # type: ignore
)
dialog.exec_()
dialog.exec()
2 changes: 1 addition & 1 deletion src/ert/gui/ertwidgets/checklist.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def showContextMenu(self, point: QPoint) -> None:
menu.addSeparator()
clear_selection = menu.addAction("Clear selection")

selected_item = menu.exec_(p)
selected_item = menu.exec(p)

if selected_item == check_selected:
self.checkSelected()
Expand Down
2 changes: 1 addition & 1 deletion src/ert/gui/ertwidgets/customdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def showAndTell(self) -> int:
Shows the dialog modally and returns the true or false (accept/reject)
"""
self.optionValidationChanged()
return self.exec_()
return self.exec()

@staticmethod
def createSpace(size: int = 5) -> QWidget:
Expand Down
2 changes: 1 addition & 1 deletion src/ert/gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def show_window() -> int:
window.show()
window.activateWindow()
window.raise_()
return app.exec_()
return app.exec()

# ens_path is None indicates that there was an error in the setup and
# window is now just showing that error message, in which
Expand Down
2 changes: 1 addition & 1 deletion src/ert/gui/simulation/ensemble_experiment_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def on_show_dm_params_clicked(self, design_matrix: DesignMatrix) -> None:
viewer.setMinimumHeight(500)
viewer.setMinimumWidth(1000)
viewer.adjustSize()
viewer.exec_()
viewer.exec()

@Slot(ExperimentConfigPanel)
def experimentTypeChanged(self, w: ExperimentConfigPanel) -> None:
Expand Down
4 changes: 2 additions & 2 deletions src/ert/gui/simulation/run_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def _fm_step_clicked(self, index: QModelIndex) -> None:
layout.addWidget(dialog_button)
error_dialog.resize(700, 300)
error_textedit.moveCursor(QTextCursor.MoveOperation.Start)
error_dialog.exec_()
error_dialog.exec()

def mouseMoveEvent(self, event: QMouseEvent) -> None:
if event:
Expand Down Expand Up @@ -511,7 +511,7 @@ def restart_failed_realizations(self) -> None:
QMessageBox.StandardButton.Ok | QMessageBox.StandardButton.Cancel
)
msg.setObjectName("restart_prompt")
result = msg.exec_()
result = msg.exec()

if result == QMessageBox.StandardButton.Ok:
self.restart_button.setVisible(False)
Expand Down
4 changes: 2 additions & 2 deletions src/ert/gui/tools/load_results/load_results_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ def load(self) -> int:
msg = ErtMessageBox(
f"Successfully loaded {loaded} realizations", "\n".join(messages)
)
msg.exec_()
msg.exec()
else:
msg = ErtMessageBox("No realizations loaded", "\n".join(messages))
msg.exec_()
msg.exec()
return loaded

def refresh(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/ert/gui/tools/load_results/load_results_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def trigger(self) -> None:
self._loadButton.setEnabled(False)
self._loadButton.setToolTip("Must load into a ensemble")
assert self._dialog is not None
self._dialog.exec_()
self._dialog.exec()

def load(self, _: Any) -> None:
assert self._dialog is not None
Expand Down
2 changes: 1 addition & 1 deletion src/ert/gui/tools/manage_experiments/storage_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def _currentChanged(self, selected: QModelIndex, previous: QModelIndex) -> None:
def _addItem(self) -> None:
create_experiment_dialog = CreateExperimentDialog(self._notifier, parent=self)
create_experiment_dialog.show()
if create_experiment_dialog.exec_():
if create_experiment_dialog.exec():
ensemble = self._notifier.storage.create_experiment(
parameters=self._ert_config.ensemble_config.parameter_configuration,
responses=self._ert_config.ensemble_config.response_configuration,
Expand Down
2 changes: 1 addition & 1 deletion src/ert/gui/tools/plot/customize/customize_plot_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def __init__(

def initiateCopyStyleToDialog(self) -> None:
dialog = CopyStyleToDialog(self, self.current_key, self._key_defs)
if dialog.exec_():
if dialog.exec():
self.copySettingsToOthers.emit(dialog.getSelectedKeys())

def addCopyableKey(self, key: str | QListWidgetItem) -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/ert/gui/tools/plot/plottery/plots/std_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def plot(
im = ax_heat.imshow(data, cmap="viridis", aspect="equal")
heatmaps.append(im)

ax_box.boxplot(data.flatten(), vert=True, widths=0.5)
ax_box.boxplot(data.flatten(), orientation="vertical", widths=0.5)
boxplot_axes.append(ax_box)

min_value = np.min(data)
Expand Down
6 changes: 3 additions & 3 deletions src/ert/gui/tools/plugins/process_job_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ def __presentInformation(self, title: str, message: str, details: str) -> None:
self._msg_box = self.__createMsgBox(title, message, details)
self._msg_box.setIcon(QMessageBox.Icon.Information)

self._msg_box.exec_()
self._msg_box.exec()

def __presentError(self, title: str, message: str, details: str) -> None:
self._msg_box = self.__createMsgBox(title, message, details)
self._msg_box.setIcon(QMessageBox.Icon.Critical)

self._msg_box.exec_()
self._msg_box.exec()

def __confirmCancel(self) -> None:
cancel_box = self.__createMsgBox(
Expand All @@ -134,7 +134,7 @@ def __confirmCancel(self) -> None:
cancel_box.setStandardButtons(
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No
)
cancel_box.exec_()
cancel_box.exec()

cancel = cancel_box.result()

Expand Down
2 changes: 1 addition & 1 deletion src/ert/gui/tools/workflows/workflows_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ def __init__(self, config: ErtConfig, notifier: ErtNotifier) -> None:
def trigger(self) -> None:
run_workflow_widget = RunWorkflowWidget(self.config, self.notifier)
dialog = ClosableDialog("Run workflow", run_workflow_widget, self.parent()) # type: ignore
dialog.exec_()
dialog.exec()
self.notifier.emitErtChange() # workflow may have added new cases.

0 comments on commit 6a7dbe9

Please sign in to comment.