wolfhece 2.0.17__py3-none-any.whl → 2.0.18__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 (39) hide show
  1. wolfhece/CpGrid.py +10 -13
  2. wolfhece/PyCrosssections.py +18 -13
  3. wolfhece/PyHydrographs.py +2 -2
  4. wolfhece/PyParams.py +15 -27
  5. wolfhece/PyPictures.py +48 -45
  6. wolfhece/PyVertexvectors.py +14 -19
  7. wolfhece/apps/curvedigitizer.py +4 -1
  8. wolfhece/apps/wolfcompare2Darrays.py +11 -7
  9. wolfhece/clientserver/clientserver.py +62 -0
  10. wolfhece/friction_law.py +39 -34
  11. wolfhece/ftp/downloader.py +8 -7
  12. wolfhece/gpuview.py +14 -13
  13. wolfhece/hydrology/Catchment.py +2 -2
  14. wolfhece/hydrology/PyWatershed.py +2 -2
  15. wolfhece/hydrology/SubBasin.py +13 -11
  16. wolfhece/hydrometry/kiwis_gui.py +9 -9
  17. wolfhece/irm_qdf.py +12 -10
  18. wolfhece/mar/Interface_MAR_WOLF_objet.py +260 -161
  19. wolfhece/opengl/py3d.py +4 -4
  20. wolfhece/pyshields.py +4 -4
  21. wolfhece/pythonfortran/example_makendarray.py +46 -41
  22. wolfhece/pythonfortran/example_numpy_memory.py +87 -83
  23. wolfhece/pythonfortran/tools.py +1 -1
  24. wolfhece/scenario/imposebc_void.py +2 -3
  25. wolfhece/scenario/update_void.py +6 -6
  26. wolfhece/wolf_array.py +17 -16
  27. wolfhece/wolfresults_2D.py +2 -4
  28. {wolfhece-2.0.17.dist-info → wolfhece-2.0.18.dist-info}/METADATA +7 -1
  29. {wolfhece-2.0.17.dist-info → wolfhece-2.0.18.dist-info}/RECORD +33 -38
  30. wolfhece/apps/wolfBernoulli.py +0 -18
  31. wolfhece/bernoulli/ModelJockgrim.py +0 -226
  32. wolfhece/bernoulli/NetworkOpenGL.py +0 -6461
  33. wolfhece/bernoulli/ReadNeupotzData.py +0 -223
  34. wolfhece/bernoulli/opti_results_interactive_plot.py +0 -212
  35. wolfhece/debug.py +0 -8
  36. /wolfhece/{bernoulli → clientserver}/__init__.py +0 -0
  37. {wolfhece-2.0.17.dist-info → wolfhece-2.0.18.dist-info}/WHEEL +0 -0
  38. {wolfhece-2.0.17.dist-info → wolfhece-2.0.18.dist-info}/entry_points.txt +0 -0
  39. {wolfhece-2.0.17.dist-info → wolfhece-2.0.18.dist-info}/top_level.txt +0 -0
@@ -6,16 +6,15 @@ import re
6
6
  MIT license: 2017 - Jwely
7
7
 
8
8
  Example usage:
9
- ``` python
9
+
10
10
  import ftplib
11
11
  ftp = ftplib.FTP(mysite, username, password)
12
12
  download_ftp_tree(ftp, remote_dir, local_dir)
13
- ```
14
13
 
15
14
  The code above will look for a directory called "remote_dir" on the ftp host, and then duplicate the
16
15
  directory and its entire contents into the "local_dir".
17
16
 
18
- *** Note that if wget is an option, I recommend using that instead ***
17
+ Note that if wget is an option, I recommend using that instead
19
18
 
