mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Solver: Mage: Fix <list>.node error.
This commit is contained in:
1 parent
6c4636917a
commit
3c9eccdfab
1 file changed
+8
-2
+8
-2
@@ -234,7 +234,7 @@ class Mage(CommandLineSolver):
|
|||||||
def _export_BC(self, t, bounds, repertory, qlog, name="0"):
|
def _export_BC(self, t, bounds, repertory, qlog, name="0"):
|
||||||
files = []
|
files = []
|
||||||
|
|
||||||
if len(bounds) == 0 or bounds.node is None:
|
if len(bounds) == 0:
|
||||||
return files
|
return files
|
||||||
|
|
||||||
if qlog is not None:
|
if qlog is not None:
|
||||||
@@ -244,6 +244,9 @@ class Mage(CommandLineSolver):
|
|||||||
files.append(f"{name}.{t}")
|
files.append(f"{name}.{t}")
|
||||||
|
|
||||||
for bound in bounds:
|
for bound in bounds:
|
||||||
|
if bound.node is None:
|
||||||
|
continue
|
||||||
|
|
||||||
name = f"{bound.node.id:3}".replace(" ", "x")
|
name = f"{bound.node.id:3}".replace(" ", "x")
|
||||||
f.write(f"* {bound.node.name} ({name}) {bound.bctype}\n")
|
f.write(f"* {bound.node.name} ({name}) {bound.bctype}\n")
|
||||||
f.write(f"${name}\n")
|
f.write(f"${name}\n")
|
||||||
@@ -419,7 +422,7 @@ class Mage(CommandLineSolver):
|
|||||||
files = []
|
files = []
|
||||||
|
|
||||||
reservoirs = study.river.reservoir.lst
|
reservoirs = study.river.reservoir.lst
|
||||||
if len(reservoirs) == 0 or reservoirs.node is None:
|
if len(reservoirs) == 0:
|
||||||
return files
|
return files
|
||||||
|
|
||||||
if qlog is not None:
|
if qlog is not None:
|
||||||
@@ -429,6 +432,9 @@ class Mage(CommandLineSolver):
|
|||||||
files.append(f"{name}.CAS")
|
files.append(f"{name}.CAS")
|
||||||
|
|
||||||
for reservoir in reservoirs:
|
for reservoir in reservoirs:
|
||||||
|
if reservoir.node is None:
|
||||||
|
continue
|
||||||
|
|
||||||
reservoir.sort()
|
reservoir.sort()
|
||||||
node = reservoir.node
|
node = reservoir.node
|
||||||
name = f"{node.id:3}".replace(" ", "x")
|
name = f"{node.id:3}".replace(" ", "x")
|
||||||
|
|||||||
Reference in new issue
Block a user