Merge branch 'master' of gitlab-ssh.irstea.fr:theophile.terraz/pamhyr

setup.py
Theophile Terraz 2024-01-24 17:06:11 +01:00
commit ceaab3c2fc
2 changed files with 8 additions and 6 deletions

View File

@ -38,7 +38,11 @@ def mage_file_open(filepath, mode):
if "w" in mode:
# Write header
f.write("* This file is generated by PAMHYR, please don't modify\n")
comment = "*"
if ".ST" in filepath:
comment = "#"
f.write(f"{comment} This file is generated by PAMHYR, please don't modify\n")
return f
@ -1009,10 +1013,8 @@ class Mage8(Mage):
# Set data for profile RI
reach.set(ri, timestamp, key, d)
if key == "Z":
profile = study.river\
.current_reach()\
.reach.profile(ri)
ptX, ptY = profile.get_water_limits(d)
profile = reach.profile(ri)
ptX, ptY = profile.geometry.get_water_limits(d)
reach.set(ri, timestamp, "ptX", ptX)
reach.set(ri, timestamp, "ptY", ptY)

View File

@ -567,7 +567,7 @@ class GeometryWindow(PamhyrWindow):
def _export_to_file_st(self, filename):
with open(filename, "w+") as f:
f.write("* Exported from Pamhyr2\n")
f.write("# Exported from Pamhyr2\n")
self._export_to_file_st_reach(f, self._reach)
def _export_to_file_st_reach(self, wfile, reach):