20
19
  """
21
20
 
@@ -81,14 +80,14 @@ def _file_name_match_patern(pattern, name):
81
80
 
82
81
  def _mirror_ftp_dir(ftp_handle, name, overwrite, guess_by_extension, pattern):
83
82
  """ replicates a directory on an ftp server recursively """
84
-
83
+
85
84
  ftp_handle.cwd(name)
86
85
  files=[]
87
86
  ftp_handle.dir(files.append)
88
87
  files = [curf.split()[8] for curf in files]
89
88
  for item in files:
90
89
  if _is_ftp_dir(ftp_handle, item, guess_by_extension):
91
-
90
+
92
91
  original_directory = os.getcwd() # remember working directory before function is executed
93
92
  os.makedirs(item, exist_ok=True)
94
93
  os.chdir(item) # change working directory to ftp mirror directory
@@ -106,14 +105,16 @@ def _mirror_ftp_dir(ftp_handle, name, overwrite, guess_by_extension, pattern):
106
105
  def download_ftp_tree(ftp_handle, path, destination, pattern=None, overwrite=False, guess_by_extension=True):
107
106
  """
108
107
  Downloads an entire directory tree from an ftp server to the local destination
108
+
109
109
  :param ftp_handle: an authenticated ftplib.FTP instance
110
110
  :param path: the folder on the ftp server to download
111
111
  :param destination: the local directory to store the copied folder
112
112
  :param pattern: Python regex pattern, only files that match this pattern will be downloaded.
113
113
  :param overwrite: set to True to force re-download of all files, even if they appear to exist already
114
114
  :param guess_by_extension: It takes a while to explicitly check if every item is a directory or a file.
115
- if this flag is set to True, it will assume any file ending with a three character extension ".???" is
116
- a file and not a directory. Set to False if some folders may have a "." in their names -4th position.
115
+
116
+ If this flag is set to True, it will assume any file ending with a three character extension ".???" is
117
+ a file and not a directory. Set to False if some folders may have a "." in their names -4th position.
117
118
  """
118
119
  path = path.lstrip("/")
119
120
  original_directory = os.getcwd() # remember working directory before function is executed
wolfhece/gpuview.py CHANGED
@@ -293,12 +293,12 @@ class VectorField(Element_To_Draw):
293
293
 
294
294
  """
295
295
  Logique de calcul :
296
- - on normalise les composantes vectorielles --> [0, 1]
297
- - on redistribue les normes entre [minsize , 1.] --> minsize==1 => toutes les flèches sont de taille identique
298
- - on recalcule les composantes vectorielles sur base de cette nouvelle norme
299
- - lors du dessin, on multiplie le facteur de mise à l'échelle par (self.zoom_factor * self.zoom_2)
300
- - le premier facteur tient compte de la mise à l'échelle globale du champ vectoriel sur base d'une combinaison de blocs --> Wolfresults_2D
301
- - le second facteur est purement graphique et sert à augmenter/réduire la taille tout en gardent la proportionnalité
296
+ - on normalise les composantes vectorielles --> [0, 1]
297
+ - on redistribue les normes entre [minsize , 1.] --> minsize==1 => toutes les flèches sont de taille identique
298
+ - on recalcule les composantes vectorielles sur base de cette nouvelle norme
299
+ - lors du dessin, on multiplie le facteur de mise à l'échelle par (self.zoom_factor * self.zoom_2)
300
+ - le premier facteur tient compte de la mise à l'échelle globale du champ vectoriel sur base d'une combinaison de blocs --> Wolfresults_2D
301
+ - le second facteur est purement graphique et sert à augmenter/réduire la taille tout en gardent la proportionnalité
302
302
  """
303
303
 
304
304
  self._set_data(x_extent, y_extent)
@@ -550,13 +550,14 @@ class VectorField(Element_To_Draw):
550
550
  def update_geometry(self, model_bounds: Rectangle, grid_bounds: Rectangle,
551
551
  nb_arrows_x: int, nb_arrows_y: int,
552
552
  arrow_scale_x: float, arrow_scale_y: float, aspect_ratio: float):
553
- """ Model bounds: the coordinates of the full model we draw (world coord)
554
- Grid bounds : the coordinates over which the grid will be computed (world coord);
555
- nb_arrows: number of vector to plot in x/y dimension
556
- expected to be a subset of model bounds.
557
- arrow_scale : scale factor for arrows (expected to be used to maintain
558
- the arrow size constant on screen)
559
- aspect_ration: to adapt to screen's aspect ratio.
553
+ """
554
+ Model bounds: the coordinates of the full model we draw (world coord)
555
+ Grid bounds : the coordinates over which the grid will be computed (world coord);
556
+ nb_arrows: number of vector to plot in x/y dimension
557
+ expected to be a subset of model bounds.
558
+ arrow_scale : scale factor for arrows (expected to be used to maintain
559
+ the arrow size constant on screen)
560
+ aspect_ration: to adapt to screen's aspect ratio.
560
561
  """
