mirror of https://gitlab.com/pamhyr/pamhyr2
Solver: Mage: Fix mage export.
parent
645a76b0e8
commit
420d766ae5
|
|
@ -250,26 +250,21 @@ class Mage(CommandLineSolver):
|
||||||
|
|
||||||
# Generate sediment additional data if available
|
# Generate sediment additional data if available
|
||||||
sediment = ""
|
sediment = ""
|
||||||
if profile.sl is None:
|
if profile.sl is not None and not profile.sl.is_deleted():
|
||||||
return
|
if not any(filter(lambda f: ".GRA" in f, files)):
|
||||||
|
files.append(self._gra_file)
|
||||||
|
|
||||||
if profile.sl.is_deleted():
|
# Number of layers
|
||||||
return
|
nl = len(profile.sl)
|
||||||
|
sediment = f" {nl:>3}"
|
||||||
|
|
||||||
if not any(filter(lambda f: ".GRA" in f, files)):
|
# Layers data
|
||||||
files.append(self._gra_file)
|
for layer in profile.sl.layers:
|
||||||
|
sediment += (
|
||||||
# Number of layers
|
f" {layer.height:>10} {layer.d50:>10} " +
|
||||||
nl = len(profile.sl)
|
f"{layer.sigma:>10} " +
|
||||||
sediment = f" {nl:>3}"
|
f"{layer.critical_constraint:>10}"
|
||||||
|
)
|
||||||
# Layers data
|
|
||||||
for layer in profile.sl.layers:
|
|
||||||
sediment += (
|
|
||||||
f" {layer.height:>10} {layer.d50:>10} " +
|
|
||||||
f"{layer.sigma:>10} " +
|
|
||||||
f"{layer.critical_constraint:>10}"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Profile header line
|
# Profile header line
|
||||||
wfile.write(f"{num}{c1}{c2}{t} {rk} {pname} {sediment}\n")
|
wfile.write(f"{num}{c1}{c2}{t} {rk} {pname} {sediment}\n")
|
||||||
|
|
@ -283,24 +278,20 @@ class Mage(CommandLineSolver):
|
||||||
# Generate sediment additional data if available
|
# Generate sediment additional data if available
|
||||||
sediment = ""
|
sediment = ""
|
||||||
prev = point.z
|
prev = point.z
|
||||||
if point.sl is None:
|
|
||||||
return
|
|
||||||
|
|
||||||
if point.sl.is_deleted():
|
if point.sl is not None and not point.sl.is_deleted():
|
||||||
return
|
# Number of layers
|
||||||
|
nl = len(point.sl)
|
||||||
|
sediment = f"{nl:>3}"
|
||||||
|
|
||||||
# Number of layers
|
# Layers data
|
||||||
nl = len(point.sl)
|
for layer in point.sl.layers:
|
||||||
sediment = f"{nl:>3}"
|
prev = round(prev - layer.height, 5)
|
||||||
|
sediment += (
|
||||||
# Layers data
|
f" {prev:>10} {layer.d50:>10} " +
|
||||||
for layer in point.sl.layers:
|
f"{layer.sigma:>10} " +
|
||||||
prev = round(prev - layer.height, 5)
|
f"{layer.critical_constraint:>10}"
|
||||||
sediment += (
|
)
|
||||||
f" {prev:>10} {layer.d50:>10} " +
|
|
||||||
f"{layer.sigma:>10} " +
|
|
||||||
f"{layer.critical_constraint:>10}"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Point line
|
# Point line
|
||||||
wfile.write(f"{x} {y} {z} {n} {sediment}\n")
|
wfile.write(f"{x} {y} {z} {n} {sediment}\n")
|
||||||
|
|
@ -701,18 +692,15 @@ class Mage(CommandLineSolver):
|
||||||
|
|
||||||
nb_cv = 0
|
nb_cv = 0
|
||||||
for hs in hydraulic_structures:
|
for hs in hydraulic_structures:
|
||||||
|
if not hs.enabled or hs.is_deleted():
|
||||||
|
continue
|
||||||
|
|
||||||
if hs.input_reach is None:
|
if hs.input_reach is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not hs.input_reach.is_enable() or hs.input_reach.is_deleted():
|
if not hs.input_reach.is_enable() or hs.input_reach.is_deleted():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not hs.enabled:
|
|
||||||
continue
|
|
||||||
|
|
||||||
if hs.is_deleted():
|
|
||||||
continue
|
|
||||||
|
|
||||||
for bhs in hs.basic_structures:
|
for bhs in hs.basic_structures:
|
||||||
if bhs.enabled:
|
if bhs.enabled:
|
||||||
logger.info(bhs._type)
|
logger.info(bhs._type)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue