wolfhece 2.1.6__py3-none-any.whl → 2.1.7__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/apps/version.py CHANGED
@@ -5,7 +5,7 @@ class WolfVersion():
5
5
 
6
6
  self.major = 2
7
7
  self.minor = 1
8
- self.patch = 6
8
+ self.patch = 7
9
9
 
10
10
  def __str__(self):
11
11
 
wolfhece/multiprojects.py CHANGED
@@ -175,6 +175,7 @@ class Wolf2D_Project(Project):
175
175
  """
176
176
  Lie les palettes d'un fichier projet et leur liaison potentielle avec les matrices
177
177
  """
178
+
178
179
  pals = self.get_group('palette')
179
180
  if pals is None:
180
181
  return
@@ -207,6 +208,7 @@ class Wolf2D_Project(Project):
207
208
  """
208
209
  Change le mode de vue dans une vue possible de "views_2D"
209
210
  """
211
+
210
212
  if which in views_2D:
211
213
  with ThreadPoolExecutor() as executor:
212
214
  for cursim in self.mysims.values():
@@ -221,10 +223,11 @@ class Wolf2D_Project(Project):
221
223
  - chaque entrée est un dictionnaire dont la clé 'values' contient une liste pour chaque matrice du projet
222
224
  - chaque élément de liste est un tuple contenant toutes les valeurs utiles
223
225
  """
226
+
224
227
  self.poly = zonepoly
225
228
  self.poly_values = zonepoly.get_all_values_linked_polygon(self.get_simulations())
226
229
 
227
- def get_values(self,which_type):
230
+ def get_values(self,which_type:Union[views_2D, Literal['i','j','block']]=None):
228
231
 
229
232
  if self.poly_values is None:
230
233
  raise Warning(_('Firstly call get_values_inside with a zone as argument -- Retry !'))
@@ -341,7 +344,10 @@ class MultiProjects():
341
344
  def get_simulations_list(self, which_project=None) -> list:
342
345
  """
343
346
  Return a python list of simulations
347
+
348
+ :param which_project: str or list of str -- key(s) of the project(s) to get simulations from
344
349
  """
350
+
345
351
  if which_project is None:
346
352
  allsims=[]
347
353
  for curproj in self.projects.values():
@@ -349,6 +355,15 @@ class MultiProjects():
349
355
  allsims+=curproj.get_simulations()
350
356
  return allsims
351
357
 
358
+ elif isinstance(which_project, list):
359
+ allsims=[]
360
+ for curkey in which_project:
361
+ if curkey in self.projects.keys():
362
+ curproj = self.projects[curkey]
363
+ if isinstance(curproj, Wolf2D_Project):
364
+ allsims+=curproj.get_simulations()
365
+ return allsims
366
+
352
367
  elif which_project in self.projects.keys():
353
368
  curproj = self.projects[which_project]
354
369
  if isinstance(curproj, Wolf2D_Project):
@@ -356,10 +371,13 @@ class MultiProjects():
356
371
 
357
372
  return None
358
373
 
359
- def get_simulations_dict(self, which_project=None) -> dict:
374
+ def get_simulations_dict(self, which_project:Union[str, list[str]]=None) -> dict:
360
375
  """
361
376
  Return a python dict of simulations
377
+
378
+ :param which_project: str or list of str -- key(s) of the project(s) to get simulations from
362
379
  """
380
+
363
381
  if which_project is None:
364
382
  allsims={}
365
383
  for curkey, curproj in self.projects.items():
@@ -367,6 +385,15 @@ class MultiProjects():
367
385
  allsims[curkey] = curproj.get_simulations()
368
386
  return allsims
369
387
 
388
+ elif isinstance(which_project, list):
389
+ allsims={}
390
+ for curkey in which_project:
391
+ if curkey in self.projects.keys():
392
+ curproj = self.projects[curkey]
393
+ if isinstance(curproj, Wolf2D_Project):
394
+ allsims[curkey] = curproj.get_simulations()
395
+ return allsims
396
+
370
397
  elif which_project in self.projects.keys():
371
398
  curproj = self.projects[which_project]
372
399
  if isinstance(curproj, Wolf2D_Project):
@@ -374,7 +401,9 @@ class MultiProjects():
374
401
 
375
402
  return None
376
403
 
377
- def set_currentview(self, which):
404
+ def set_currentview(self, which:views_2D):
405
+ """ Change le mode de vue dans une vue possible de 'views_2D' """
406
+
378
407
  for curproj in self.projects.values():
379
408
  if isinstance(curproj, Wolf2D_Project):
380
409
  curproj.set_currentview(which)
@@ -235,6 +235,8 @@ class Polygons_Analyze(Zones):
235
235
 
236
236
  self.myname = splitext(basename(myfile))[0]
237
237
 
238
+ self.linked = {}
239
+
238
240
  self.riverbed = self.get_zone(0).myvectors[1]
239
241
  self.riverbed.prepare_shapely()
240
242
 
@@ -247,23 +249,23 @@ class Polygons_Analyze(Zones):
247
249
  for vec in self.polygons_zone.myvectors:
248
250
  vec.myprop.used=False # cache les polygones pour ne pas surcharger l'affichage éventuel
249
251
 
250
- def colorize(self):
251
- """Colorisation des polygones pour l'interface graphique"""
252
- self.centralpart.myprop.color = getIfromRGB((0,255,0))
253
- self.upstream.myprop.color = getIfromRGB((255,0,0))
254
- self.downstream.myprop.color = getIfromRGB((0,0,255))
252
+ # def colorize(self):
253
+ # """Colorisation des polygones pour l'interface graphique"""
254
+ # self.centralpart.myprop.color = getIfromRGB((0,255,0))
255
+ # self.upstream.myprop.color = getIfromRGB((255,0,0))
256
+ # self.downstream.myprop.color = getIfromRGB((0,0,255))
255
257
 
256
- def highlighting(self, rgb=(255,0,0), linewidth=3):
257
- """
258
- Mise en évidence
259
- """
260
- self.centralpart.highlighting(rgb,linewidth)
258
+ # def highlighting(self, rgb=(255,0,0), linewidth=3):
259
+ # """
260
+ # Mise en évidence
261
+ # """
262
+ # self.centralpart.highlighting(rgb,linewidth)
261
263
 
262
- def withdrawal(self):
263
- """
264
- Mise en retrait
265
- """
266
- self.centralpart.withdrawal()
264
+ # def withdrawal(self):
265
+ # """
266
+ # Mise en retrait
267
+ # """
268
+ # self.centralpart.withdrawal()
267
269
 
268
270
  def compute_distance(self, poly:LineString):
269
271
  """
@@ -274,7 +276,7 @@ class Polygons_Analyze(Zones):
274
276
  centery = np.sum(np.asarray([cur.y for cur in curvert.myvertices[:4]]))/4.
275
277
  self.polygons_curvi[curvert.myname] = poly.project(Point([centerx,centery]))
276
278
 
277
- def find_values_inside_parts(self, linked_arrays):
279
+ def find_values_inside_parts(self, linked_arrays, force_reset = False):
278
280
  """
279
281
  Récupère les valeurs à l'intérieur :
280
282
  - des parties du pont (amont, centrale, aval)
@@ -290,8 +292,9 @@ class Polygons_Analyze(Zones):
290
292
  ***
291
293
 
