Compare commits

...
40 Commits
Author SHA1 Message Date
Pierre-Antoine Rouby 815716da07 Manifest: Minor change. 2024-07-01 09:54:22 +02:00
Pierre-Antoine Rouby c288a390b5 packages: Fix setup.sh. 2024-05-29 11:39:18 +02:00
Pierre-Antoine Rouby f1377f6336 ci: Minor fixe. 2024-05-29 11:15:10 +02:00
Pierre-Antoine Rouby 6ac808d842 ci: Try archive origin branch name. 2024-05-29 11:12:02 +02:00
Pierre-Antoine Rouby b6aa0afdc7 ci: Fix path (again again and again). 2024-05-29 11:09:07 +02:00
Pierre-Antoine Rouby 03da38eeb0 ci: Update python version. 2024-05-29 11:04:49 +02:00
Pierre-Antoine Rouby e970b2c07a ci: Fix python dl path (again). 2024-05-29 11:02:50 +02:00
Pierre-Antoine Rouby 8d336b888a ci: Minor fixes in dl path. 2024-05-29 10:38:39 +02:00
Pierre-Antoine Rouby f4b7131b98 ci: Minor fixes. 2024-05-29 10:37:26 +02:00
Pierre-Antoine Rouby 07cdf72528 gitlab-ci: Add dl custom python and source with python packages. 2024-05-29 10:35:23 +02:00
Pierre-Antoine Rouby 7d235fdcc2 guix: Minor change. 2024-05-22 16:32:06 +02:00
Pierre-Antoine Rouby 45d6f228cf tools: Add try to pwd user name get. 2024-05-22 16:16:40 +02:00
Pierre-Antoine Rouby 31974bc7b6 pamhyr: Add script to run pamhyr under guix shell env. 2024-05-22 16:02:33 +02:00
Pierre-Antoine Rouby e87db62dce pamhyr: Add setup.sh install script (not functionnal). 2024-05-22 16:00:06 +02:00
Pierre-Antoine Rouby 1eec6ffc85 pamhyr: Add guix manifest. 2024-05-22 15:59:22 +02:00
Pierre-Antoine Rouby 35dd851e08 pamhyr: Add setup.py file (not functionnal). 2024-05-22 15:58:43 +02:00
Pierre-Antoine Rouby 50686e1b65 Pamhyr: Disable native file dialog. 2024-05-22 15:56:45 +02:00
Pierre-Antoine Rouby e45eb3fd69 ci: build-linux: Fix 'pamhyr-x11' path. 2024-05-21 17:27:27 +02:00
Pierre-Antoine Rouby dd86b8b461 Package: Linux: Add script to force pamhyr running with x11. 2024-05-21 17:19:00 +02:00
Theophile Terraz 57d43cd5d3 Merge branch 'master' of gitlab-ssh.irstea.fr:theophile.terraz/pamhyr 2024-05-21 17:02:08 +02:00
Theophile Terraz 14b5b5e3df add purge dialog 2024-05-21 17:01:54 +02:00
Pierre-Antoine Rouby a7e43ca6a7 MainWindow: Info: Sync update with all modelling modules. 2024-05-21 11:08:59 +02:00
Pierre-Antoine Rouby 8ca21c413f IC: Fix display update and optimized discharge plot update. 2024-05-21 10:53:20 +02:00
Pierre-Antoine Rouby 61fd54c496 Geometry, Results: Fix HS display whene not associated. 2024-05-17 16:41:05 +02:00
Pierre-Antoine Rouby b017127b3a Windows: Add nsis icon. 2024-05-17 15:44:48 +02:00
Pierre-Antoine Rouby 52f2d15280 Package: Add icon for windows executable file. 2024-05-17 15:20:17 +02:00
Pierre-Antoine Rouby 5c86e46c72 Checker: Bypass study copy to improve performance. 2024-05-17 14:51:30 +02:00
Pierre-Antoine Rouby a5648851f2 Friction: Add strickler unit. 2024-05-17 14:31:34 +02:00
Pierre-Antoine Rouby cb41520a20 pamhyr: Fix Pep8. 2024-05-17 12:29:20 +02:00
Pierre-Antoine Rouby 537612e5e3 Geometry: Minor change. 2024-05-17 12:22:47 +02:00
Pierre-Antoine Rouby 4e0c671f68 Merge remote-tracking branch 'origin/v0.0.8' 2024-05-17 12:01:17 +02:00
Pierre-Antoine Rouby 507cfb9d53 Friction: Fix reach plot. 2024-05-17 11:55:29 +02:00
Pierre-Antoine Rouby 2013009e8a Mage: Update version. 2024-05-17 11:52:07 +02:00
Pierre-Antoine Rouby f1a1d08458 Pamhyr: Minor change. 2024-05-17 11:51:23 +02:00
Pierre-Antoine Rouby 7de6cc4468 Solver: RubarBE: Disable. 2024-05-17 11:50:07 +02:00
Pierre-Antoine Rouby 783d83e4cc Trad: Update french translate. 2024-05-17 11:48:37 +02:00
Theophile Terraz c366a1a4e7 increase precision of input sediment diameter 2024-05-16 18:06:53 +02:00
Theophile Terraz b784cab94b Merge branch 'v0.0.8' of gitlab-ssh.irstea.fr:theophile.terraz/pamhyr into v0.0.8 2024-05-16 13:01:14 +02:00
Theophile Terraz 78e361d486 debug issue #57 2024-05-16 13:01:03 +02:00
Theophile Terraz f745dce04e debug 2024-05-14 15:14:29 +02:00
122 changed files with 2188 additions and 674 deletions

No files matched your search

