wolfhece 1.8.12__py3-none-any.whl → 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wolfhece/GraphNotebook.py +0 -1
- wolfhece/PyCrosssections.py +591 -5
- wolfhece/PyDraw.py +1151 -413
- wolfhece/PyGui.py +2 -4
- wolfhece/PyParams.py +1515 -852
- wolfhece/PyVertex.py +73 -73
- wolfhece/PyVertexvectors.py +226 -808
- wolfhece/RatingCurve.py +19 -6
- wolfhece/apps/wolf2D.py +11 -0
- wolfhece/apps/wolfcompare2Darrays.py +51 -22
- wolfhece/bernoulli/NetworkOpenGL.py +337 -341
- wolfhece/drawing_obj.py +25 -0
- wolfhece/hydrology/Catchment.py +77 -77
- wolfhece/hydrology/Optimisation.py +206 -53
- wolfhece/hydrology/PostProcessHydrology.py +22 -22
- wolfhece/hydrology/SubBasin.py +17 -17
- wolfhece/hydrology/constant.py +4 -0
- wolfhece/hydrology/cst_exchanges.py +2 -1
- wolfhece/lazviewer/processing/estimate_normals/estimate_normals.cp310-win_amd64.pyd +0 -0
- wolfhece/lazviewer/vfuncs/vfuncs.cp310-win_amd64.pyd +0 -0
- wolfhece/libs/WolfDll.dll +0 -0
- wolfhece/libs/wolfogl.cp310-win_amd64.pyd +0 -0
- wolfhece/libs/wolfpy.cp310-win_amd64.pyd +0 -0
- wolfhece/mesh2d/wolf2dprev.py +4 -4
- wolfhece/multiprojects.py +13 -13
- wolfhece/pylogging.py +1 -1
- wolfhece/pyshields.py +213 -136
- wolfhece/pyviews.py +23 -23
- wolfhece/wolf_array.py +69 -152
- wolfhece/wolf_texture.py +39 -16
- wolfhece/wolfresults_2D.py +4 -4
- {wolfhece-1.8.12.dist-info → wolfhece-2.0.0.dist-info}/METADATA +3 -2
- {wolfhece-1.8.12.dist-info → wolfhece-2.0.0.dist-info}/RECORD +38 -34
- wolfhece/apps/wolfgpu.py +0 -19
- /wolfhece/lazviewer/processing/estimate_normals/{estimate_normals.pyd → estimate_normals.cp39-win_amd64.pyd} +0 -0
- /wolfhece/lazviewer/vfuncs/{vfuncs.pyd → vfuncs.cp39-win_amd64.pyd} +0 -0
- {wolfhece-1.8.12.dist-info → wolfhece-2.0.0.dist-info}/LICENCE +0 -0
- {wolfhece-1.8.12.dist-info → wolfhece-2.0.0.dist-info}/WHEEL +0 -0
- {wolfhece-1.8.12.dist-info → wolfhece-2.0.0.dist-info}/top_level.txt +0 -0
wolfhece/RatingCurve.py
CHANGED
@@ -19,6 +19,7 @@ except:
|
|
19
19
|
from .PyTranslate import _
|
20
20
|
from .PyVertex import circle,quad,cross,getRGBfromI,getIfromRGB
|
21
21
|
from .RatingCurveData import *
|
22
|
+
from .drawing_obj import Element_To_Draw
|
22
23
|
|
23
24
|
POLYNOMIAL_LAW=0
|
24
25
|
POWER_LAW=1
|
@@ -361,9 +362,9 @@ class SPWGaugings(gaugings):
|
|
361
362
|
"""
|
362
363
|
super().__init__(data)
|
363
364
|
|
364
|
-
class SPWMIGaugingStations():
|
365
|
+
class SPWMIGaugingStations(Element_To_Draw):
|
365
366
|
|
366
|
-
mystations:dict
|
367
|
+
mystations:dict[int:gaugingstation]
|
367
368
|
myrivers:dict
|
368
369
|
gaugings:SPWGaugings
|
369
370
|
hrefs:SPWhrefs
|
@@ -486,11 +487,23 @@ class SPWMIGaugingStations():
|
|
486
487
|
|
487
488
|
pass
|
488
489
|
|
489
|
-
def plot(self,size:float=10.):
|
490
|
-
|
491
|
-
|
490
|
+
def plot(self, sx=None, sy=None, xmin=None, ymin=None, xmax=None, ymax=None, size:float=10.):
|
491
|
+
self._plot(size)
|
492
|
+
|
493
|
+
def find_minmax(self,update=False):
|
494
|
+
x = [cur.x for cur in self.mystations.values()]
|
495
|
+
y = [cur.y for cur in self.mystations.values()]
|
496
|
+
|
497
|
+
self.xmin = min(x)
|
498
|
+
self.xmax = max(x)
|
499
|
+
self.ymin = min(y)
|
500
|
+
self.ymax = max(y)
|
501
|
+
|
502
|
+
def _plot(self, size:float=10.):
|
503
|
+
for curstation in self.mystations.values:
|
504
|
+
curstation.plot(size)
|
492
505
|
|
493
|
-
class SPWDCENNGaugingStations():
|
506
|
+
class SPWDCENNGaugingStations(Element_To_Draw):
|
494
507
|
|
495
508
|
mystations:dict
|
496
509
|
myrivers:dict
|
wolfhece/apps/wolf2D.py
ADDED
@@ -2,6 +2,8 @@
|
|
2
2
|
from os import path
|
3
3
|
import sys
|
4
4
|
import wx
|
5
|
+
from pathlib import Path
|
6
|
+
from typing import Union
|
5
7
|
|
6
8
|
#Import des modules WOLF
|
7
9
|
try:
|
@@ -13,11 +15,25 @@ except:
|
|
13
15
|
from wolfhece.PyDraw import WolfMapViewer
|
14
16
|
from wolfhece.wolf_array import WolfArray
|
15
17
|
|
16
|
-
def main(
|
18
|
+
def main(mydir:Path=None, ListArrays:list[WolfArray]=None):
|
17
19
|
"""Comparaison de 2 cartes WOLF
|
18
20
|
args :
|
19
|
-
-
|
21
|
+
- mydir : répertoire contenant 2 matrices WOLF (ref.bin et comp.bin) et leurs fichiers accompagant
|
22
|
+
- ListArrays : liste de 2 objets WolfArray
|
20
23
|
"""
|
24
|
+
if mydir is not None:
|
25
|
+
assert isinstance(mydir,Path), _('mydir must be a Path object')
|
26
|
+
assert mydir.exists(), _('mydir must exist')
|
27
|
+
fileref = Path(path.join(mydir,'ref.bin'))
|
28
|
+
filecomp = Path(path.join(mydir,'comp.bin'))
|
29
|
+
assert fileref.exists(), _('ref.bin not found in directory')
|
30
|
+
assert filecomp.exists(), _('comp.bin not found in directory')
|
31
|
+
if ListArrays is not None:
|
32
|
+
assert isinstance(ListArrays,list), _('ListArrays must be a list')
|
33
|
+
assert len(ListArrays)==2, _('ListArrays must contain 2 WolfArray objects')
|
34
|
+
assert isinstance(ListArrays[0],WolfArray), _('ListArrays must contain 2 WolfArray objects')
|
35
|
+
assert isinstance(ListArrays[1],WolfArray), _('ListArrays must contain 2 WolfArray objects')
|
36
|
+
|
21
37
|
#Déclaration de l'App WX
|
22
38
|
ex = wx.App()
|
23
39
|
#Choix de la langue
|
@@ -30,32 +46,31 @@ def main(strmydir='',ListArrays=None):
|
|
30
46
|
third = WolfMapViewer(None,'Third',w=600,h=600)
|
31
47
|
|
32
48
|
#Création d'une liste contenant les 3 instances d'objet "WolfMapViewer"
|
33
|
-
list=[]
|
34
|
-
|
35
|
-
|
36
|
-
|
49
|
+
mylist:list[WolfMapViewer]=[]
|
50
|
+
mylist.append(first)
|
51
|
+
mylist.append(second)
|
52
|
+
mylist.append(third)
|
37
53
|
|
38
54
|
#On indique que les objets sont liés en actiavt le Booléen et en pointant la liste précédente
|
39
|
-
for curlist in
|
55
|
+
for curlist in mylist:
|
40
56
|
curlist.linked=True
|
41
|
-
curlist.linkedList=
|
57
|
+
curlist.linkedList=mylist
|
42
58
|
|
43
|
-
if
|
59
|
+
if mydir is not None:
|
44
60
|
#Création des matrices WolfArray sur base des fichiers
|
45
|
-
mnt = WolfArray(path.join(
|
46
|
-
mns = WolfArray(path.join(
|
61
|
+
mnt = WolfArray(path.join(mydir,'ref.bin'))
|
62
|
+
mns = WolfArray(path.join(mydir,'comp.bin'))
|
47
63
|
elif ListArrays is not None:
|
48
|
-
|
49
|
-
|
50
|
-
mns = ListArrays[1]
|
64
|
+
mnt = ListArrays[0]
|
65
|
+
mns = ListArrays[1]
|
51
66
|
|
52
67
|
#Création du différentiel -- Les opérateurs mathématiques sont surchargés
|
53
68
|
diff = mns-mnt
|
54
69
|
|
55
70
|
#Ajout des matrices dans les fenêtres de visualisation
|
56
|
-
first.add_object('array',newobj=mnt,ToCheck=True,id='
|
57
|
-
second.add_object('array',newobj=mns,ToCheck=True,id='
|
58
|
-
third.add_object('array',newobj=diff,ToCheck=True,id='DIFF')
|
71
|
+
first.add_object('array',newobj=mnt,ToCheck=True,id='reference')
|
72
|
+
second.add_object('array',newobj=mns,ToCheck=True,id='comparison')
|
73
|
+
third.add_object('array',newobj=diff,ToCheck=True,id='DIFF = comp-ref')
|
59
74
|
|
60
75
|
#boucle infinie pour gérer les événements GUI
|
61
76
|
ex.MainLoop()
|
@@ -64,10 +79,24 @@ if __name__=='__main__':
|
|
64
79
|
"""gestion de l'éxécution du module en tant que code principal"""
|
65
80
|
# total arguments
|
66
81
|
n = len(sys.argv)
|
82
|
+
# arguments
|
83
|
+
print("Total arguments passed:", n)
|
84
|
+
assert n in [2,3], _('Usage : wolfcompare <directory> or wolfcompare <file1> <file2>')
|
85
|
+
|
67
86
|
if n==2:
|
68
|
-
mydir = sys.argv[1]
|
69
|
-
if
|
87
|
+
mydir = Path(sys.argv[1])
|
88
|
+
if mydir.exists():
|
70
89
|
main(mydir)
|
71
|
-
|
72
|
-
|
73
|
-
|
90
|
+
else:
|
91
|
+
print(_('Directory not found'))
|
92
|
+
elif n==3:
|
93
|
+
file1 = Path(sys.argv[1])
|
94
|
+
file2 = Path(sys.argv[2])
|
95
|
+
|
96
|
+
if file1.exists() and file2.exists():
|
97
|
+
main('', [WolfArray(file1), WolfArray(file2)])
|
98
|
+
else:
|
99
|
+
if not file1.exists():
|
100
|
+
print(_('File {} not found'.format(file1)))
|
101
|
+
if not file2.exists():
|
102
|
+
print(_('File {} not found'.format(file2)))
|