mirror of https://gitlab.com/pamhyr/pamhyr2
fix pep8 rules
parent
6165719829
commit
13a44264ac
|
|
@ -329,7 +329,8 @@ class BoundaryCondition(SQLSubModel):
|
|||
return new
|
||||
|
||||
table = execute(
|
||||
"SELECT pamhyr_id, deleted, name, type, node, d50, sigma, scenario " +
|
||||
"SELECT pamhyr_id, deleted, name, type, node, d50, sigma, " +
|
||||
"scenario " +
|
||||
"FROM boundary_condition " +
|
||||
f"WHERE tab = '{tab}' " +
|
||||
f"AND scenario = {scenario.id} " +
|
||||
|
|
@ -355,11 +356,14 @@ class BoundaryCondition(SQLSubModel):
|
|||
status=data['status'],
|
||||
owner_scenario=owner_scenario
|
||||
)
|
||||
|
||||
if deleted:
|
||||
bc.set_as_deleted()
|
||||
if t=="SL":
|
||||
|
||||
if t == "SL":
|
||||
bc.d50 = d50
|
||||
bc.sigma = sigma
|
||||
|
||||
bc.node = None
|
||||
if node != -1:
|
||||
bc.node = next(filter(lambda n: n.id == node, nodes), None)
|
||||
|
|
|
|||
|
|
@ -302,7 +302,8 @@ class BoundaryConditionAdisTS(SQLSubModel):
|
|||
|
||||
if pol_id not in pid_pol:
|
||||
# ⚠️ cas important : probablement déjà migré
|
||||
print(f"[WARN] pol_id {pol_id} not in pid_pol → probably already migrated")
|
||||
print(f"[WARN] pol_id {pol_id} not in pid_pol " +
|
||||
f"→ probably already migrated")
|
||||
continue
|
||||
|
||||
execute(
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ from tools import (
|
|||
from Model.Tools.PamhyrDB import SQLSubModel
|
||||
from Model.Except import NotImplementedMethodeError
|
||||
from Model.Scenario import Scenario
|
||||
from Model.BoundaryConditionsAdisTS.BoundaryConditionAdisTS import BoundaryConditionAdisTS
|
||||
from Model.BoundaryConditionsAdisTS.BoundaryConditionAdisTS import (
|
||||
BoundaryConditionAdisTS,
|
||||
)
|
||||
|
||||
logger = logging.getLogger()
|
||||
|
||||
|
|
@ -423,8 +425,11 @@ class Pollutants(SQLSubModel):
|
|||
execute, data=data
|
||||
)
|
||||
|
||||
new_pollutant._boundary_conditions_adists = BoundaryConditionAdisTS._db_load(
|
||||
execute, data=data
|
||||
new_pollutant._boundary_conditions_adists = (
|
||||
BoundaryConditionAdisTS._db_load(
|
||||
execute,
|
||||
data=data
|
||||
)
|
||||
)
|
||||
|
||||
loaded.add(pid)
|
||||
|
|
|
|||
|
|
@ -313,7 +313,8 @@ class SQLSubModel(PamhyrID):
|
|||
|
||||
if node_id not in nodes:
|
||||
# ⚠️ cas important : probablement déjà migré
|
||||
print(f"[WARN] node_id {node_id} not in nodes → probably already migrated")
|
||||
print(f"[WARN] node_id {node_id} not in nodes " +
|
||||
f"→ probably already migrated")
|
||||
continue
|
||||
|
||||
execute(
|
||||
|
|
|
|||
|
|
@ -112,7 +112,8 @@ class ComboBoxDelegate(QItemDelegate):
|
|||
|
||||
|
||||
class TableModel(PamhyrTableModel):
|
||||
def __init__(self, bc_list=None, pollutant_bc_list=None, trad=None, **kwargs):
|
||||
def __init__(self, bc_list=None, pollutant_bc_list=None,
|
||||
trad=None, **kwargs):
|
||||
self._trad = trad
|
||||
self._bc_list = bc_list
|
||||
self._pollutant = pollutant_bc_list.id
|
||||
|
|
|
|||
|
|
@ -58,7 +58,8 @@ class BoundaryConditionAdisTSWindow(PamhyrWindow):
|
|||
_pamhyr_ui = "BoundaryConditionsAdisTS"
|
||||
_pamhyr_name = "Boundary conditions AdisTS"
|
||||
|
||||
def __init__(self, data=None, pollutant_id=None, study=None, config=None, parent=None):
|
||||
def __init__(self, data=None, pollutant_id=None, study=None,
|
||||
config=None, parent=None):
|
||||
self._data = data
|
||||
self._pollutant_id = pollutant_id
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class D90TableModel(PamhyrTableModel):
|
|||
def _setup_lst(self):
|
||||
self._lst = list(
|
||||
filter(
|
||||
lambda d90: d90._deleted == False,
|
||||
lambda d90: d90._deleted is False,
|
||||
self._data._data
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ from View.Tools.PamhyrWindow import PamhyrDialog
|
|||
from PyQt5.QtWidgets import QDoubleSpinBox
|
||||
from View.Tools.FlexibleDoubleSpinBox import FlexibleDoubleSpinBox
|
||||
|
||||
|
||||
class ShiftDialog(PamhyrDialog):
|
||||
_pamhyr_ui = "GeometryReachShift"
|
||||
_pamhyr_name = "Shift"
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class InitialConditionTableModel(PamhyrTableModel):
|
|||
def _setup_lst(self):
|
||||
self._lst = list(
|
||||
filter(
|
||||
lambda ica: ica._deleted == False,
|
||||
lambda ica: ica._deleted is False,
|
||||
self._data._data
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -229,7 +229,8 @@ class PollutantsWindow(PamhyrWindow):
|
|||
for row in rows:
|
||||
pollutant_id = self._pollutants_lst.get(row).id
|
||||
|
||||
bclist = self._study.river.boundary_conditions_adists.BCs_AdisTS_List
|
||||
river = self._study.river
|
||||
bclist = river.boundary_conditions_adists.BCs_AdisTS_List
|
||||
bcs_adists = [
|
||||
x for x in bclist
|
||||
if x.pollutant == pollutant_id
|
||||
|
|
|
|||
Loading…
Reference in New Issue