mirror of https://gitlab.com/pamhyr/pamhyr2
Clean code: Remove some print function call.
parent
190ca5d171
commit
7cb3ac8a80
|
|
@ -214,7 +214,7 @@ class InternalMeshing(AMeshingTool):
|
|||
ratio = (alpha[j0] - beta[j0-1]) \
|
||||
/ (beta[j0] - beta[j0-1])
|
||||
if ratio < 0.0:
|
||||
print(f"ratio négatif {ratio}")
|
||||
logger.warning(f"ratio négatif {ratio}")
|
||||
# on double le point a gauche
|
||||
p = sect2.point(start2+j0-1).copy()
|
||||
sect2.insert_point(start2+j0-1, p)
|
||||
|
|
|
|||
|
|
@ -304,8 +304,10 @@ 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 " +
|
||||
f"→ probably already migrated")
|
||||
logger.warning(
|
||||
f"pol_id {pol_id} not in pid_pol " +
|
||||
"→ probably already migrated"
|
||||
)
|
||||
continue
|
||||
|
||||
execute(
|
||||
|
|
|
|||
|
|
@ -396,7 +396,6 @@ class ProfileXYZ(Profile, SQLSubModel):
|
|||
|
||||
for point in self._points:
|
||||
p = point.copy()
|
||||
print(p)
|
||||
new_p._points.append(p)
|
||||
|
||||
new_p.modified()
|
||||
|
|
|
|||
|
|
@ -202,7 +202,6 @@ class Reach(SQLSubModel):
|
|||
else:
|
||||
gi = self.get_global_profil_index(index)
|
||||
profile.num = gi
|
||||
print(f"gi = {gi}")
|
||||
self._profiles.insert(gi, profile)
|
||||
|
||||
self.modified()
|
||||
|
|
|
|||
|
|
@ -183,7 +183,6 @@ class BasicHS(SQLSubModel):
|
|||
bhs._data = BHSValue._db_load(
|
||||
execute, data
|
||||
)
|
||||
print(f"{bhs_pid} : {deleted}")
|
||||
if deleted:
|
||||
bhs.set_as_deleted()
|
||||
|
||||
|
|
|
|||
|
|
@ -588,8 +588,6 @@ class InitialConditions(SQLSubModel):
|
|||
for data in self._data:
|
||||
data_height[data["rk"].rk] = data["height"]
|
||||
|
||||
print(data_height)
|
||||
|
||||
incline = self._reach.reach.get_incline_median_mean()
|
||||
logger.debug(f"incline = {incline}")
|
||||
|
||||
|
|
|
|||
|
|
@ -263,8 +263,6 @@ class Reservoir(SQLSubModel):
|
|||
cls._db_update_to_0_2_0_set_node_pid(execute, table, nodes)
|
||||
Scenario.update_db_add_scenario(execute, table)
|
||||
|
||||
print(execute(f"SELECT * FROM {table}"))
|
||||
|
||||
cls._db_create(execute, ext="_tmp")
|
||||
execute(
|
||||
f"INSERT INTO {table}_tmp " +
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class Scenarios(PamhyrModelDict):
|
|||
def is_leaf(self, scenario):
|
||||
return not reduce(
|
||||
lambda acc, s: (
|
||||
acc or s.parent is scenario
|
||||
acc or (not s.is_deleted() and s.parent is scenario)
|
||||
),
|
||||
self._dict.values(),
|
||||
False
|
||||
|
|
|
|||
|
|
@ -313,8 +313,10 @@ 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 " +
|
||||
f"→ probably already migrated")
|
||||
logger.warning(
|
||||
f"node_id {node_id} not in nodes " +
|
||||
"→ probably already migrated"
|
||||
)
|
||||
continue
|
||||
|
||||
execute(
|
||||
|
|
|
|||
|
|
@ -426,7 +426,6 @@ class Rubar3(CommandLineSolver):
|
|||
coeff = coeff_min
|
||||
else:
|
||||
for s in lst:
|
||||
print(s.begin_rk, s.end_rk)
|
||||
if (rk >= s.begin_rk and rk <= s.end_rk or
|
||||
rk <= s.begin_rk and rk >= s.end_rk):
|
||||
coeff = s.begin_strickler # TODO: inerpolate
|
||||
|
|
@ -473,7 +472,6 @@ class Rubar3(CommandLineSolver):
|
|||
last = profiles[-1]
|
||||
|
||||
if first not in data or last not in data:
|
||||
print(data)
|
||||
logger.error(
|
||||
"Study initial condition is not fully defined"
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue