more pep8

This commit is contained in:
Theophile Terraz committed 2024-11-29 11:52:06 +01:00
1 parent 3b8a49d429
commit a317cd849f
38 files changed
+241 -125

No files matched your search

@@ -31,6 +31,7 @@ _translate = QCoreApplication.translate
logger = logging.getLogger()
class Plot(PamhyrPlot):
def __init__(self, mode="time", data=None,
trad=None, canvas=None, toolbar=None,
@@ -120,4 +120,3 @@ class TableModel(PamhyrTableModel):
)
self.endRemoveRows()
@@ -23,7 +23,8 @@ from PyQt5.QtWidgets import (
QMessageBox, QUndoCommand, QUndoStack,
)
from Model.LateralContributionsAdisTS.LateralContributionAdisTS import LateralContributionAdisTS
from Model.LateralContributionsAdisTS.LateralContributionAdisTS \
import LateralContributionAdisTS
class SetDataCommand(QUndoCommand):
@@ -39,15 +40,23 @@ class SetDataCommand(QUndoCommand):
def undo(self):
if self._column == 0:
self._data._data[self._index] = (self._old, self._data._data[self._index][1])
self._data._data[self._index] = (
self._old, self._data._data[self._index][1]
)
else:
self._data._data[self._index] = (self._data._data[self._index][0], self._old)
self._data._data[self._index] = (
self._data._data[self._index][0], self._old
)
def redo(self):
if self._column == 0:
self._data._data[self._index] = (self._new, self._data._data[self._index][1])
self._data._data[self._index] = (
self._new, self._data._data[self._index][1]
)
else:
self._data._data[self._index] = (self._data._data[self._index][0], self._new)
self._data._data[self._index] = (
self._data._data[self._index][0], self._new
)
class AddCommand(QUndoCommand):
@@ -63,10 +72,15 @@ class AddCommand(QUndoCommand):
def redo(self):
if self._new is None:
self._new = self._data._data.insert(self._index, (self._data._types[0](0), self._data._types[1](0.0)))
self._new = self._data._data.insert(
self._index, (
self._data._types[0](0), self._data._types[1](0.0)
)
)
else:
self._data._data.insert(self._index, self._new)
class DelCommand(QUndoCommand):
def __init__(self, data, rows):
QUndoCommand.__init__(self)
@@ -68,7 +68,10 @@ class EditLateralContributionAdisTSWindow(PamhyrWindow):
if self._data is not None:
if self._data.edge is not None:
edge_name = next(filter(lambda edge: edge.id == self._data.edge, self._study.river.edges())).name
edge_name = next(filter(
lambda edge: edge.id == self._data.edge,
self._study.river.edges()
)).name
else:
edge_name = trad['not_associated']