561
562
 
562
563
  self._model_bounds = model_bounds
@@ -1384,8 +1384,8 @@ class Catchment:
1384
1384
  Structure du dictionnaire
1385
1385
  self.hyetoDict:
1386
1386
  - Ordered To Nb: self.hyetoDict['Ordered To Nb'][nb] = iD
1387
- , iD = hyeto nb of the file to read in the folder "Whole_basin". E.g.: the file "[iD]evap.hyeto"
1388
- , nb = hyeto number sorted from 1 to nbHyeto. E.g.: if iD=['2', '5', '7'] => self.hyetoDict['Ordered To Nb'][2] = '5'
1387
+ - iD = hyeto nb of the file to read in the folder "Whole_basin". E.g.: the file "[iD]evap.hyeto"
1388
+ - nb = hyeto number sorted from 1 to nbHyeto. E.g.: if iD=['2', '5', '7'] => self.hyetoDict['Ordered To Nb'][2] = '5'
1389
1389
  - Hyetos : self.hyetoDict['Hyetos'][nb]
1390
1390
  - time: time array read in the .hyeto file
1391
1391
  - rain: rain array read in the .hyeto file
@@ -303,8 +303,8 @@ class RiverSystem:
303
303
  Incrément d'index depuis l'amont jusque l'exutoire final
304
304
  Parcours des mailles rivières depuis tous les amonts et Incrémentation d'une unité
305
305
  Résultat :
306
- - tous les biefs en amont sont à 1
307
- - Les autres biefs contiennent le nombre de biefs en amont
306
+ - tous les biefs en amont sont à 1
307
+ - Les autres biefs contiennent le nombre de biefs en amont
308
308
 
309
309
  Indice de Strahler
310
310
  """
@@ -1018,17 +1018,19 @@ class SubBasin:
1018
1018
 
1019
1019
 
1020
1020
  def compute_hydro(self):
1021
- """This procedure computes the total hydrograph and raw hydrograph of subbasin
1022
-
1023
- The total hydrograph $q_{tot} is obtained with the formula:
1024
- \f[
1025
- q_{tot} = \sum q_{\text{inlets}} + q_{\text{me}}$
1026
- \f]
1027
- , with $q_{\text{me}}$ the hydrograph of the subbasin alone.
1028
-
1029
- Internal variable changed: outFlowRaw, outFlow, inletsRaw
1030
- CAUTION: - Discussion about the ceil or the floor for the timeDelay indice!!!
1031
- - UPDATE 2023.1 now the outFlow are not delayed anymore !!!! -> IMPORTANT UPDATE
1021
+ """
1022
+ This procedure computes the total hydrograph and raw hydrograph of subbasin
1023
+
1024
+ The total hydrograph $q_{tot} is obtained with the formula:
1025
+ \f[
1026
+ q_{tot} = \sum q_{\text{inlets}} + q_{\text{me}}$
1027
+ \f]
1028
+ , with $q_{\text{me}}$ the hydrograph of the subbasin alone.
1029
+
1030
+ Internal variable changed: outFlowRaw, outFlow, inletsRaw
1031
+ CAUTION:
1032
+ - Discussion about the ceil or the floor for the timeDelay indice!!!
1033
+ - UPDATE 2023.1 now the outFlow are not delayed anymore !!!! -> IMPORTANT UPDATE
1032
1034
 
1033
1035
  """
