mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49eb28056e | ||
|
|
5fb36e7fbe | ||
|
|
71914fdf57 | ||
|
|
2d7409debb | ||
|
|
92fb653676 |
No files matched your search
@@ -95,12 +95,11 @@ class PointXYZ(Point):
|
|||||||
"ADD COLUMN deleted BOOLEAN NOT NULL DEFAULT FALSE"
|
"ADD COLUMN deleted BOOLEAN NOT NULL DEFAULT FALSE"
|
||||||
)
|
)
|
||||||
|
|
||||||
if major == "0" and minor == "2":
|
# Try to create index at each update
|
||||||
if int(release) < 5:
|
execute(
|
||||||
execute(
|
"CREATE INDEX IF NOT EXISTS idx_point " +
|
||||||
"CREATE INDEX idx_point " +
|
"ON geometry_pointXYZ(profile, scenario);"
|
||||||
"ON geometry_pointXYZ(profile, scenario);"
|
)
|
||||||
)
|
|
||||||
|
|
||||||
return cls._update_submodel(execute, version, data)
|
return cls._update_submodel(execute, version, data)
|
||||||
|
|
||||||
|
|||||||
@@ -158,11 +158,15 @@ class CommandLineSolver(AbstractSolver):
|
|||||||
txt = add_file.text
|
txt = add_file.text
|
||||||
txt = txt.replace("@version", get_version())
|
txt = txt.replace("@version", get_version())
|
||||||
txt = txt.replace("@date", datetime.now().isoformat(sep=" "))
|
txt = txt.replace("@date", datetime.now().isoformat(sep=" "))
|
||||||
|
txt = self._prepare_additional_file_text(add_file.path, txt)
|
||||||
|
|
||||||
f.write(txt)
|
f.write(txt)
|
||||||
|
|
||||||
return files
|
return files
|
||||||
|
|
||||||
|
def _prepare_additional_file_text(self, path, text):
|
||||||
|
return text
|
||||||
|
|
||||||
def export_study_description(self, study, repertory, qlog, name="0"):
|
def export_study_description(self, study, repertory, qlog, name="0"):
|
||||||
files = []
|
files = []
|
||||||
|
|
||||||
|
|||||||
+20
-1
@@ -679,6 +679,23 @@ class Mage(CommandLineSolver):
|
|||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
def _prepare_additional_file_text(self, path, text):
|
||||||
|
if os.path.splitext(path)[1].lower() != ".var":
|
||||||
|
return text
|
||||||
|
|
||||||
|
lines = []
|
||||||
|
for line in text.splitlines(keepends=True):
|
||||||
|
stripped = line.lstrip()
|
||||||
|
fields = stripped.split()
|
||||||
|
if stripped.startswith("$"):
|
||||||
|
# MAGE only recognizes rule markers in the first column.
|
||||||
|
line = stripped
|
||||||
|
elif (not stripped.startswith("*") and len(fields) >= 2
|
||||||
|
and fields[1] == "W2Z"):
|
||||||
|
line = "$ " + stripped
|
||||||
|
lines.append(line)
|
||||||
|
return "".join(lines)
|
||||||
|
|
||||||
def _export_VAR(self, study, repertory, qlog, name="0"):
|
def _export_VAR(self, study, repertory, qlog, name="0"):
|
||||||
files = []
|
files = []
|
||||||
|
|
||||||
@@ -729,9 +746,11 @@ class Mage(CommandLineSolver):
|
|||||||
name = bhs.name
|
name = bhs.name
|
||||||
if name == "":
|
if name == "":
|
||||||
name = f"HS_{bhs.id:>3}".replace(" ", "0")
|
name = f"HS_{bhs.id:>3}".replace(" ", "0")
|
||||||
|
else:
|
||||||
|
name = name.replace(" ", "_")
|
||||||
|
|
||||||
f.write(
|
f.write(
|
||||||
f"${name} clapet"
|
f"${name} clapet\n"
|
||||||
)
|
)
|
||||||
return files
|
return files
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ class DelCommand(QUndoCommand):
|
|||||||
self._bcs.insert(self._tab, row, el)
|
self._bcs.insert(self._tab, row, el)
|
||||||
|
|
||||||
def redo(self):
|
def redo(self):
|
||||||
self._bcs.delete_i(self._tab, self._rows)
|
self._bcs.delete(self._tab, [el for _, el in self._bc])
|
||||||
|
|
||||||
|
|
||||||
class SortCommand(QUndoCommand):
|
class SortCommand(QUndoCommand):
|
||||||
|
|||||||
@@ -1150,7 +1150,6 @@ class ResultsWindow(PamhyrWindow):
|
|||||||
z = table["Z"][:, profile.global_index]
|
z = table["Z"][:, profile.global_index]
|
||||||
q = table["Q"][:, profile.global_index]
|
q = table["Q"][:, profile.global_index]
|
||||||
v = table["V"][:, profile.global_index]
|
v = table["V"][:, profile.global_index]
|
||||||
zfd = table["zfd"][:, profile.global_index]
|
|
||||||
|
|
||||||
if self._current_results == 2:
|
if self._current_results == 2:
|
||||||
reach1 = self._results[0].river.reach(self._reach)
|
reach1 = self._results[0].river.reach(self._reach)
|
||||||
@@ -1169,8 +1168,8 @@ class ResultsWindow(PamhyrWindow):
|
|||||||
v2 = table["V"][:, profile2.global_index]
|
v2 = table["V"][:, profile2.global_index]
|
||||||
|
|
||||||
if "bed_elevation" in y:
|
if "bed_elevation" in y:
|
||||||
if reach.has_bedload():
|
if reach.has_bedload() and "zfd" in table:
|
||||||
z_min = zfd
|
z_min = table["zfd"][:, profile.global_index]
|
||||||
else:
|
else:
|
||||||
z_min = [profile.geometry.z_min()] * len(self._timestamps)
|
z_min = [profile.geometry.z_min()] * len(self._timestamps)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user