+58 -2
View File
@@ -29,7 +29,8 @@ stages:
############# #############
variables: variables:
MAGE_8_VERSION: "v8.3.5" MAGE_8_VERSION: "v8.3.6"
CUSTOM_PYTHON_VERSION: "3.10.14-build2"
dl-mage8-doc: dl-mage8-doc:
stage: downloads stage: downloads
@@ -83,6 +84,21 @@ dl-mage8-windows:
- mage8-windows/mailleurTT.exe - mage8-windows/mailleurTT.exe
- mage8-windows/libbief.dll - mage8-windows/libbief.dll
dl-python-linux:
stage: downloads
tags:
- linux
rules:
- if: $CI_COMMIT_BRANCH == 'setup.py' || $CI_COMMIT_TAG
script:
- curl -L -o python.tar.xz https://gitlab.irstea.fr/parouby/custom-python-build/-/releases/$CUSTOM_PYTHON_VERSION/downloads/python.tar.xz
- mkdir -p linux-python/
- cd linux-python
- tar xvf ../python.tar.xz
artifacts:
paths:
- linux-python
############# #############
# CONFIGURE # # CONFIGURE #
############# #############
@@ -262,6 +278,11 @@ build-linux:
- cp -v ../mage8-linux/* pamhyr/mage8/ - cp -v ../mage8-linux/* pamhyr/mage8/
# Copy Pamhyr # Copy Pamhyr
- cp -r dist/pamhyr/* pamhyr/ - cp -r dist/pamhyr/* pamhyr/
# Pamhyr script to force x11
- echo '#!/usr/bin/env bash' > pamhyr/pamhyr-x11
- echo "" >> pamhyr/pamhyr-x11
- echo "GDK_BACKEND=x11 ./pamhyr $@" >> pamhyr/pamhyr-x11
- chmod +x pamhyr/pamhyr-x11
# Copy Pamhyr resources # Copy Pamhyr resources
- mkdir -p pamhyr/_internal/View - mkdir -p pamhyr/_internal/View
- mkdir -p pamhyr/_internal/View/ui - mkdir -p pamhyr/_internal/View/ui
@@ -333,7 +354,7 @@ build-windows:
- python -m pip install -U -r ..\requirements.txt - python -m pip install -U -r ..\requirements.txt
# Run Pyinstaller # Run Pyinstaller
# - pyinstaller --noconsole -y ..\src\pamhyr.py # - pyinstaller --noconsole -y ..\src\pamhyr.py
- pyinstaller --hide-console hide-early -y ..\src\pamhyr.py - pyinstaller -i ../src/View/ui/ressources/icon.ico --hide-console hide-early -y ..\src\pamhyr.py
# Create directory # Create directory
- mkdir pamhyr - mkdir pamhyr
- dir - dir
@@ -403,6 +424,41 @@ windows-package-exe:
- copy ..\packages\pamhyr.nsi pamhyr.nsi - copy ..\packages\pamhyr.nsi pamhyr.nsi
- .\make-windows-exe.bat - .\make-windows-exe.bat
linux-python-with-sources:
stage: package
tags:
- release
- linux
needs:
- job: dl-python-linux
artifacts: true
- job: set-version
artifacts: true
- job: build-lang
artifacts: true
rules:
- if: $CI_COMMIT_BRANCH == 'setup.py' || $CI_COMMIT_TAG
artifacts:
paths:
- linux-sources-with-python.tar.xz
script:
- git archive --format=tar.gz --output=src.tar.gz origin/$CI_COMMIT_BRANCH
- cd linux-python
- mkdir -p pamhyr
- cd pamhyr
- tar xvf ../../src.tar.gz
- cp -v ../../VERSION ./
- cp -v ../../src/lang/*.qm ./src/lang/
- cd ..
- cp ../packages/setup.sh ./setup.sh
- sed -i 's|python3|$(dirname $0)/python/python|' setup.sh
- sed -i 's|.pamhyr-env|$(dirname $0)/.pamhyr-env|' setup.sh
- sed -i 's|./pamhyr|$(dirname $0)/pamhyr|' setup.sh
- cd ..
- mv linux-python pamhyr
- tar cf linux-sources-with-python.tar.xz pamhyr
- mv pamhyr linux-python # Keep 'pamhyr' path avalaible
######## ########
# HASH # # HASH #
######## ########
Executable
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
guix shell --manifest=manifest.scm -- python3 ./src/pamhyr.py $@
+22
View File
@@ -0,0 +1,22 @@
;; manifest.scm -- Pamhyr
;; Copyright (C) 2024 INRAE
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
(specifications->manifest
(list "python" "zlib" "python-platformdirs" "python-lxml"
"python-pyqt@5" "python-pyqt5-sip"
"python-pyqtgraph" "python-qscintilla"
"python-numpy" "python-shapely" "python-pyshp"
"python-matplotlib"))
+1
View File
@@ -3,6 +3,7 @@
!define LIC_NAME "LICENSE" !define LIC_NAME "LICENSE"
!define APP_NAME "PAMHYR" !define APP_NAME "PAMHYR"
Icon "pamhyr\_internal\View\ui\ressources\icon.ico"
Name "Pamhyr2" Name "Pamhyr2"
OutFile "pamhyr-windows.exe" OutFile "pamhyr-windows.exe"
LicenseData "pamhyr\_internal\LICENSE" LicenseData "pamhyr\_internal\LICENSE"
+54
View File
@@ -0,0 +1,54 @@
#! /usr/bin/env bash
# setup.sh -- Pamhyr
# Copyright (C) 2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
function perr() {
>&2 echo $1
}
function try() {
echo "$1"
res=$($1)
if [ $? -ne 0 ];
then
perr " !!! Command failed with exit value $?: '$1'"
perr " - $res"
exit 2
fi
}
if [ $# -ne 0 ];
then
perr "usage: $0"
exit 1
fi
OLD_PWD=$PWD
try "python3 -m venv .pamhyr-env"
try "source .pamhyr-env/bin/activate"
try "python3 -m pip install -r ./pamhyr/requirements.txt"
echo '#! /usr/bin/env bash' > run-pamhyr
echo 'source .pamhyr-env/bin/activate' >> run-pamhyr
echo 'if [ $XDG_SESSION_TYPE == wayland ]; then' >> run-pamhyr
echo ' export QT_QPA_PLATFORM=wayland' >> run-pamhyr
echo 'fi' >> run-pamhyr
echo 'python3 ./pamhyr/src/pamhyr.py $@' >> run-pamhyr
try "chmod +x run-pamhyr"
cd $OLD_PWD
Executable
+30
View File
@@ -0,0 +1,30 @@
#!/usr/bin/env python3
import os
from setuptools import find_packages, setup
def read_requirements():
req = []
with open("requirements.txt", "r") as f:
for line in f:
if line[0] == "#":
continue
req.append(line)
return req
setup(
name="Pamhyr2",
version="0.0.8",
description='River 1D modelling interface',
maintainer='INRAE',
maintainer_email='pierre-antoine.rouby@inrae.fr',
url='https://gitlab.irstea.fr/theophile.terraz/pamhyr',
packages=find_packages("."),
package_dir={"Pamhyr2": "Pamhyr2"},
scripts=[os.path.join("src", "pamhyr.py")],
install_requires=read_requirements(),
)
+4 -4
View File
@@ -206,11 +206,11 @@ class MageGeometryGuideLineChecker(StudyGeometryChecker):
def __init__(self, version="mage8"): def __init__(self, version="mage8"):
super(MageGeometryGuideLineChecker, self).__init__() super(MageGeometryGuideLineChecker, self).__init__()
self._name = _translate("Checker", "Mage geometry guide line checker") self._name = _translate("Checker", "Mage geometry guideline checker")
self._description = _translate( self._description = _translate(
"Checker", "Checker",
"Check if exists geometry guide line is correctly defined \ "Check if exists geometry guidelines are correctly defined \
for each reaches of the study" for each reach"
) )
self._solver = version self._solver = version
self._modules = Modules.GEOMETRY self._modules = Modules.GEOMETRY
@@ -241,7 +241,7 @@ for each reaches of the study"
for profile in profiles: for profile in profiles:
if not profile.has_standard_named_points(): if not profile.has_standard_named_points():
self._status = STATUS.WARNING self._status = STATUS.WARNING
self._summary = "no_standard_guileline_defined" self._summary = "no_standard_guideline_defined"
return False return False
for gl in gls[1:]: for gl in gls[1:]:
+3 -3
View File
@@ -34,9 +34,9 @@ class StudyNetworkReachChecker(AbstractModelChecker):
def __init__(self): def __init__(self):
super(StudyNetworkReachChecker, self).__init__() super(StudyNetworkReachChecker, self).__init__()
self._name = _translate("Checker", "Study network reach checker") self._name = _translate("Checker", "Study reach network checker")
self._description = _translate( self._description = _translate(
"Checker", "Check if exists at least one reach for study" "Checker", "Check if exists at least one reach exists"
) )
self._modules = Modules.NETWORK self._modules = Modules.NETWORK
@@ -63,7 +63,7 @@ class StudyGeometryChecker(AbstractModelChecker):
self._name = _translate("Checker", "Study geometry checker") self._name = _translate("Checker", "Study geometry checker")
self._description = _translate( self._description = _translate(
"Checker", "Check if exists geometry for each reach of study" "Checker", "Check if the geometry of each reach exists"
) )
self._modules = Modules.GEOMETRY self._modules = Modules.GEOMETRY
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+2 -2
View File
@@ -31,7 +31,7 @@ solver_long_name = {
# "mage7": "Mage v7", # "mage7": "Mage v7",
"mage8": "Mage v8", "mage8": "Mage v8",
# "mage_fake7": "Mage fake v7", # "mage_fake7": "Mage fake v7",
"rubarbe": "RubarBE", # "rubarbe": "RubarBE",
} }
solver_type_list = { solver_type_list = {
@@ -39,5 +39,5 @@ solver_type_list = {
# "mage7": Mage7, # "mage7": Mage7,
"mage8": Mage8, "mage8": Mage8,
# "mage_fake7": MageFake7, # "mage_fake7": MageFake7,
"rubarbe": RubarBE, # "rubarbe": RubarBE,
} }
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+1 -1
View File
@@ -48,7 +48,7 @@ class BCTranslate(MainTranslate):
self._sub_dict["long_types"] = { self._sub_dict["long_types"] = {
"ND": self._dict["not_defined"], "ND": self._dict["not_defined"],
"PC": _translate("BoundaryCondition", "Ponctual contribution"), "PC": _translate("BoundaryCondition", "Point sources"),
"TZ": _translate("BoundaryCondition", "Z(t)"), "TZ": _translate("BoundaryCondition", "Z(t)"),
"TD": _translate("BoundaryCondition", "Q(t)"), "TD": _translate("BoundaryCondition", "Q(t)"),
"ZD": _translate("BoundaryCondition", "Q(Z)"), "ZD": _translate("BoundaryCondition", "Q(Z)"),
+1 -1
View File
@@ -46,7 +46,7 @@ class Worker(QObject):
self.signalStatus.emit(checker.name) self.signalStatus.emit(checker.name)
# Run checker # Run checker
checker._run(self._study) checker.run(self._study)
self.signalStatus.emit("progress") self.signalStatus.emit("progress")
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+1 -1
View File
@@ -42,7 +42,7 @@ class PlotStricklers(PamhyrPlot):
) )
self.label_x = self._trad["kp"] self.label_x = self._trad["kp"]
self.label_y = self._trad["stricklers"] self.label_y = self._trad["strickler_plot"]
self.line_kp_elevation = [None, None] self.line_kp_elevation = [None, None]
+1
View File
@@ -136,6 +136,7 @@ class FrictionsWindow(PamhyrWindow):
self.plot = PlotKPZ( self.plot = PlotKPZ(
canvas=self.canvas, canvas=self.canvas,
data=self._reach.reach, data=self._reach.reach,
study=self._study,
trad=self._trad, trad=self._trad,
toolbar=None, toolbar=None,
) )
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+7 -4
View File
@@ -28,6 +28,9 @@ class FrictionsTranslate(MainTranslate):
super(FrictionsTranslate, self).__init__() super(FrictionsTranslate, self).__init__()
self._dict["kp"] = self._dict["unit_kp"] self._dict["kp"] = self._dict["unit_kp"]
self._dict["strickler_plot"] = _translate(
"Frictions", "Strickler ($m^{1/3}/s$)"
)
self._dict["stricklers"] = _translate( self._dict["stricklers"] = _translate(
"Frictions", "Stricklers" "Frictions", "Stricklers"
) )
@@ -39,8 +42,8 @@ class FrictionsTranslate(MainTranslate):
self._sub_dict["table_headers"] = { self._sub_dict["table_headers"] = {
# "name": self._dict["name"], # "name": self._dict["name"],
# "edge": self._dict["reach"], # "edge": self._dict["reach"],
"begin_kp": _translate("Frictions", "Begin kp (m)"), "begin_kp": _translate("Frictions", "Start (m)"),
"end_kp": _translate("Frictions", "End kp (m)"), "end_kp": _translate("Frictions", "End (m)"),
"begin_strickler": _translate("Frictions", "Begin strickler"), "begin_strickler": _translate("Frictions", "Start coefficient"),
"end_strickler": _translate("Frictions", "End strickler"), "end_strickler": _translate("Frictions", "End coefficient"),
} }
-14
View File
@@ -125,14 +125,6 @@ class MeshingDialog(PamhyrDialog):
def lplan(self): def lplan(self):
return self._lplan return self._lplan
@property
def origin(self):
return self._origin
@property
def lm(self):
return int(self._lm)
@property @property
def linear(self): def linear(self):
return self._linear return self._linear
@@ -165,15 +157,9 @@ class MeshingDialog(PamhyrDialog):
self._begin_cs = self.profiles.index(p1) self._begin_cs = self.profiles.index(p1)
self._end_cs = self.profiles.index(p2) self._end_cs = self.profiles.index(p2)
origin = self.get_combobox_text("comboBox_origin")
self._origin = self.profiles.index(origin)
self._begin_dir = self.get_combobox_text("comboBox_begin_gl") self._begin_dir = self.get_combobox_text("comboBox_begin_gl")
self._end_dir = self.get_combobox_text("comboBox_end_gl") self._end_dir = self.get_combobox_text("comboBox_end_gl")
r_lm_dict = self._trad.get_dict("r_lm_dict")
self._lm = r_lm_dict[self.get_combobox_text("comboBox_lm")]
super().accept() super().accept()
def reject(self): def reject(self):
+17
View File
@@ -98,6 +98,7 @@ class PlotAC(PamhyrPlot):
label=self.label_next_plot_selected, label=self.label_next_plot_selected,
color=self.color_plot_next, lw=1.6, linestyle='--' color=self.color_plot_next, lw=1.6, linestyle='--'
) )
self.canvas.axes.set_visible(False)
def draw_gl(self): def draw_gl(self):
if self._current_data_update: if self._current_data_update:
@@ -106,12 +107,16 @@ class PlotAC(PamhyrPlot):
profile_id = 0 profile_id = 0
profile = self.data.profile(profile_id) profile = self.data.profile(profile_id)
if profile is None:
return
station = profile.get_station() station = profile.get_station()
elevation = profile.z() elevation = profile.z()
gl = profile.names() gl = profile.names()
self.annotation = [] self.annotation = []
self.complete_gl, self.incomplete_gl = self.data.compute_guidelines() self.complete_gl, self.incomplete_gl = self.data.compute_guidelines()
lcomplete = list(self.complete_gl) lcomplete = list(self.complete_gl)
lincomplete = list(self.incomplete_gl) lincomplete = list(self.incomplete_gl)
@@ -160,6 +165,9 @@ class PlotAC(PamhyrPlot):
self.draw() self.draw()
return return
if self.data is None:
return
self.update_current() self.update_current()
self.update_gl() self.update_gl()
@@ -171,6 +179,10 @@ class PlotAC(PamhyrPlot):
previous_id = profile_id - 1 previous_id = profile_id - 1
next_id = profile_id + 1 next_id = profile_id + 1
self.previous_plot_selected.set_visible(False)
self.plot_selected.set_visible(False)
self.next_plot_selected.set_visible(False)
self.previous_plot_selected.set_data([], []) self.previous_plot_selected.set_data([], [])
self.plot_selected.set_data([], []) self.plot_selected.set_data([], [])
self.next_plot_selected.set_data([], []) self.next_plot_selected.set_data([], [])
@@ -180,18 +192,23 @@ class PlotAC(PamhyrPlot):
self.data.profile(previous_id).get_station(), self.data.profile(previous_id).get_station(),
self.data.profile(previous_id).z() self.data.profile(previous_id).z()
) )
self.previous_plot_selected.set_visible(True)
if 0 <= profile_id < self.data.number_profiles: if 0 <= profile_id < self.data.number_profiles:
self.plot_selected.set_data( self.plot_selected.set_data(
self.data.profile(profile_id).get_station(), self.data.profile(profile_id).get_station(),
self.data.profile(profile_id).z() self.data.profile(profile_id).z()
) )
self.plot_selected.set_visible(True)
if 0 <= next_id < self.data.number_profiles: if 0 <= next_id < self.data.number_profiles:
self.next_plot_selected.set_data( self.next_plot_selected.set_data(
self.data.profile(next_id).get_station(), self.data.profile(next_id).get_station(),
self.data.profile(next_id).z() self.data.profile(next_id).z()
) )
self.next_plot_selected.set_visible(True)
self.canvas.axes.set_visible(True)
def update_full(self): def update_full(self):
self.draw() self.draw()
+3
View File
@@ -191,8 +191,11 @@ class PlotKPZ(PamhyrPlot):
def draw_profiles_hs(self, reach): def draw_profiles_hs(self, reach):
lhs = filter( lhs = filter(
lambda hs: hs._input_reach.reach is reach, lambda hs: hs._input_reach.reach is reach,
filter(
lambda hs: hs._input_reach is not None,
self._study.river.hydraulic_structures.lst self._study.river.hydraulic_structures.lst
) )
)
for hs in lhs: for hs in lhs:
x = hs.input_kp x = hs.input_kp
+2 -22
View File
@@ -82,16 +82,6 @@ class GeometryProfileTableModel(PamhyrTableModel):
elif value == self._data.z_max(): elif value == self._data.z_max():
return QColor("blue") return QColor("blue")
if role == Qt.ToolTipRole:
if value == self._data.z_min():
return _translate("MainWindowProfile",
"La cote du fond",
"Z minimale")
elif value == self._data.z_max():
return _translate("MainWindowProfile",
"La cote maximale",
"Z maximale")
if index.column() == 3: if index.column() == 3:
value = self._data.point(index.row()).name value = self._data.point(index.row()).name
@@ -104,16 +94,6 @@ class GeometryProfileTableModel(PamhyrTableModel):
if role == Qt.ForegroundRole: if role == Qt.ForegroundRole:
return QColor("darkRed") return QColor("darkRed")
if role == Qt.ToolTipRole:
if value.strip().upper() == "RG":
return _translate(
"MainWindowProfile", "Rive gauche"
)
else:
return _translate(
"MainWindowProfile", "Rive droite"
)
return QVariant() return QVariant()
def setData(self, index, value, role=Qt.EditRole): def setData(self, index, value, role=Qt.EditRole):
@@ -250,11 +230,11 @@ class GeometryProfileTableModel(PamhyrTableModel):
self.endMoveRows() self.endMoveRows()
self.layoutChanged.emit() self.layoutChanged.emit()
def purge(self): def purge(self, np_purge):
self._undo.push( self._undo.push(
PurgeCommand( PurgeCommand(
self._data, 24 self._data, np_purge
) )
) )
+18 -2
View File
@@ -20,8 +20,9 @@ import copy
import sys import sys
import csv import csv
from time import time from time import time
import logging
from tools import trace, timer from tools import trace, timer, logger_exception
from Modules import Modules from Modules import Modules
from PyQt5.QtGui import ( from PyQt5.QtGui import (
@@ -46,9 +47,12 @@ from View.Tools.Plot.PamhyrCanvas import MplCanvas
from View.Geometry.Profile.Plot import Plot from View.Geometry.Profile.Plot import Plot
from View.Geometry.Profile.Table import GeometryProfileTableModel from View.Geometry.Profile.Table import GeometryProfileTableModel
from View.Geometry.Profile.Translate import GeometryProfileTranslate from View.Geometry.Profile.Translate import GeometryProfileTranslate
from View.Geometry.PurgeDialog import PurgeDialog
_translate = QCoreApplication.translate _translate = QCoreApplication.translate
logger = logging.getLogger()
class ProfileWindow(PamhyrWindow): class ProfileWindow(PamhyrWindow):
_pamhyr_ui = "GeometryCrossSection" _pamhyr_ui = "GeometryCrossSection"
@@ -165,7 +169,6 @@ class ProfileWindow(PamhyrWindow):
if Modules.GEOMETRY not in key: if Modules.GEOMETRY not in key:
return return
logger.debug("TOTO")
self._tablemodel.layoutChanged.emit() self._tablemodel.layoutChanged.emit()
self._update(redraw=True, propagate=False) self._update(redraw=True, propagate=False)
@@ -258,6 +261,19 @@ class ProfileWindow(PamhyrWindow):
self._tablemodel.purge() self._tablemodel.purge()
self.update() self.update()
def purge(self):
try:
dlg = PurgeDialog(
trad=self._trad,
parent=self
)
if dlg.exec():
self._tablemodel.purge(dlg.np_purge)
self._plot.draw()
except Exception as e:
logger_exception(e)
return
def reverse(self): def reverse(self):
self._tablemodel.reverse() self._tablemodel.reverse()
self.update() self.update()
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+60
View File
@@ -0,0 +1,60 @@
# PurgeDialog.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
from View.Tools.PamhyrWindow import PamhyrDialog
from PyQt5.QtGui import (
QKeySequence,
)
from PyQt5.QtCore import (
Qt, QVariant, QAbstractTableModel,
)
from PyQt5.QtWidgets import (
QUndoStack, QShortcut, QSpinBox,
)
class PurgeDialog(PamhyrDialog):
_pamhyr_ui = "PurgeOptions"
_pamhyr_name = "Purge"
def __init__(self, trad=None, parent=None):
super(PurgeDialog, self).__init__(
title=trad[self._pamhyr_name],
trad=trad,
options=[],
parent=parent
)
self._init_default_values()
def _init_default_values(self):
self._np_purge = 24
@property
def np_purge(self):
return self._np_purge
def accept(self):
self._np_purge = self.get_spin_box("spinBox_np_purge")
super().accept()
def reject(self):
self.close()
+2 -2
View File
@@ -259,11 +259,11 @@ class GeometryReachTableModel(PamhyrTableModel):
self.layoutAboutToBeChanged.emit() self.layoutAboutToBeChanged.emit()
self.layoutChanged.emit() self.layoutChanged.emit()
def purge(self): def purge(self, np_purge):
self._undo.push( self._undo.push(
PurgeCommand( PurgeCommand(
self._data, 24 self._data, np_purge
) )
) )
self.layoutChanged.emit() self.layoutChanged.emit()
+4 -4
View File
@@ -33,12 +33,12 @@ class GeometryTranslate(MainTranslate):
self._dict["open_file"] = _translate("Geometry", "Open a file") self._dict["open_file"] = _translate("Geometry", "Open a file")
self._dict["file_st"] = _translate( self._dict["file_st"] = _translate(
"Geometry", "File mage geometry (*.ST *.st)") "Geometry", "Mage geometry file (*.ST *.st)")
self._dict["file_m"] = _translate( self._dict["file_m"] = _translate(
"Geometry", "File mage meshed geometry (*.M *.m)") "Geometry", "Mage meshed geometry file (*.M *.m)")
self._dict["file_shp"] = _translate( self._dict["file_shp"] = _translate(
"Geometry", "Shapefile (*.SHP *.shp)") "Geometry", "Shapefile (*.SHP *.shp)")
self._dict["file_all"] = _translate("Geometry", "All file (*)") self._dict["file_all"] = _translate("Geometry", "All files (*)")
self._dict["cross_section"] = _translate("Geometry", "cross-section") self._dict["cross_section"] = _translate("Geometry", "cross-section")
self._dict["cross_sections"] = _translate("Geometry", "cross-sections") self._dict["cross_sections"] = _translate("Geometry", "cross-sections")
@@ -70,7 +70,7 @@ class GeometryTranslate(MainTranslate):
"2": _translate("Geometry", "the second guide-line"), "2": _translate("Geometry", "the second guide-line"),
"3": _translate( "3": _translate(
"Geometry", "Geometry",
"the means between the two guide-lines" "the mean over the two guide-lines"
), ),
} }
+1 -1
View File
@@ -1,4 +1,4 @@
# MeshingDialog.py -- Pamhyr # UpdateKPDialog.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE # Copyright (C) 2023-2024 INRAE
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
+30 -8
View File
@@ -57,6 +57,7 @@ from View.Geometry.PlotAC import PlotAC
from View.Geometry.PlotKPZ import PlotKPZ from View.Geometry.PlotKPZ import PlotKPZ
from View.Geometry.MeshingDialog import MeshingDialog from View.Geometry.MeshingDialog import MeshingDialog
from View.Geometry.UpdateKPDialog import UpdateKPDialog from View.Geometry.UpdateKPDialog import UpdateKPDialog
from View.Geometry.PurgeDialog import PurgeDialog
from View.Geometry.Translate import GeometryTranslate from View.Geometry.Translate import GeometryTranslate
from View.Geometry.Profile.Window import ProfileWindow from View.Geometry.Profile.Window import ProfileWindow
@@ -157,6 +158,9 @@ class GeometryWindow(PamhyrWindow):
def _compute_status_label(self): def _compute_status_label(self):
row = self.index_selected_row() row = self.index_selected_row()
if row is None:
return
profile = self._reach.profile(row) profile = self._reach.profile(row)
name = profile.name + " " + str(profile.kp) name = profile.name + " " + str(profile.kp)
@@ -298,10 +302,8 @@ class GeometryWindow(PamhyrWindow):
data = { data = {
"step": dlg.space_step, "step": dlg.space_step,
"limites": [dlg.begin_cs, dlg.end_cs], "limites": [dlg.begin_cs, dlg.end_cs],
"origin": dlg.origin,
"directrices": [dlg.begin_dir, dlg.end_dir], "directrices": [dlg.begin_dir, dlg.end_dir],
"lplan": dlg.lplan, "lplan": dlg.lplan,
"lm": dlg.lm,
"linear": dlg.linear, "linear": dlg.linear,
} }
self._edit_meshing(data) self._edit_meshing(data)
@@ -405,7 +407,6 @@ class GeometryWindow(PamhyrWindow):
def update_plot_ac(self, ind: int): def update_plot_ac(self, ind: int):
self.tableView.model().blockSignals(True) self.tableView.model().blockSignals(True)
self._plot_ac.current = ind
self._plot_ac.update() self._plot_ac.update()
self.tableView.model().blockSignals(False) self.tableView.model().blockSignals(False)
@@ -449,10 +450,9 @@ class GeometryWindow(PamhyrWindow):
def select_current_profile(self): def select_current_profile(self):
self.tableView.model().blockSignals(True) self.tableView.model().blockSignals(True)
if len(self.tableView.selectedIndexes()) > 0:
row = self.index_selected_row() row = self.index_selected_row()
if row is not None:
self.find(QSlider, "verticalSlider").setValue(row) self.find(QSlider, "verticalSlider").setValue(row)
self.select_plot_xy(row) self.select_plot_xy(row)
self.select_plot_kpc(row) self.select_plot_kpc(row)
@@ -511,10 +511,14 @@ class GeometryWindow(PamhyrWindow):
self._table.delete(rows) self._table.delete(rows)
def index_selected_row(self): def index_selected_row(self):
return self.tableView\ r = self.tableView\
.selectionModel()\ .selectionModel()\
.selectedRows()[0]\ .selectedRows()
.row()
if len(r) > 0:
return r[0].row()
else:
return None
def sort_ascending(self): def sort_ascending(self):
self._table.sort_profiles(False) self._table.sort_profiles(False)
@@ -529,11 +533,17 @@ class GeometryWindow(PamhyrWindow):
def move_up(self): def move_up(self):
row = self.index_selected_row() row = self.index_selected_row()
if row is None:
return
self._table.move_up(row) self._table.move_up(row)
self.select_current_profile() self.select_current_profile()
def move_down(self): def move_down(self):
row = self.index_selected_row() row = self.index_selected_row()
if row is None:
return
self._table.move_down(row) self._table.move_down(row)
self.select_current_profile() self.select_current_profile()
@@ -541,6 +551,18 @@ class GeometryWindow(PamhyrWindow):
self._table.purge() self._table.purge()
self.update_redraw() self.update_redraw()
def purge(self):
try:
dlg = PurgeDialog(
trad=self._trad,
parent=self
)
if dlg.exec():
self._table.purge(dlg.np_purge)
except Exception as e:
logger_exception(e)
return
def duplicate(self): def duplicate(self):
rows = [ rows = [
row.row() for row in row.row() for row in
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
@@ -28,7 +28,7 @@ class BasicHydraulicStructuresTranslate(MainTranslate):
super(BasicHydraulicStructuresTranslate, self).__init__() super(BasicHydraulicStructuresTranslate, self).__init__()
self._dict["Basic Hydraulic Structures"] = _translate( self._dict["Basic Hydraulic Structures"] = _translate(
"BasicHydraulicStructures", "Basic Hydraulic Structures" "BasicHydraulicStructures", "Basic Hydraulic Structure"
) )
self._dict['msg_type_change_title'] = _translate( self._dict['msg_type_change_title'] = _translate(
@@ -138,7 +138,7 @@ hydraulic structure values?"
"BasicHydraulicStructures", "Check valve" "BasicHydraulicStructures", "Check valve"
), ),
"UD": _translate( "UD": _translate(
"BasicHydraulicStructures", "User defined" "BasicHydraulicStructures", "User-defined"
), ),
} }
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+25 -2
View File
@@ -52,18 +52,41 @@ class PlotDischarge(PamhyrPlot):
self._init = True self._init = True
def draw_data(self): def draw_data(self):
kp = self.data.reach.reach.get_kp() self.line_discharge = []
if len(self.data) != 0: if len(self.data) != 0:
kp = self.data.get_kp() kp = self.data.get_kp()
discharge = self.data.get_discharge() discharge = self.data.get_discharge()
self.line_kp_zmin = self.canvas.axes.plot( line, = self.canvas.axes.plot(
kp, discharge, kp, discharge,
color=self.color_plot, color=self.color_plot,
**self.plot_default_kargs **self.plot_default_kargs
) )
self.line_discharge.append(line)
@timer @timer
def update(self, ind=None): def update(self, ind=None):
if not self._init:
self.draw() self.draw()
self.update_data()
self.update_idle()
def update_data(self):
if len(self.data) == len(self.line_discharge):
kp = self.data.get_kp()
discharge = self.data.get_discharge()
line, = self.canvas.axes.plot(
kp, discharge,
color=self.color_plot,
**self.plot_default_kargs
)
self.line_discharge.append(line)
else:
for line in self.line_discharge:
line.remove()
self._draw_data()
+5
View File
@@ -194,7 +194,12 @@ class InitialConditionsWindow(PamhyrWindow):
return rows[0].row() return rows[0].row()
def update(self): def update(self):
self.update(propagate=False)
def _update(self, propagate=True):
self._update_plot() self._update_plot()
if propagate:
self._propagate_update(key=Modules.INITIAL_CONDITION) self._propagate_update(key=Modules.INITIAL_CONDITION)
def _update_plot(self): def _update_plot(self):
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
@@ -28,7 +28,7 @@ class LCETranslate(LCTranslate):
def __init__(self): def __init__(self):
super(LCETranslate, self).__init__() super(LCETranslate, self).__init__()
self._dict["Edit lateral contribution"] = _translate( self._dict["Edit lateral contribution"] = _translate(
"LateralContribution", "Edit lateral contribution" "LateralContribution", "Edit lateral sources"
) )
self._sub_dict["table_headers"] = { self._sub_dict["table_headers"] = {
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+4 -4
View File
@@ -39,12 +39,12 @@ class LCTranslate(MainTranslate):
super(LCTranslate, self).__init__() super(LCTranslate, self).__init__()
self._dict["Lateral contribution"] = _translate( self._dict["Lateral contribution"] = _translate(
"LateralContribution", "Lateral contribution" "LateralContribution", "Lateral sources"
) )
self._sub_dict["long_types"] = { self._sub_dict["long_types"] = {
"ND": self._dict["not_defined"], "ND": self._dict["not_defined"],
"LC": _translate("LateralContribution", "Lateral contribution"), "LC": _translate("LateralContribution", "Lateral sources"),
"RA": _translate("LateralContribution", "Rain"), "RA": _translate("LateralContribution", "Rain"),
"EV": _translate("LateralContribution", "Evaporation"), "EV": _translate("LateralContribution", "Evaporation"),
} }
@@ -57,6 +57,6 @@ class LCTranslate(MainTranslate):
"name": self._dict["name"], "name": self._dict["name"],
"type": self._dict["type"], "type": self._dict["type"],
"edge": self._dict["reach"], "edge": self._dict["reach"],
"begin_kp": _translate("LateralContribution", "Begin kp (m)"), "begin_kp": _translate("LateralContribution", "Start (m)"),
"end_kp": _translate("LateralContribution", "End kp (m)") "end_kp": _translate("LateralContribution", "End (m)")
} }
+22 -4
View File
@@ -448,8 +448,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
if Modules.CONFIG in keys: if Modules.CONFIG in keys:
self._do_update_config() self._do_update_config()
if Modules.STUDY in keys: self._do_propagate_update_info_tab(keys)
self._tab_widget_info.update()
logger.debug(f"Propagation of {keys}") logger.debug(f"Propagation of {keys}")
for _, window in self.sub_win_list: for _, window in self.sub_win_list:
@@ -458,6 +457,18 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
self._tab_widget_checker.update(modules=keys) self._tab_widget_checker.update(modules=keys)
def _do_propagate_update_info_tab(self, keys):
modules = Modules.modelling_list()
modules.append(Modules.STUDY)
has_info_mod = reduce(
lambda acc, m: acc or (m in keys),
modules, False
)
if has_info_mod:
self._tab_widget_info.update()
def _do_propagate_update_rec(self, window, keys): def _do_propagate_update_rec(self, window, keys):
for _, win in window.sub_win_list: for _, win in window.sub_win_list:
win._propagated_update(key=keys) win._propagated_update(key=keys)
@@ -901,7 +912,10 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
Nothing Nothing
""" """
if self._study is None: if self._study is None:
dialog = QFileDialog(self) options = QFileDialog.Options()
options |= QFileDialog.DontUseNativeDialog
dialog = QFileDialog(self, options=options)
dialog.setFileMode(QFileDialog.FileMode.ExistingFile) dialog.setFileMode(QFileDialog.FileMode.ExistingFile)
dialog.setDefaultSuffix(".pamhyr") dialog.setDefaultSuffix(".pamhyr")
# dialog.setFilter(dialog.filter() | QtCore.QDir.Hidden) # dialog.setFilter(dialog.filter() | QtCore.QDir.Hidden)
@@ -1293,7 +1307,11 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
if self._study.filename == "": if self._study.filename == "":
return return
dialog = QFileDialog(self) options = QFileDialog.Options()
options |= QFileDialog.DontUseNativeDialog
dialog = QFileDialog(self, options=options)
dialog.setFileMode(QFileDialog.FileMode.ExistingFile) dialog.setFileMode(QFileDialog.FileMode.ExistingFile)
dialog.setDefaultSuffix(".BIN") dialog.setDefaultSuffix(".BIN")
# dialog.setFilter(dialog.filter() | QtCore.QDir.Hidden) # dialog.setFilter(dialog.filter() | QtCore.QDir.Hidden)
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+3 -3
View File
@@ -28,7 +28,7 @@ class CustomPlotTranslate(ResultsTranslate):
super(CustomPlotTranslate, self).__init__() super(CustomPlotTranslate, self).__init__()
self._dict["Custom Plot Selection"] = _translate( self._dict["Custom Plot Selection"] = _translate(
"CustomPlot", "Custom Plot Selection" "CustomPlot", "Custom plot selection"
) )
# Value type # Value type
@@ -38,13 +38,13 @@ class CustomPlotTranslate(ResultsTranslate):
self._dict['water_elevation'] = self._dict["unit_water_elevation"] self._dict['water_elevation'] = self._dict["unit_water_elevation"]
self._dict['discharge'] = self._dict["unit_discharge"] self._dict['discharge'] = self._dict["unit_discharge"]
self._dict['elevation'] = _translate( self._dict['elevation'] = _translate(
"CustomPlot", "Bed load elevation (m)" "CustomPlot", "Bed elevation (m)"
) )
# Unit corresponding long name (plot axes display) # Unit corresponding long name (plot axes display)
self._dict['0-meter'] = _translate( self._dict['0-meter'] = _translate(
"CustomPlot", "Bed load elevation (m)" "CustomPlot", "Bed elevation (m)"
) )
self._dict['1-m3s'] = self._dict["unit_discharge"] self._dict['1-m3s'] = self._dict["unit_discharge"]
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+3
View File
@@ -109,8 +109,11 @@ class PlotKPC(PamhyrPlot):
def draw_profiles_hs(self, reach): def draw_profiles_hs(self, reach):
lhs = filter( lhs = filter(
lambda hs: hs._input_reach.reach is reach.geometry, lambda hs: hs._input_reach.reach is reach.geometry,
filter(
lambda hs: hs._input_reach is not None,
self.results.study.river.hydraulic_structures.lst self.results.study.river.hydraulic_structures.lst
) )
)
for hs in lhs: for hs in lhs:
x = hs.input_kp x = hs.input_kp
+1 -1
View File
@@ -231,7 +231,7 @@ class PlotSedReach(PamhyrPlot):
return return
self.canvas.axes.set_xlabel( self.canvas.axes.set_xlabel(
_translate("MainWindow_reach", "Kp (m)"), _translate("MainWindow_reach", "Position (m)"),
color='black', fontsize=10 color='black', fontsize=10
) )
self.canvas.axes.set_ylabel( self.canvas.axes.set_ylabel(
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+4 -4
View File
@@ -99,7 +99,7 @@ class ParamTranslate(MainTranslate):
"Minimum water height (meter)"), "Minimum water height (meter)"),
"mage_max_niter": "mage_max_niter":
_translate("SolverParameters", _translate("SolverParameters",
"Maximun number of iterations (< 100)"), "Maximum number of iterations (< 100)"),
"mage_timestep_reduction_factor": "mage_timestep_reduction_factor":
_translate("SolverParameters", _translate("SolverParameters",
"Timestep reduction factor"), "Timestep reduction factor"),
@@ -114,10 +114,10 @@ class ParamTranslate(MainTranslate):
"Reduction precision factor of residue"), "Reduction precision factor of residue"),
"mage_niter_max_precision": "mage_niter_max_precision":
_translate("SolverParameters", _translate("SolverParameters",
"Number of iteration at maximum precision"), "Number of iterations at maximum precision"),
"mage_niter_before_switch": "mage_niter_before_switch":
_translate("SolverParameters", _translate("SolverParameters",
"Number of iteration before switch"), "Number of iterations before switch"),
"mage_max_froude": "mage_max_froude":
_translate("SolverParameters", _translate("SolverParameters",
"Maximum accepted Froude number"), "Maximum accepted Froude number"),
@@ -152,7 +152,7 @@ class ParamTranslate(MainTranslate):
"mage_methode_modification_geometrie": "mage_methode_modification_geometrie":
_translate("SolverParameters", "Geometry modification method"), _translate("SolverParameters", "Geometry modification method"),
"mage_shields_critique": "mage_shields_critique":
_translate("SolverParameters", "Critic shields"), _translate("SolverParameters", "Critical Shields number"),
"mage_shields_correction": "mage_shields_correction":
_translate("SolverParameters", "Shields correction"), _translate("SolverParameters", "Shields correction"),
"mage_capacite_solide": "mage_capacite_solide":
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+1 -1
View File
@@ -28,7 +28,7 @@ class StricklersTranslate(MainTranslate):
super(StricklersTranslate, self).__init__() super(StricklersTranslate, self).__init__()
self._dict["Stricklers"] = _translate( self._dict["Stricklers"] = _translate(
"Stricklers", "Stricklers" "Stricklers", "Strickler coefficients"
) )
self._sub_dict["table_headers"] = { self._sub_dict["table_headers"] = {
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+4 -1
View File
@@ -102,7 +102,10 @@ class WindowToolKit(object):
Returns: Returns:
The returns of callback The returns of callback
""" """
dialog = QFileDialog(self) options = QFileDialog.Options()
options |= QFileDialog.DontUseNativeDialog
dialog = QFileDialog(self, options=options)
if select_file: if select_file:
mode = QFileDialog.FileMode.ExistingFile mode = QFileDialog.FileMode.ExistingFile
+6 -6
View File
@@ -112,7 +112,7 @@ class PamhyrPlotToolbar(NavigationToolbar2QT):
self.toolitems.append( self.toolitems.append(
( (
'Forward', 'Forward',
_translate("Toolbar", 'Return to next view'), _translate("Toolbar", 'Back to next view'),
'forward', 'forward' 'forward', 'forward'
) )
) )
@@ -121,7 +121,7 @@ class PamhyrPlotToolbar(NavigationToolbar2QT):
self.toolitems.append( self.toolitems.append(
( (
'Pan', 'Pan',
_translate("Toolbar", 'Axes panoramic'), _translate("Toolbar", 'Panoramic axes'),
'move', 'pan' 'move', 'pan'
) )
) )
@@ -184,7 +184,7 @@ class PamhyrPlotToolbar(NavigationToolbar2QT):
self.toolitems.append( self.toolitems.append(
( (
'Save', 'Save',
_translate("Toolbar", 'Save the figure'), _translate("Toolbar", 'Save figure'),
'filesave', 'save_figure' 'filesave', 'save_figure'
) )
) )
@@ -253,12 +253,12 @@ class PamhyrPlotToolbar(NavigationToolbar2QT):
self._actions['back'].setToolTip( self._actions['back'].setToolTip(
_translate("Toolbar", "Back to previous view")) _translate("Toolbar", "Back to previous view"))
self._actions['forward'].setToolTip( self._actions['forward'].setToolTip(
_translate("Toolbar", "Return to next view")) _translate("Toolbar", "Back to next view"))
self._actions['pan'].setToolTip( self._actions['pan'].setToolTip(
_translate("Toolbar", "Axes panoramic")) _translate("Toolbar", "Panoramic axes"))
self._actions['zoom'].setToolTip(_translate("Toolbar", "Zoom")) self._actions['zoom'].setToolTip(_translate("Toolbar", "Zoom"))
self._actions['save_figure'].setToolTip( self._actions['save_figure'].setToolTip(
_translate("Toolbar", "Save the figure")) _translate("Toolbar", "Save figure"))
self.action_isometric_view.setToolTip( self.action_isometric_view.setToolTip(
_translate("Toolbar", "Isometric view (Shift+W)")) _translate("Toolbar", "Isometric view (Shift+W)"))
self.action_auto_global_view.setToolTip( self.action_auto_global_view.setToolTip(
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+2 -2
View File
@@ -52,7 +52,7 @@ class UnitTranslate(CommonWordTranslate):
def __init__(self): def __init__(self):
super(UnitTranslate, self).__init__() super(UnitTranslate, self).__init__()
self._dict["unit_kp"] = _translate("Unit", "KP (m)") self._dict["unit_kp"] = _translate("Unit", "Position (m)")
self._dict["unit_width"] = _translate("Unit", "Width (m)") self._dict["unit_width"] = _translate("Unit", "Width (m)")
self._dict["unit_height"] = _translate("Unit", "Height (m)") self._dict["unit_height"] = _translate("Unit", "Height (m)")
self._dict["unit_diameter"] = _translate("Unit", "Diameter (m)") self._dict["unit_diameter"] = _translate("Unit", "Diameter (m)")
@@ -90,5 +90,5 @@ class MainTranslate(UnitTranslate):
"MainWindow", "Open SQLite debuging tool ('sqlitebrowser')" "MainWindow", "Open SQLite debuging tool ('sqlitebrowser')"
) )
self._dict["active_window"] = _translate( self._dict["active_window"] = _translate(
"MainWindow", "Activate this window" "MainWindow", "Enable this window"
) )
+17
View File
@@ -0,0 +1,17 @@
# __init__.py -- Pamhyr
# Copyright (C) 2023-2024 INRAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
+5 -5
View File
@@ -37,7 +37,7 @@
</size> </size>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>2</number>
</property> </property>
<widget class="QWidget" name="tab_liquid"> <widget class="QWidget" name="tab_liquid">
<attribute name="title"> <attribute name="title">
@@ -61,7 +61,7 @@
</widget> </widget>
<widget class="QWidget" name="tab_suspenssion"> <widget class="QWidget" name="tab_suspenssion">
<attribute name="title"> <attribute name="title">
<string>Suspenssion</string> <string>Suspension</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0"> <item row="0" column="0">
@@ -114,7 +114,7 @@
<string>Add</string> <string>Add</string>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Add a new boundary condition or punctual contribution</string> <string>Add a new boundary condition or point source</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+N</string> <string>Ctrl+N</string>
@@ -144,7 +144,7 @@
<string>Edit</string> <string>Edit</string>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Edit boundary condition or punctual contribution</string> <string>Edit boundary condition or point source</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+E</string> <string>Ctrl+E</string>
@@ -159,7 +159,7 @@
<string>Sort</string> <string>Sort</string>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Sort boundary condition by name</string> <string>Sort by names</string>
</property> </property>
</action> </action>
</widget> </widget>
+4 -4
View File
@@ -164,7 +164,7 @@
<item> <item>
<widget class="QLabel" name="label_9"> <widget class="QLabel" name="label_9">
<property name="text"> <property name="text">
<string>Frequence</string> <string>Frequency</string>
</property> </property>
</widget> </widget>
</item> </item>
@@ -349,7 +349,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>This value must be used for reading or editing files in speficic case.</string> <string>This value must be used for reading or editing files in speficic cases.</string>
</property> </property>
</widget> </widget>
</item> </item>
@@ -374,7 +374,7 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_12"> <widget class="QLabel" name="label_12">
<property name="text"> <property name="text">
<string> - The &quot;@file&quot; keyworkd is replace by the path of file to open.</string> <string> - The &quot;@file&quot; keyword is replaced by the path of file to open.</string>
</property> </property>
</widget> </widget>
</item> </item>
@@ -382,7 +382,7 @@
</widget> </widget>
<widget class="QWidget" name="tab_language"> <widget class="QWidget" name="tab_language">
<attribute name="title"> <attribute name="title">
<string>Language</string> <string>Langue</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_6"> <layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0"> <item row="0" column="0">
+1 -1
View File
@@ -23,7 +23,7 @@
<item> <item>
<widget class="QPushButton" name="pushButton"> <widget class="QPushButton" name="pushButton">
<property name="text"> <property name="text">
<string>Eval</string> <string>Evaluate</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset> <iconset>
+2 -2
View File
@@ -86,7 +86,7 @@
<string>Add</string> <string>Add</string>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Add a new point in boundary condition or punctual contribution</string> <string>Add a new point</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+N</string> <string>Ctrl+N</string>
@@ -116,7 +116,7 @@
<string>Sort</string> <string>Sort</string>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Sort boundary condition points</string> <string>Sort points</string>
</property> </property>
</action> </action>
</widget> </widget>
+2 -2
View File
@@ -79,7 +79,7 @@
<string>Add</string> <string>Add</string>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Add a new point in boundary condition or lateral contribution</string> <string>Add a new point in boundary condition or lateral source</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+N</string> <string>Ctrl+N</string>
@@ -109,7 +109,7 @@
<string>Sort</string> <string>Sort</string>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Sort boundary condition point</string> <string>Sort points</string>
</property> </property>
</action> </action>
</widget> </widget>
+4 -1
View File
@@ -98,7 +98,10 @@
<normaloff>ressources/edit.png</normaloff>ressources/edit.png</iconset> <normaloff>ressources/edit.png</normaloff>ressources/edit.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Edit stricklers</string> <string>Edit Strickler coefficients</string>
</property>
<property name="toolTip">
<string>Edit Strickler coefficients</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+E</string> <string>Ctrl+E</string>
Loaded 100 of 122 files, more files were not shown because too many files have changed in this diff. Show more