mirror of https://gitlab.com/pamhyr/pamhyr2
pep8
parent
3693c32d4b
commit
845bf3c325
|
|
@ -374,8 +374,8 @@ class BoundaryCondition(SQLSubModel):
|
||||||
|
|
||||||
def reach(self, river):
|
def reach(self, river):
|
||||||
edges = []
|
edges = []
|
||||||
if self._node != None:
|
if self._node is not None:
|
||||||
if river != None:
|
if river is not None:
|
||||||
for edge in river.edges():
|
for edge in river.edges():
|
||||||
if edge.node1.name == self._node.name:
|
if edge.node1.name == self._node.name:
|
||||||
edges.append(edge.reach)
|
edges.append(edge.reach)
|
||||||
|
|
|
||||||
|
|
@ -211,4 +211,3 @@ class TableModel(PamhyrTableModel):
|
||||||
)
|
)
|
||||||
self.layoutAboutToBeChanged.emit()
|
self.layoutAboutToBeChanged.emit()
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -182,6 +182,7 @@ class PasteCommand(QUndoCommand):
|
||||||
for bc in self._bcs:
|
for bc in self._bcs:
|
||||||
self._data.insert(self._row, bc)
|
self._data.insert(self._row, bc)
|
||||||
|
|
||||||
|
|
||||||
class ReplaceDataCommand(QUndoCommand):
|
class ReplaceDataCommand(QUndoCommand):
|
||||||
def __init__(self, data, data1, data2):
|
def __init__(self, data, data1, data2):
|
||||||
QUndoCommand.__init__(self)
|
QUndoCommand.__init__(self)
|
||||||
|
|
|
||||||
|
|
@ -196,8 +196,12 @@ class EditBoundaryConditionWindow(PamhyrWindow):
|
||||||
self.find(QAction, "action_add").triggered.connect(self.add)
|
self.find(QAction, "action_add").triggered.connect(self.add)
|
||||||
self.find(QAction, "action_del").triggered.connect(self.delete)
|
self.find(QAction, "action_del").triggered.connect(self.delete)
|
||||||
self.find(QAction, "action_sort").triggered.connect(self.sort)
|
self.find(QAction, "action_sort").triggered.connect(self.sort)
|
||||||
self.find(QAction, "action_generate_uniform").triggered.connect(self.generate_uniform)
|
self.find(QAction, "action_generate_uniform").triggered.connect(
|
||||||
self.find(QAction, "action_generate_critical").triggered.connect(self.generate_critical)
|
self.generate_uniform
|
||||||
|
)
|
||||||
|
self.find(QAction, "action_generate_critical").triggered.connect(
|
||||||
|
self.generate_critical
|
||||||
|
)
|
||||||
if self._data.bctype != "ZD" or not self._data.has_node:
|
if self._data.bctype != "ZD" or not self._data.has_node:
|
||||||
self.find(QAction, "action_generate_uniform").setVisible(False)
|
self.find(QAction, "action_generate_uniform").setVisible(False)
|
||||||
self.find(QAction, "action_generate_critical").setVisible(False)
|
self.find(QAction, "action_generate_critical").setVisible(False)
|
||||||
|
|
@ -334,10 +338,8 @@ class EditBoundaryConditionWindow(PamhyrWindow):
|
||||||
strickler = 25
|
strickler = 25
|
||||||
height = [(i)*(z_max-z_min)/50 for i in range(51)]
|
height = [(i)*(z_max-z_min)/50 for i in range(51)]
|
||||||
q = [((profile.wet_width(z_min + h) * 0.8) * strickler
|
q = [((profile.wet_width(z_min + h) * 0.8) * strickler
|
||||||
* (h ** (5/3))
|
* (h ** (5/3)) * (abs(incline) ** (0.5)))
|
||||||
* (abs(incline) ** (0.5)))
|
for h in height]
|
||||||
for h in height
|
|
||||||
]
|
|
||||||
self._table.replace_data(height, q)
|
self._table.replace_data(height, q)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
@ -351,8 +353,8 @@ class EditBoundaryConditionWindow(PamhyrWindow):
|
||||||
z_min = profile.z_min()
|
z_min = profile.z_min()
|
||||||
z_max = profile.z_max()
|
z_max = profile.z_max()
|
||||||
height = [(i)*(z_max-z_min)/50 for i in range(51)]
|
height = [(i)*(z_max-z_min)/50 for i in range(51)]
|
||||||
q = [sqrt(9.81 * (profile.wet_area(z_min + h) ** 3) / profile.wet_width(z_min + h))
|
q = [sqrt(9.81 * (profile.wet_area(z_min + h) ** 3)
|
||||||
for h in height
|
/ profile.wet_width(z_min + h))
|
||||||
]
|
for h in height]
|
||||||
self._table.replace_data(height, q)
|
self._table.replace_data(height, q)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,8 @@ class ResultsWindow(PamhyrWindow):
|
||||||
undo=self._undo_stack,
|
undo=self._undo_stack,
|
||||||
opt_data=t
|
opt_data=t
|
||||||
)
|
)
|
||||||
self._table[t]._timestamp = self._timestamps[self._slider_time.value()]
|
self._table[t]._timestamp = self._timestamps[
|
||||||
|
self._slider_time.value()]
|
||||||
|
|
||||||
def setup_slider(self):
|
def setup_slider(self):
|
||||||
self._slider_profile = self.find(QSlider, f"verticalSlider_profile")
|
self._slider_profile = self.find(QSlider, f"verticalSlider_profile")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue