wolfhece 1.8.13__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.
Files changed (38) hide show
  1. wolfhece/GraphNotebook.py +0 -1
  2. wolfhece/PyCrosssections.py +591 -5
  3. wolfhece/PyDraw.py +1151 -413
  4. wolfhece/PyGui.py +2 -4
  5. wolfhece/PyParams.py +1515 -852
  6. wolfhece/PyVertex.py +73 -73
  7. wolfhece/PyVertexvectors.py +226 -808
  8. wolfhece/RatingCurve.py +19 -6
  9. wolfhece/apps/wolf2D.py +11 -0
  10. wolfhece/apps/wolfcompare2Darrays.py +51 -22
  11. wolfhece/bernoulli/NetworkOpenGL.py +337 -341
  12. wolfhece/drawing_obj.py +25 -0
  13. wolfhece/hydrology/Catchment.py +77 -77
  14. wolfhece/hydrology/Optimisation.py +206 -53
  15. wolfhece/hydrology/PostProcessHydrology.py +22 -22
  16. wolfhece/hydrology/SubBasin.py +17 -17
  17. wolfhece/hydrology/constant.py +4 -0
  18. wolfhece/hydrology/cst_exchanges.py +2 -1
  19. wolfhece/lazviewer/processing/estimate_normals/estimate_normals.cp310-win_amd64.pyd +0 -0
  20. wolfhece/lazviewer/vfuncs/vfuncs.cp310-win_amd64.pyd +0 -0
  21. wolfhece/libs/WolfDll.dll +0 -0
  22. wolfhece/libs/wolfogl.cp310-win_amd64.pyd +0 -0
  23. wolfhece/libs/wolfpy.cp310-win_amd64.pyd +0 -0
  24. wolfhece/mesh2d/wolf2dprev.py +4 -4
  25. wolfhece/multiprojects.py +13 -13
  26. wolfhece/pylogging.py +1 -1
  27. wolfhece/pyviews.py +23 -23
  28. wolfhece/wolf_array.py +69 -152
  29. wolfhece/wolf_texture.py +39 -16
  30. wolfhece/wolfresults_2D.py +1 -1
  31. {wolfhece-1.8.13.dist-info → wolfhece-2.0.0.dist-info}/METADATA +3 -2
  32. {wolfhece-1.8.13.dist-info → wolfhece-2.0.0.dist-info}/RECORD +37 -33
  33. wolfhece/apps/wolfgpu.py +0 -19
  34. /wolfhece/lazviewer/processing/estimate_normals/{estimate_normals.pyd → estimate_normals.cp39-win_amd64.pyd} +0 -0
  35. /wolfhece/lazviewer/vfuncs/{vfuncs.pyd → vfuncs.cp39-win_amd64.pyd} +0 -0
  36. {wolfhece-1.8.13.dist-info → wolfhece-2.0.0.dist-info}/LICENCE +0 -0
  37. {wolfhece-1.8.13.dist-info → wolfhece-2.0.0.dist-info}/WHEEL +0 -0
  38. {wolfhece-1.8.13.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
- for id in self.mystations:
491
- self.mystations[id].plot(size)
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
@@ -0,0 +1,11 @@
1
+ import wx
2
+ from wolfhece.PyGui import Wolf2DModel
3
+
4
+ def main():
5
+ ex = wx.App()
6
+ mydro=Wolf2DModel()
7
+ ex.MainLoop()
8
+
9
+ if __name__=='__main__':
10
+ main()
11
+
@@ -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(strmydir='',ListArrays=None):
18
+ def main(mydir:Path=None, ListArrays:list[WolfArray]=None):
17
19
  """Comparaison de 2 cartes WOLF
18
20
  args :
19
- - strmydir : répertoire contenant 2 matrices WOLF (1.bin et 2.bin) et leurs fichiers accompagant
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
- list.append(first)
35
- list.append(second)
36
- list.append(third)
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 list:
55
+ for curlist in mylist:
40
56
  curlist.linked=True
41
- curlist.linkedList=list
57
+ curlist.linkedList=mylist
42
58
 
43
- if strmydir!='':
59
+ if mydir is not None:
44
60
  #Création des matrices WolfArray sur base des fichiers
45
- mnt = WolfArray(path.join(strmydir,'1.bin'))
46
- mns = WolfArray(path.join(strmydir,'2.bin'))
61
+ mnt = WolfArray(path.join(mydir,'ref.bin'))
62
+ mns = WolfArray(path.join(mydir,'comp.bin'))
47
63
  elif ListArrays is not None:
48
- if len(ListArrays)==2:
49
- mnt = ListArrays[0]
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='MNT')
57
- second.add_object('array',newobj=mns,ToCheck=True,id='MNS')
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 path.exists(mydir):
87
+ mydir = Path(sys.argv[1])
88
+ if mydir.exists():
70
89
  main(mydir)
71
- else:
72
- if path.exists('d:\\compare'):
73
- main('d:\\compare')
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)))