Solver: Mage: Comment setter Z, Q and V into profile and bufferize and fix indent.

opt-result
Pierre-Antoine 2026-07-02 11:00:59 +02:00
parent 0a1760cee6
commit a61d130baa
1 changed files with 23 additions and 23 deletions

View File

@ -1107,7 +1107,7 @@ class Mage8(Mage):
# Profile ID offset
reach_offset[r] = i1
profile_len.append(i2-i1+1)
profile_len.append(i2 - i1 + 1)
logger.debug(f"read_bin: iprofiles = {len(iprofiles)}")
@ -1161,7 +1161,7 @@ class Mage8(Mage):
ri = i - reach_offset[reach]
# Set data for profile RI
reach.set(ri, timestamp, key, d)
# reach.set(ri, timestamp, key, d)
if key == "Z":
profile = reach.profile(ri)
limits = profile.geometry.get_water_limits(d)
@ -1201,7 +1201,7 @@ class Mage8(Mage):
table["Q"][ti, p.global_index],
table["Z"][ti, p.global_index],
)
r.set(pi, t, "V", v)
# r.set(pi, t, "V", v)
velocity_arr[ti, j] = v
j += 1
@ -1210,9 +1210,9 @@ class Mage8(Mage):
logger.info(f"read_bin: ... end with {len(ts)} timestamp read")
results.bufferize("Z")
results.bufferize("Q")
results.bufferize("V")
# results.bufferize("Z")
# results.bufferize("Q")
# results.bufferize("V")
logger.info(f"reading time: '{time.time() - start}'")
@timer
@ -1282,8 +1282,8 @@ class Mage8(Mage):
reachs.append(r)
# ID of first and last reach profiles
i1 = data[2*i] - 1
i2 = data[2*i+1] - 1
i1 = data[2 * i] - 1
i2 = data[2 * i + 1] - 1
# Add profile id correspondance to reach
key = (i1, i2)
@ -1394,26 +1394,26 @@ class Mage8(Mage):
r.profiles
))
z_br = list(map(
lambda z, sl: reduce(
lambda z, h: z - h[0],
sl, z
),
z_min, # Original geometry
sls # Original sediment layers
))
lambda z, sl: reduce(
lambda z, h: z - h[0],
sl, z
),
z_min, # Original geometry
sls # Original sediment layers
))
for t in ts_list:
sls = list(map(
lambda p: p.get_ts_key(t, "sl")[0],
r.profiles
))
))
zfd = list(map(
lambda z, sl: reduce(
lambda z, h: z + h[0],
sl, z
),
z_br, # bedrock
sls # Original sediment layers
))
lambda z, sl: reduce(
lambda z, h: z + h[0],
sl, z
),
z_br, # bedrock
sls # Original sediment layers
))
for i, p in enumerate(r.profiles):
r.set(i, t, "zfd", zfd[i])