292
294
  """
295
+ if force_reset:
296
+ self.linked={}
293
297
 
294
- self.linked={}
295
298
  for curkey, curgroup in linked_arrays.items():
296
299
  self.linked[curkey] = [(curlink.idx, type(curlink)) for curlink in curgroup]
297
300
 
@@ -407,18 +410,23 @@ class Polygons_Analyze(Zones):
407
410
  curdict = vals_ret[curkeypoly]={}
408
411
  for curkey, curvals in curpoly.items():
409
412
  if curvals is not None:
410
- if operator == operators.MEDIAN:
411
- curdict[curkey] = np.median(curvals)
412
- elif operator == operators.MIN:
413
- curdict[curkey] = np.min(curvals)
414
- elif operator == operators.MAX:
415
- curdict[curkey] = np.max(curvals)
416
- elif operator == operators.PERCENTILE95:
417
- curdict[curkey] = np.percentile(curvals,95)
418
- elif operator == operators.PERCENTILE5:
419
- curdict[curkey] = np.percentile(curvals,5)
420
- elif operator == operators.ALL:
421
- curdict[curkey] = (np.median(curvals), np.min(curvals), np.max(curvals), np.percentile(curvals,95), np.percentile(curvals,5))
413
+ try:
414
+ if operator == operators.MEDIAN:
415
+ curdict[curkey] = np.median(curvals)
416
+ elif operator == operators.MIN:
417
+ curdict[curkey] = np.min(curvals)
418
+ elif operator == operators.MAX:
419
+ curdict[curkey] = np.max(curvals)
420
+ elif operator == operators.PERCENTILE95:
421
+ curdict[curkey] = np.percentile(curvals,95)
422
+ elif operator == operators.PERCENTILE5:
423
+ curdict[curkey] = np.percentile(curvals,5)
424
+ elif operator == operators.ALL:
425
+ curdict[curkey] = (np.median(curvals), np.min(curvals), np.max(curvals), np.percentile(curvals,95), np.percentile(curvals,5))
426
+ except:
427
+ logging.error(_('Error in extract_info for key {0}').format(curkey))
428
+ curdict[curkey] = -1.
429
+
422
430
  return vals_ret
423
431
 
424
432
  vals = self.get_river_values(which_value, which_group)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wolfhece
3
- Version: 2.1.6
3
+ Version: 2.1.7
4
4
  Author-email: Pierre Archambeau <pierre.archambeau@uliege.be>
5
5
  License: AGPL-v3 License
6
6
  Project-URL: Homepage, https://uee.uliege.be/hece
@@ -34,13 +34,13 @@ wolfhece/import_ascfiles.py,sha256=jg4urcLdSgFS1Knvh7AVGJqM44qc_uYDNrR568tMh-A,4
34
34
  wolfhece/ins.py,sha256=0aU1mo4tYbw64Gwzrqbh-NCTH1tukmk0mpPHjRPHZXU,12661
35
35
  wolfhece/irm_qdf.py,sha256=749SlAXiN1oXp5tfBJoPNJWxydQlY55K0qvIM5YexlM,15436
36
36
  wolfhece/ismember.py,sha256=fkLvaH9fhx-p0QrlEzqa6ySO-ios3ysjAgXVXzLgSpY,2482
37
- wolfhece/multiprojects.py,sha256=AMwEQZqo1Twh6tSPP-4L29-Fa8cI9d6dWce7l88awws,14675
37
+ wolfhece/multiprojects.py,sha256=DdObaugeNrd2I7rtWd6M5W0nVXN8KRVmcXLjMg9oqYs,15795
38
38
  wolfhece/picc.py,sha256=KKPNk1BEe7QBzo2icIsdsxUopJ1LXYTomfdfeG2gCeA,7419
39
39
  wolfhece/pyGui1D.py,sha256=pzLWXQ_w3Y_yI846w1GklFO9h5lWZOqiUzg1BUPkuRI,121616
40
40
  wolfhece/pybridges.py,sha256=HJ1BL1HC7UrgpQ-3jKXkqPFmc-TzToL28Uex2hjHk6c,57166
41
41
  wolfhece/pydike.py,sha256=G4jfSZaAHHr4VWEJqnXSvEswXvlOz1yhbhQ6uu3AqyM,1943
42
42
  wolfhece/pylogging.py,sha256=i9Zugx3t9dPc7nBwcP20L_R4_k_WawpAQsvbZU8l9Hg,4230
43
- wolfhece/pypolygons_scen.py,sha256=lrUty990vT1iiILiIuTY8pNStiaZOi2dXWJuL9C-4Ps,26211
43
+ wolfhece/pypolygons_scen.py,sha256=BAo1tg8rJGkmKlEyTbb8gnofk-aPbrKunE2-0YWNaHQ,26581
44
44
  wolfhece/pyshields.py,sha256=YS6VVjjzoA-ZR6YRccqjMcW3McNqNLoQODC6TNNkmPw,22983
45
45
  wolfhece/pyviews.py,sha256=hYdyrEvWF48dGBDOLIwmC28C0L8I28U4ohXk9nltF94,9666
46
46
  wolfhece/pywalous.py,sha256=GRS5TKoVT0J-3PBqMdlyFRHrqkdYC-uHgDPcMjoDEZw,18674
@@ -66,7 +66,7 @@ wolfhece/apps/check_install.py,sha256=jrKR-njqnpIh6ZJqvP6KbDUPVCfwTNQj4glQhcyzs9
66
66
  wolfhece/apps/curvedigitizer.py,sha256=avWERHuVxPnJBOD_ibczwW_XG4vAenqWS8W1zjhBox8,4898
67
67
  wolfhece/apps/isocurrent.py,sha256=4XnNWPa8mYUK7V4zdDRFrHFIXNG2AN2og3TqWKKcqjY,3811
68
68
  wolfhece/apps/splashscreen.py,sha256=LkEVMK0eCc84NeCWD3CGja7fuQ_k1PrZdyqD3GQk_8c,2118
69
- wolfhece/apps/version.py,sha256=e4viWx1A5GTOG7x_ee5ipUIoVs03YPj1mmqIboCFecM,387
69
+ wolfhece/apps/version.py,sha256=QnnuNPQqjbCKaqce2cE43Ky9-bjQgDRUR3St4eC7HII,387
70
70
  wolfhece/apps/wolf.py,sha256=gqfm-ZaUJqNsfCzmdtemSeqLw-GVdSVix-evg5WArJI,293
71
71
  wolfhece/apps/wolf2D.py,sha256=gWD9ee2-1pw_nUxjgRaJMuSe4kUT-RWhOeoTt_Lh1mM,267
72
72
  wolfhece/apps/wolf_logo.bmp,sha256=ruJ4MA51CpGO_AYUp_dB4SWKHelvhOvd7Q8NrVOjDJk,3126
@@ -264,8 +264,8 @@ wolfhece/sounds/sonsw2.wav,sha256=pFLVt6By0_EPQNt_3KfEZ9a1uSuYTgQSX1I_Zurv9Rc,11
264
264
  wolfhece/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
265
265
  wolfhece/ui/wolf_multiselection_collapsiblepane.py,sha256=yGbU_JsF56jsmms0gh7mxa7tbNQ_SxqhpAZxhm-mTy4,14860
266
266
  wolfhece/ui/wolf_times_selection_comparison_models.py,sha256=wCxGRnE3kzEkWlWA6-3X8ADOFux_B0a5QWJ2GnXTgJw,4709
267
- wolfhece-2.1.6.dist-info/METADATA,sha256=cugMr7AdpxcXB9lUui3lqbla85asvy4lo-Q8-0per-Y,2281
268
- wolfhece-2.1.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
269
- wolfhece-2.1.6.dist-info/entry_points.txt,sha256=AIu1KMswrdsqNq_2jPtrRIU4tLjuTnj2dCY-pxIlshw,276
270
- wolfhece-2.1.6.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
271
- wolfhece-2.1.6.dist-info/RECORD,,
267
+ wolfhece-2.1.7.dist-info/METADATA,sha256=tv3E_t--2aA71zEbF4xRjwE3klu3AAVpHUIzRBLFVH8,2281
268
+ wolfhece-2.1.7.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
269
+ wolfhece-2.1.7.dist-info/entry_points.txt,sha256=AIu1KMswrdsqNq_2jPtrRIU4tLjuTnj2dCY-pxIlshw,276
270
+ wolfhece-2.1.7.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
271
+ wolfhece-2.1.7.dist-info/RECORD,,