From b0e0dc75f17307ccf907772cd2c165b108f77938 Mon Sep 17 00:00:00 2001 From: Dylan Jeannin Date: Fri, 11 Sep 2026 14:17:04 +0200 Subject: [PATCH] Fix pep8 --- src/Solver/Mage.py | 3 ++- src/View/Geometry/PlotAC.py | 6 +++--- src/View/Geometry/Window.py | 15 ++++++++++----- src/View/MainWindow.py | 3 ++- src/View/Network/ProfileDialog.py | 3 ++- src/View/Translate.py | 3 ++- 6 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/Solver/Mage.py b/src/Solver/Mage.py index 9f8bcd81..f82f05a1 100644 --- a/src/Solver/Mage.py +++ b/src/Solver/Mage.py @@ -374,7 +374,8 @@ class Mage(CommandLineSolver): files = files + self._export_BC( study, "LIM", LIM, repertory, qlog, name=name ) - files = files + self._export_QSO(study, QSO, repertory, qlog, name=name) + files = files + self._export_QSO(study, QSO, repertory, + qlog, name=name) return files diff --git a/src/View/Geometry/PlotAC.py b/src/View/Geometry/PlotAC.py index 9feba1d3..cb287e2b 100644 --- a/src/View/Geometry/PlotAC.py +++ b/src/View/Geometry/PlotAC.py @@ -193,7 +193,7 @@ class PlotAC(PamhyrPlot): self.next_plot_selected.set_data([], []) if (0 <= previous_id < self.data.number_profiles - and not self._parent.tableView.isRowHidden(previous_id)): + and not self._parent.tableView.isRowHidden(previous_id)): self.previous_plot_selected.set_data( self.data.profile(previous_id).get_station(), self.data.profile(previous_id).z() @@ -201,7 +201,7 @@ class PlotAC(PamhyrPlot): self.previous_plot_selected.set_visible(True) if (0 <= profile_id < self.data.number_profiles - and not self._parent.tableView.isRowHidden(profile_id)): + and not self._parent.tableView.isRowHidden(profile_id)): self.plot_selected.set_data( self.data.profile(profile_id).get_station(), self.data.profile(profile_id).z() @@ -209,7 +209,7 @@ class PlotAC(PamhyrPlot): self.plot_selected.set_visible(True) if (0 <= next_id < self.data.number_profiles - and not self._parent.tableView.isRowHidden(next_id)): + and not self._parent.tableView.isRowHidden(next_id)): self.next_plot_selected.set_data( self.data.profile(next_id).get_station(), self.data.profile(next_id).z() diff --git a/src/View/Geometry/Window.py b/src/View/Geometry/Window.py index e6a706ac..3a0fba58 100644 --- a/src/View/Geometry/Window.py +++ b/src/View/Geometry/Window.py @@ -206,9 +206,12 @@ class GeometryWindow(PamhyrWindow): self.find(QCheckBox, "checkBox_show_interpolated").toggled.connect( self.update_redraw ) - self._table.modelReset.connect(self.update_interpolated_profiles_visibility) - self._table.rowsInserted.connect(self.update_interpolated_profiles_visibility) - self._table.rowsRemoved.connect(self.update_interpolated_profiles_visibility) + self._table.modelReset.connect( + self.update_interpolated_profiles_visibility) + self._table.rowsInserted.connect( + self.update_interpolated_profiles_visibility) + self._table.rowsRemoved.connect( + self.update_interpolated_profiles_visibility) if self._study.is_read_only(): actions = { "action_export": self.export_to_file, @@ -255,7 +258,8 @@ class GeometryWindow(PamhyrWindow): ).isChecked() selection = self.tableView.selectionModel() for row in range(self._table.rowCount()): - hidden = not show_interpolated and self._reach.profile(row).interpolated + hidden = not show_interpolated \ + and self._reach.profile(row).interpolated self.tableView.setRowHidden(row, hidden) if hidden: selection.select( @@ -263,7 +267,8 @@ class GeometryWindow(PamhyrWindow): QItemSelectionModel.Deselect | QItemSelectionModel.Rows ) if selection.currentIndex().row() == row: - selection.setCurrentIndex(QModelIndex(), QItemSelectionModel.NoUpdate) + selection.setCurrentIndex(QModelIndex(), + QItemSelectionModel.NoUpdate) def update_redraw(self): self._update(redraw=True) diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py index 3e606617..ad4e7e73 100644 --- a/src/View/MainWindow.py +++ b/src/View/MainWindow.py @@ -919,7 +919,8 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): ################## def ensure_current_reach(self): - """Offer a reach selection when needed; return False on cancellation.""" + """Offer a reach selection when needed; + return False on cancellation.""" if self._study is None: return False river = self._study.river diff --git a/src/View/Network/ProfileDialog.py b/src/View/Network/ProfileDialog.py index f37c6ba8..6fc1680e 100644 --- a/src/View/Network/ProfileDialog.py +++ b/src/View/Network/ProfileDialog.py @@ -93,7 +93,8 @@ class SelectProfileDialog(PamhyrDialog): for index in range(len(self._profiles)): if index not in self._selectable_indices: item = combobox.model().item(index) - item.setFlags(item.flags() & ~(Qt.ItemIsEnabled | Qt.ItemIsSelectable)) + item.setFlags(item.flags() & + ~(Qt.ItemIsEnabled | Qt.ItemIsSelectable)) combobox.setCurrentIndex( self._selectable_indices[0] if self._selectable_indices else -1 diff --git a/src/View/Translate.py b/src/View/Translate.py index 430f917c..0a5ce138 100644 --- a/src/View/Translate.py +++ b/src/View/Translate.py @@ -210,7 +210,8 @@ class MainTranslate(UnitTranslate): "MainWindow", "Warning" ) self._dict["no_reach"] = _translate( - "MainWindow", "Create a reach in the network before opening this window." + "MainWindow", + "Create a reach in the network before opening this window." ) self._dict["mb_last_open_title"] = _translate(