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