1034
1036
  if(len(self._outFlow)==0):
@@ -14,15 +14,15 @@ import logging
14
14
  #Test de la présence de la fonction de traduction i18n "gettext" et définition le cas échéant pour ne pas créer d'erreur d'exécution
15
15
  import os
16
16
  import gettext
17
- if os.path.exists(os.path.dirname(__file__)+'\\..\\locales'):
18
- t = gettext.translation('base', localedir=os.path.dirname(__file__)+'\\..\\locales', languages=['fr'])
19
- t.install()
20
- else:
21
- try:
22
- t = gettext.translation('base', localedir='wolfhece\\locales', languages=['fr'])
23
- t.install()
24
- except:
25
- pass
17
+ # if os.path.exists(os.path.dirname(__file__)+'\\..\\locales'):
18
+ # t = gettext.translation('base', localedir=os.path.dirname(__file__)+'\\..\\locales', languages=['fr'])
19
+ # t.install()
20
+ # else:
21
+ # try:
22
+ # t = gettext.translation('base', localedir='wolfhece\\locales', languages=['fr'])
23
+ # t.install()
24
+ # except:
25
+ # pass
26
26
 
27
27
  _=gettext.gettext
28
28
 
wolfhece/irm_qdf.py CHANGED
@@ -162,7 +162,8 @@ class MontanaIRM():
162
162
  return fig,ax
163
163
 
164
164
  class Qdf_IRM():
165
- """Gestion des relations QDF calculées par l'IRM
165
+ """
166
+ Gestion des relations QDF calculées par l'IRM
166
167
 
167
168
  Exemple d'utilisation :
168
169
 
@@ -178,11 +179,11 @@ class Qdf_IRM():
178
179
  myqdf = qdf.Qdf_IRM(name='Jalhay')
179
180
 
180
181
  Les données sont ensuite disponibles dans les propriétés, qui sont des "dataframes" pandas (https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) :
181
- - qdf : les relation Quantité/durée/fréquence
182
- - standarddev : l'écart-type de l'erreur
183
- - confintlow : la valeur inférieure de l'intervalle de confiance (-2*stddev)
184
- - confintup : la valeur supérieure de l'intervalle de confiance (+2*stddev)
185
- - montanacoeff : les coeffciients de Montana
182
+ - qdf : les relation Quantité/durée/fréquence
183
+ - standarddev : l'écart-type de l'erreur
184
+ - confintlow : la valeur inférieure de l'intervalle de confiance (-2*stddev)
185
+ - confintup : la valeur supérieure de l'intervalle de confiance (+2*stddev)
186
+ - montanacoeff : les coeffciients de Montana
186
187
 
187
188
  Il est par exemple possible d'accéder aux coefficients de Montana via l'une de ces lignes ou une combinaison :
188
189
 
@@ -285,8 +286,9 @@ class Qdf_IRM():
285
286
  def plot_idf(self,T=None,which='All',color=[27./255.,136./255.,245./255.]):
286
287
  """
287
288
  Plot IDF relations on a new figure
288
- T : the return period (based on RT constants)
289
- which : information to plot
289
+
290
+ :param T : the return period (based on RT constants)
291
+ :param which : information to plot
290
292
  - 'Montana'
291
293
  - 'QDFTable'
292
294
  - 'All'
@@ -325,8 +327,8 @@ class Qdf_IRM():
325
327
  def plot_qdf(self,T=None,which='All',color=[27./255.,136./255.,245./255.]):
326
328
  """
327
329
  Plot QDF relations on a new figure
328
- T : the return period (based on RT constants)
329
- which : information to plot
330
+ :param T : the return period (based on RT constants)
331
+ :param which : information to plot
330
332
  - 'Montana'
331
333
  - 'QDFTable'
332
334
  - 'All'