mirror of https://gitlab.com/pamhyr/pamhyr2
Solver: Mage: Fix <list>.node error.
parent
6c4636917a
commit
3c9eccdfab
|
|
@ -234,7 +234,7 @@ class Mage(CommandLineSolver):
|
|||
def _export_BC(self, t, bounds, repertory, qlog, name="0"):
|
||||
files = []
|
||||
|
||||
if len(bounds) == 0 or bounds.node is None:
|
||||
if len(bounds) == 0:
|
||||
return files
|
||||
|
||||
if qlog is not None:
|
||||
|
|
@ -244,6 +244,9 @@ class Mage(CommandLineSolver):
|
|||
files.append(f"{name}.{t}")
|
||||
|
||||
for bound in bounds:
|
||||
if bound.node is None:
|
||||
continue
|
||||
|
||||
name = f"{bound.node.id:3}".replace(" ", "x")
|
||||
f.write(f"* {bound.node.name} ({name}) {bound.bctype}\n")
|
||||
f.write(f"${name}\n")
|
||||
|
|
@ -419,7 +422,7 @@ class Mage(CommandLineSolver):
|
|||
files = []
|
||||
|
||||
reservoirs = study.river.reservoir.lst
|
||||
if len(reservoirs) == 0 or reservoirs.node is None:
|
||||
if len(reservoirs) == 0:
|
||||
return files
|
||||
|
||||
if qlog is not None:
|
||||
|
|
@ -429,6 +432,9 @@ class Mage(CommandLineSolver):
|
|||
files.append(f"{name}.CAS")
|
||||
|
||||
for reservoir in reservoirs:
|
||||
if reservoir.node is None:
|
||||
continue
|
||||
|
||||
reservoir.sort()
|
||||
node = reservoir.node
|
||||
name = f"{node.id:3}".replace(" ", "x")
|
||||
|
|
|
|||
Loading…
Reference in New Issue