mirror of https://gitlab.com/pamhyr/pamhyr2
Compare commits
7 Commits
4ba232a7e4
...
6dfa876809
| Author | SHA1 | Date |
|---|---|---|
|
|
6dfa876809 | |
|
|
aff86a2ffa | |
|
|
1eb925f3dd | |
|
|
701d76240e | |
|
|
37ea9e9083 | |
|
|
6457b3ad25 | |
|
|
cba5b948de |
|
|
@ -582,6 +582,40 @@ pkg-check-clamav:
|
||||||
# RELEASE #
|
# RELEASE #
|
||||||
###########
|
###########
|
||||||
|
|
||||||
|
shadow-release:
|
||||||
|
stage: release
|
||||||
|
tags:
|
||||||
|
- release
|
||||||
|
- linux
|
||||||
|
needs:
|
||||||
|
- job: linux-package-tar
|
||||||
|
artifacts: true
|
||||||
|
- job: windows-package-zip
|
||||||
|
artifacts: true
|
||||||
|
- job: windows-package-exe
|
||||||
|
artifacts: true
|
||||||
|
# - job: build-users-doc
|
||||||
|
# artifacts: true
|
||||||
|
- job: build-developers-doc
|
||||||
|
artifacts: true
|
||||||
|
- job: pkg-hash
|
||||||
|
artifacts: true
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_BRANCH != 'master' && $CI_COMMIT_TAG
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- linux/pamhyr-gnulinux.tar.xz
|
||||||
|
- windows/pamhyr-windows.zip
|
||||||
|
- windows/pamhyr-windows.exe
|
||||||
|
- linux/pamhyr-gnulinux.tar.xz.sha256
|
||||||
|
- windows/pamhyr-windows.zip.sha256
|
||||||
|
- windows/pamhyr-windows.exe.sha256
|
||||||
|
- doc/dev/documentation.pdf
|
||||||
|
# - doc/users/documentation.pdf
|
||||||
|
script:
|
||||||
|
- cd packages
|
||||||
|
|
||||||
|
|
||||||
tag-release:
|
tag-release:
|
||||||
stage: release
|
stage: release
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -601,7 +635,7 @@ tag-release:
|
||||||
- job: pkg-hash
|
- job: pkg-hash
|
||||||
artifacts: true
|
artifacts: true
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_TAG
|
- if: $CI_COMMIT_BRANCH == 'master' && $CI_COMMIT_TAG
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- linux/pamhyr-gnulinux.tar.xz
|
- linux/pamhyr-gnulinux.tar.xz
|
||||||
|
|
|
||||||
|
|
@ -373,8 +373,8 @@ class PointXYZ(Point):
|
||||||
c = PointXYZ.distance(p3, p1)
|
c = PointXYZ.distance(p3, p1)
|
||||||
|
|
||||||
s = float((a + b + c) / 2)
|
s = float((a + b + c) / 2)
|
||||||
res = (
|
res = abs(
|
||||||
s * abs(s - a) * abs(s - b) * abs(s - c)
|
s * (s - a) * (s - b) * (s - c)
|
||||||
) ** 0.5
|
) ** 0.5
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
|
||||||
|
|
@ -1008,49 +1008,47 @@ class ProfileXYZ(Profile, SQLSubModel):
|
||||||
"""
|
"""
|
||||||
Remove points to keep at most np_purge points.
|
Remove points to keep at most np_purge points.
|
||||||
"""
|
"""
|
||||||
if (self.nb_points <= np_purge):
|
if self.nb_points <= np_purge:
|
||||||
return
|
return
|
||||||
|
|
||||||
q_area = queue.PriorityQueue()
|
nb_named = 0 # we consider the first and last point as named
|
||||||
deleted = []
|
area = []
|
||||||
|
|
||||||
for ind, point in enumerate(self.points):
|
for i, p in enumerate(self.points):
|
||||||
if (ind == 0) or (ind == self.nb_points - 1):
|
if p.is_named() or i == 0 or i == self.nb_points - 1:
|
||||||
continue
|
area.append((9999999.999, p))
|
||||||
|
nb_named += 1
|
||||||
if not point.is_named():
|
else:
|
||||||
q_area.put((
|
area.append((
|
||||||
PointXYZ.areatriangle3d(
|
PointXYZ.areatriangle3d(
|
||||||
self.point(ind - 1),
|
self.point(i-1),
|
||||||
point,
|
p,
|
||||||
self.point(ind + 1)
|
self.point(i+1)
|
||||||
),
|
),
|
||||||
ind, point
|
p
|
||||||
))
|
))
|
||||||
|
|
||||||
while self.nb_points > np_purge and not q_area.empty():
|
while self.nb_points > max(np_purge, nb_named):
|
||||||
area, ind, point = q_area.get()
|
ind, (min_area, p) = min(
|
||||||
|
enumerate(area),
|
||||||
|
key=lambda t: t[1][0]
|
||||||
|
)
|
||||||
|
|
||||||
self.delete_points([point])
|
p.set_as_deleted()
|
||||||
deleted.append(point)
|
area.pop(ind)
|
||||||
|
|
||||||
# Recompute point neighbourhood
|
|
||||||
for i in [ind-1, ind]:
|
for i in [ind-1, ind]:
|
||||||
if (i <= 0) or (i >= self.nb_points - 1):
|
p = self.point(i)
|
||||||
continue
|
|
||||||
|
|
||||||
point = self.point(i)
|
if p.is_named() or i == 0 or i == self.nb_points - 1:
|
||||||
if not point.is_named():
|
area[i] = (9999999.999, p)
|
||||||
q_area.put((
|
else:
|
||||||
PointXYZ.areatriangle3d(
|
area[i] = (
|
||||||
self.point(i-1),
|
PointXYZ.areatriangle3d(
|
||||||
point,
|
self.point(i-1), p, self.point(i+1)
|
||||||
self.point(i+1)
|
),
|
||||||
), i, point
|
p
|
||||||
))
|
)
|
||||||
|
|
||||||
self.modified()
|
|
||||||
return deleted
|
|
||||||
|
|
||||||
def shift(self, x, y, z):
|
def shift(self, x, y, z):
|
||||||
for p in self._points:
|
for p in self._points:
|
||||||
|
|
|
||||||
|
|
@ -205,7 +205,7 @@ class Data(SQLSubModel):
|
||||||
owner_scenario=owner_scenario
|
owner_scenario=owner_scenario
|
||||||
)
|
)
|
||||||
if deleted:
|
if deleted:
|
||||||
nd.set_as_deleted()
|
d.set_as_deleted()
|
||||||
|
|
||||||
loaded.add(pid)
|
loaded.add(pid)
|
||||||
new.append(d)
|
new.append(d)
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ class TableModel(PamhyrTableModel):
|
||||||
if 0 <= column < 2:
|
if 0 <= column < 2:
|
||||||
v = self._data.get_i(row)[column]
|
v = self._data.get_i(row)[column]
|
||||||
if self._data.get_type_column(column) == float:
|
if self._data.get_type_column(column) == float:
|
||||||
if type(v) == str:
|
if type(v) is str:
|
||||||
v = v.replace(',', '.')
|
v = v.replace(',', '.')
|
||||||
value = f"{float(v):.4f}"
|
value = f"{float(v):.4f}"
|
||||||
elif self._data.header[column] == "time":
|
elif self._data.header[column] == "time":
|
||||||
|
|
|
||||||
|
|
@ -62,10 +62,10 @@ class EditREPLineWindow(PamhyrDialog):
|
||||||
self.set_line_edit_text("lineEdit_name", self._rep_line.name)
|
self.set_line_edit_text("lineEdit_name", self._rep_line.name)
|
||||||
self.set_line_edit_text("lineEdit_line", self._rep_line.line)
|
self.set_line_edit_text("lineEdit_line", self._rep_line.line)
|
||||||
|
|
||||||
if self._study.is_editable():
|
self.set_check_box_enable("checkBox_enabled",
|
||||||
self.set_check_box_enable("checkBox_enabled", False)
|
self._study.is_editable())
|
||||||
self.set_line_edit_enable("lineEdit_name", False)
|
self.set_line_edit_enable("lineEdit_name", self._study.is_editable())
|
||||||
self.set_line_edit_enable("lineEdit_line", False)
|
self.set_line_edit_enable("lineEdit_line", self._study.is_editable())
|
||||||
|
|
||||||
def accept(self):
|
def accept(self):
|
||||||
if self._study.is_editable():
|
if self._study.is_editable():
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,9 @@ class REPLineListWindow(PamhyrWindow):
|
||||||
|
|
||||||
def delete(self):
|
def delete(self):
|
||||||
rows = self.selected_rows()
|
rows = self.selected_rows()
|
||||||
if len(rows) < 0:
|
if len(rows) <= 0:
|
||||||
|
return
|
||||||
|
if self._list.rowCount() <= 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
self._list.delete(rows[0])
|
self._list.delete(rows[0])
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ class PlotRKC(PamhyrPlot):
|
||||||
)
|
)
|
||||||
|
|
||||||
for hs in lhs:
|
for hs in lhs:
|
||||||
x = hs.input_rk
|
x = hs.input_section.rk
|
||||||
z_min = reach.geometry.get_z_min()
|
z_min = reach.geometry.get_z_min()
|
||||||
z_max = reach.geometry.get_z_max()
|
z_max = reach.geometry.get_z_max()
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue