From dd5eecb1e291b056da024792f2344946133ca283 Mon Sep 17 00:00:00 2001 From: Theophile Terraz Date: Mon, 24 Nov 2025 15:17:51 +0100 Subject: [PATCH] pep8 --- src/View/Geometry/Window.py | 4 ++- src/View/InitialConditions/Table.py | 6 ++-- src/View/Results/Table.py | 2 -- src/View/Results/Window.py | 44 ----------------------------- 4 files changed, 6 insertions(+), 50 deletions(-) diff --git a/src/View/Geometry/Window.py b/src/View/Geometry/Window.py index 999ee561..f00cfc89 100644 --- a/src/View/Geometry/Window.py +++ b/src/View/Geometry/Window.py @@ -320,7 +320,9 @@ class GeometryWindow(PamhyrWindow): index = QItemSelection() if len(ind) > 0: for i in ind: - index.append(QItemSelectionRange(self.tableView.model().index(i, 0))) + index.append(QItemSelectionRange( + self.tableView.model().index(i, 0)) + ) selection.select( index, QItemSelectionModel.Rows | diff --git a/src/View/InitialConditions/Table.py b/src/View/InitialConditions/Table.py index 47425fa0..9dac0a13 100644 --- a/src/View/InitialConditions/Table.py +++ b/src/View/InitialConditions/Table.py @@ -296,11 +296,11 @@ class InitialConditionTableModel(PamhyrTableModel): formated = False if len(line_split[0]) > 3: formated = True - elif len(line_split[2]) > 10: + elif len(line_split[2]) > 10: formated = True - elif len(line_split[3]) > 11: + elif len(line_split[3]) > 11: formated = True - elif len(line_split[4]) > 9: + elif len(line_split[4]) > 9: formated = True if formated: # old PamHyr format diff --git a/src/View/Results/Table.py b/src/View/Results/Table.py index a1bcbbb3..ee1bd67f 100644 --- a/src/View/Results/Table.py +++ b/src/View/Results/Table.py @@ -157,8 +157,6 @@ class TableModel(PamhyrTableModel): self._lst = _river.reachs elif self._opt_data == "profile" or self._opt_data == "raw_data": self._lst = _river.reach(reach).profiles - # self._lst = list(compress(_river.reach(reach).profiles, - # _river.reach(reach).profile_mask)) elif self._opt_data == "solver": self._lst = self._parent._solvers diff --git a/src/View/Results/Window.py b/src/View/Results/Window.py index 36550c9c..ad028eb1 100644 --- a/src/View/Results/Window.py +++ b/src/View/Results/Window.py @@ -1168,48 +1168,4 @@ class ResultsWindow(PamhyrWindow): self.update_table_selection_profile(profile_id) def import_geotiff(self): -# options = QFileDialog.Options() -# settings = QSettings(QSettings.IniFormat, -# QSettings.UserScope, 'MyOrg', ) -# options |= QFileDialog.DontUseNativeDialog -# -# file_types = [ -# self._trad["file_geotiff"], -# self._trad["file_all"], -# ] -# -# filename, _ = QFileDialog.getOpenFileName( -# self, -# self._trad["open_file"], -# "", -# ";; ".join(file_types), -# options=options -# ) -# -# if filename != "": -# with rasterio.open(filename) as data: -# img = data.read() -# b = data.bounds[:] -# # b[0] left -# # b[1] bottom -# # b[2] right -# # b[3] top -# xlim = self.canvas.axes.get_xlim() -# ylim = self.canvas.axes.get_ylim() -# if b[2] > b[0] and b[1] < b[3]: -# self.canvas.axes.imshow(img.transpose((1, 2, 0)), -# extent=[b[0], b[2], b[1], b[3]]) -# else: -# dlg = CoordinatesDialog( -# xlim, -# ylim, -# trad=self._trad, -# parent=self -# ) -# if dlg.exec(): -# self.canvas.axes.imshow(img.transpose((1, 2, 0)), -# extent=dlg.values) -# self.plot_xy.idle() -# self.canvas.axes.set_xlim(xlim) -# self.canvas.axes.set_ylim(ylim) return