wolfhece 2.1.93__py3-none-any.whl → 2.1.94__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/PyDraw.py CHANGED
@@ -899,8 +899,8 @@ class WolfMapViewer(wx.Frame):
899
899
 
900
900
  # SIMULATION 2D
901
901
 
902
- sim2d = self.filemenu.Append(wx.ID_ANY, _('Create/Open multiblock model'), _('Create or open a multiblock model in a new viewer'))
903
- check2D = self.filemenu.Append(wx.ID_ANY, _('Check headers'), _('Check the header .txt files from an existing 2D simulation'))
902
+ sim2d = self.filemenu.Append(wx.ID_ANY, _('Create/Open multiblock model'), _('Create or open a multiblock model in the viewer --> CPU/Fortran Wolf2D model'))
903
+ check2D = self.filemenu.Append(wx.ID_ANY, _('Check headers'), _('Check the header .txt files from an existing 2D CPU simulation'))
904
904
 
905
905
  self.filemenu.AppendSeparator()
906
906
 
@@ -11,6 +11,7 @@ copying or distribution of this file, via any medium, is strictly prohibited.
11
11
  from os import path
12
12
  from typing import Union
13
13
  import numpy as np
14
+ import triangle.tri
14
15
  import wx
15
16
  import wx._dataview
16
17
  from wx.dataview import *
@@ -34,6 +35,7 @@ import geopandas as gpd
34
35
  import io
35
36
  from typing import Union, Literal
36
37
  from pathlib import Path
38
+ import triangle
37
39
 
38
40
  from .wolf_texture import genericImagetexture
39
41
  from .textpillow import Font_Priority
@@ -1657,8 +1659,6 @@ class vector:
1657
1659
 
1658
1660
  if self.myprop.filled:
1659
1661
 
1660
- import triangle
1661
-
1662
1662
  ls = self.asshapely_pol()
1663
1663
 
1664
1664
  if False:
@@ -1679,14 +1679,26 @@ class vector:
1679
1679
  else:
1680
1680
  #En attendant de lier WOLF-Fortran, on utilise la triangulation contrainte de la librairie Triangle -- https://rufat.be/triangle/
1681
1681
  xx, yy = ls.exterior.xy
1682
- geom = {'vertices' : np.array([xx,yy]).T, 'segments' : np.array([[i,i+1] for i in range(len(xx)-1)]+[[len(xx)-1,0]])}
1683
- delaunay = triangle.triangulate(geom,'p')
1684
1682
 
1685
- for curtri in delaunay['triangles']:
1686
- glBegin(GL_POLYGON)
1687
- for i in range(3):
1688
- glVertex2d(delaunay['vertices'][curtri[i]][0],delaunay['vertices'][curtri[i]][1])
1689
- glEnd()
1683
+ # On translate les coordonnées pour éviter les erreurs de triangulation
1684
+ tr_x = np.array(xx).min()
1685
+ tr_y = np.array(yy).min()
1686
+
1687
+ xx = np.array(xx)-tr_x
1688
+ yy = np.array(yy)-tr_y
1689
+
1690
+ geom = {'vertices' : [[x,y] for x,y in zip(xx[:-1],yy[:-1])], 'segments' : [[i,i+1] for i in range(len(xx)-2)]+[[len(xx)-2,0]]}
1691
+
1692
+ try:
1693
+ delaunay = triangle.triangulate(geom, 'p')
1694
+ for curtri in delaunay['triangles']:
1695
+ glBegin(GL_POLYGON)
1696
+ for i in range(3):
1697
+ # on retraduit les coordonnées pour revenir dans le monde réel
1698
+ glVertex2d(delaunay['vertices'][curtri[i]][0] + tr_x, delaunay['vertices'][curtri[i]][1] + tr_y)
1699
+ glEnd()
1700
+ except:
1701
+ pass
1690
1702
 
1691
1703
  else:
1692
1704
  all_polys = self.get_subpolygons()
@@ -4345,7 +4357,8 @@ class Zones(wx.Frame, Element_To_Draw):
4345
4357
  need_for_wx: bool = False,
4346
4358
  bbox:Polygon = None,
4347
4359
  find_minmax:bool = True,
4348
- shared:bool = False) -> None:
4360
+ shared:bool = False,
4361
+ colors:dict = None) -> None:
4349
4362
  """
4350
4363
  Objet de gestion et d'affichage d'informations vectorielles
4351
4364
 
@@ -4482,6 +4495,9 @@ class Zones(wx.Frame, Element_To_Draw):
4482
4495
  if find_minmax:
4483
4496
  self.find_minmax(True)
4484
4497
 
4498
+ if colors is not None:
4499
+ self.colorize_data(colors, filled=True)
4500
+
4485
4501
  if plotted and self.has_OGLContext and not self.shared:
4486
4502
  self.prep_listogl()
4487
4503
 
@@ -4686,7 +4702,7 @@ class Zones(wx.Frame, Element_To_Draw):
4686
4702
 
4687
4703
  assert isinstance(self.mapviewer, WolfMapViewer), _('Bad mapviewer -- verify your code or bad parent')
4688
4704
 
4689
- def colorize_data(self, colors:dict[str:list[int]]) -> None:
4705
+ def colorize_data(self, colors:dict[str:list[int]], filled:bool = False) -> None:
4690
4706
  """
4691
4707
  Colorize zones based on a dictionary of colors
4692
4708
 
@@ -4706,7 +4722,7 @@ class Zones(wx.Frame, Element_To_Draw):
4706
4722
  curvect.myprop.color = curcolor
4707
4723
  curvect.myprop.alpha = 180
4708
4724
  curvect.myprop.transparent = True
4709
- curvect.myprop.filled = True
4725
+ curvect.myprop.filled = filled
4710
4726
 
4711
4727
  def set_width(self, width:int) -> None:
4712
4728
  """ Change with of all vectors in all zones """
@@ -4881,8 +4897,12 @@ class Zones(wx.Frame, Element_To_Draw):
4881
4897
  """
4882
4898
  Préparation des listes OpenGL pour augmenter la vitesse d'affichage
4883
4899
  """
4884
- for curzone in self.myzones:
4885
- curzone.prep_listogl()
4900
+
4901
+ try:
4902
+ for curzone in self.myzones:
4903
+ curzone.prep_listogl()
4904
+ except:
4905
+ logging.warning(_('Error while preparing OpenGL lists'))
4886
4906
 
4887
4907
  def check_plot(self):
4888
4908
  """
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 = 93
8
+ self.patch = 94
9
9
 
10
10
  def __str__(self):
11
11
 
wolfhece/picc.py CHANGED
@@ -62,8 +62,7 @@ class Picc_data(Element_To_Draw):
62
62
  datafile = data_dir / self._filename_vector
63
63
 
64
64
  if datafile.exists():
65
- self.zones = Zones(data_dir / self._filename_vector, bbox = bbox, mapviewer=self.mapviewer)
66
- self.zones.prep_listogl()
65
+ self.zones = Zones(data_dir / self._filename_vector, bbox = bbox, mapviewer=self.mapviewer, colors= self._colors)
67
66
  else:
68
67
  logging.error(_('File not found : {}').format(datafile))
69
68
 
@@ -89,8 +88,7 @@ class Picc_data(Element_To_Draw):
89
88
  self.data_dir = Path(pathname).parent
90
89
  data_dir = self.data_dir
91
90
  self._filename_vector = Path(pathname).name
92
- self.zones = Zones(pathname, bbox = bbox, mapviewer=self.mapviewer, parent=self)
93
- self.zones.prep_listogl()
91
+ self.zones = Zones(pathname, bbox = bbox, mapviewer=self.mapviewer, parent=self, colors=self._colors)
94
92
  except:
95
93
  logging.error(_('File not found : {}').format(pathname))
96
94
 
@@ -105,8 +103,7 @@ class Picc_data(Element_To_Draw):
105
103
  self.data_dir = Path(pathname).parent
106
104
  data_dir = self.data_dir
107
105
  self._filename_vector = ''
108
- self.zones = Zones(pathname, bbox = bbox, mapviewer=self.mapviewer, parent=self)
109
- self.zones.prep_listogl()
106
+ self.zones = Zones(pathname, bbox = bbox, mapviewer=self.mapviewer, parent=self, colors= self._colors)
110
107
 
111
108
  except:
112
109
  logging.error(_('Dirrectory not a gdb : {}').format(pathname))
@@ -121,11 +118,6 @@ class Picc_data(Element_To_Draw):
121
118
  else:
122
119
  logging.error(_('Point file not found : {}').format(pointfile))
123
120
 
124
- if self.zones is not None:
125
- if colorize:
126
- self.zones.colorize_data(self._colors)
127
- self.zones.prep_listogl()
128
-
129
121
 
130
122
  def plot(self, sx=None, sy=None, xmin=None, ymin=None, xmax=None, ymax=None, size=None):
131
123
  """ Plot data in OpenGL context
@@ -191,7 +183,7 @@ class Picc_data(Element_To_Draw):
191
183
 
192
184
  if self.mapviewer is not None:
193
185
  self.mapviewer.Active_vector(vector_to_activate)
194
-
186
+
195
187
  else:
196
188
  logging.warning(_('No mapviewer to activate vector !'))
197
189
 
@@ -199,13 +191,13 @@ class Picc_data(Element_To_Draw):
199
191
  """ Activate a zone """
200
192
 
201
193
  self.active_zone = zone_to_activate
202
-
194
+
203
195
  if len(zone_to_activate.myvectors) > 0:
204
196
  self.active_vector = zone_to_activate.myvectors[0]
205
197
 
206
198
  if self.mapviewer is not None:
207
199
  self.mapviewer.Active_vector(self.active_vector)
208
-
200
+
209
201
  else:
210
202
  logging.warning(_('No mapviewer to activate zone !'))
211
203
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wolfhece
3
- Version: 2.1.93
3
+ Version: 2.1.94
4
4
  Author-email: Pierre Archambeau <pierre.archambeau@uliege.be>
5
5
  License: Copyright (c) 2024 University of Liege. All rights reserved.
6
6
  Project-URL: Homepage, https://uee.uliege.be/hece
@@ -13,6 +13,7 @@ Classifier: Topic :: Scientific/Engineering :: Physics
13
13
  Requires-Python: <3.11,>=3.10
14
14
  Description-Content-Type: text/markdown
15
15
  Requires-Dist: wxpython
16
+ Requires-Dist: fiona
16
17
  Requires-Dist: msvc-runtime
17
18
  Requires-Dist: colorlog==6.7.*
18
19
  Requires-Dist: intel-fortran-rt
@@ -7,7 +7,7 @@ wolfhece/ManageParams.py,sha256=EeuUI5Vvh9ixCvYf8YShMC1s1Yacc7OxOCN7q81gqiQ,517
7
7
  wolfhece/Model1D.py,sha256=SI4oNF_J3MdjiWZoizS8kuRXLMVyymX9dYfYJNVCQVI,476989
8
8
  wolfhece/PyConfig.py,sha256=UNtl5UzZ399JqjJT67-4DWaIkv76sc1FiEsSDJpXlL0,10458
9
9
  wolfhece/PyCrosssections.py,sha256=FnmM9DWY_SAF2EDH9Gu2PojXNtSTRF4-aYQuAAJXBh4,112771
10
- wolfhece/PyDraw.py,sha256=KkqxUazcXhenwBVCE69EHd_lt0g9fiX6R4p3IBS2pnI,442172
10
+ wolfhece/PyDraw.py,sha256=CiXP4_VfENyacuzwp-AzIPSkZKtlW6xHN6I8jYJBqY0,442203
11
11
  wolfhece/PyGui.py,sha256=HY0beOMSp1JEyq8-vfVynzVrmKxvaO_sJSMwlNqCNrg,105289
12
12
  wolfhece/PyGuiHydrology.py,sha256=f60E8K9eGTnRq5RDF6yvt-ahf2AYegwQ9t25zZ2Mk1A,14946
13
13
  wolfhece/PyHydrographs.py,sha256=jwtSNMMACwarxrtN1UeQYth99UNrhwPx1IGgUwcooHA,3774
@@ -16,7 +16,7 @@ wolfhece/PyParams.py,sha256=6fREK5cUCGw84SDyPvuSzidnX-9BXOX3fve5XBG1K_I,98114
16
16
  wolfhece/PyPictures.py,sha256=m1kY0saW6Y9Q0bDCo47lW6XxDkBrbQG-Fd8uVn8G5ic,2514
17
17
  wolfhece/PyTranslate.py,sha256=4appkmNeHHZLFmUtaA_k5_5QL-5ymxnbVN4R2OblmtE,622
18
18
  wolfhece/PyVertex.py,sha256=aj1Xp6n0pMb_q6AMADHnQ9pgjjRU4EQm0m4Tmc1uoEM,41912
19
- wolfhece/PyVertexvectors.py,sha256=BLIs97SN45nFQn2T1brzN9c4FIzNNzB0WaM1kUd-E1g,251815
19
+ wolfhece/PyVertexvectors.py,sha256=JV7a4kN4hbwR4fNHATl3X3iuZ7Vh2vyThxVWKtNWSrQ,252593
20
20
  wolfhece/PyWMS.py,sha256=fyyzm2HFwq8aRwVYHKiBatcZOeKnFi6DWhv4nfscySQ,4602
21
21
  wolfhece/RatingCurve.py,sha256=bUjIrQjvIjkD4V-z8bZmA6pe1ILtYNM0-3fT6YUY1RU,22498
22
22
  wolfhece/RatingCurveData.py,sha256=5UvnIm89BwqjnEbLCcY3CA8WoFd_xHJbooNy62fX5iY,57660
@@ -36,7 +36,7 @@ wolfhece/ins.py,sha256=uUeLMS1n3GPnfJhxl0Z2l-UXpmPUgthuwct282OOEzk,36184
36
36
  wolfhece/irm_qdf.py,sha256=KyrIk0Gu50Q702EWxRpwKTWI2KGjtHA1l8CL-Y469O0,26394
37
37
  wolfhece/ismember.py,sha256=fkLvaH9fhx-p0QrlEzqa6ySO-ios3ysjAgXVXzLgSpY,2482
38
38
  wolfhece/multiprojects.py,sha256=Sd6Bl6YP33jlR79A6rvSLu23vq8sqbFYL8lWuVPkEpE,21549
39
- wolfhece/picc.py,sha256=ueujnw03BQz-nPxKGzfDzZbtruTzvnqd6Gm8lOvBYzw,8802
39
+ wolfhece/picc.py,sha256=oATEiPmj_om7TIOWucNZszIu8K18yq8yKU_GwpGJEMs,8531
40
40
  wolfhece/pyGui1D.py,sha256=9g7OS3YiKsqy--6y0cBD7x2gaqTTYFXWkxImpgnTA20,121937
41
41
  wolfhece/pybridges.py,sha256=EU_r6yRYDf5zKmwwXEBsGYvTKFbSfE3iTxPwusKR-1I,57398
42
42
  wolfhece/pydike.py,sha256=hPBQsmSTW4QAp1wcOzb-TL3L7eet2WT1sJx2q-WNQ-Q,2241
@@ -75,7 +75,7 @@ wolfhece/apps/curvedigitizer.py,sha256=Yps4bcayzbsz0AoVc_dkSk35dEhhn_esIBy1Ziefg
75
75
  wolfhece/apps/hydrometry.py,sha256=lhhJsFeb4zGL4bNQTs0co85OQ_6ssL1Oy0OUJCzhfYE,656
76
76
  wolfhece/apps/isocurrent.py,sha256=dagmGR8ja9QQ1gwz_8fU-N052hIw-W0mWGVkzLu6C7I,4247
77
77
  wolfhece/apps/splashscreen.py,sha256=SrustmIQeXnsiD-92OzjdGhBi-S7c_j-cSvuX4T6rtg,2929
78
- wolfhece/apps/version.py,sha256=uhn_xV3CTGZbQdI3Z2ZnOh4S6W8nowYt7Tj4x2XrHlo,388
78
+ wolfhece/apps/version.py,sha256=rZi-X4W-8UB0KrenDxLV9h-lnAEpdduh_0hJNqjLsoY,388
79
79
  wolfhece/apps/wolf.py,sha256=j_CgvsL8rwixbVvVD5Z0s7m7cHZ86gmFLojKGuetMls,729
80
80
  wolfhece/apps/wolf2D.py,sha256=4z_OPQ3IgaLtjexjMKX9ppvqEYyjFLt1hcfFABy3-jU,703
81
81
  wolfhece/apps/wolf_logo.bmp,sha256=ruJ4MA51CpGO_AYUp_dB4SWKHelvhOvd7Q8NrVOjDJk,3126
@@ -285,8 +285,8 @@ wolfhece/ui/wolf_multiselection_collapsiblepane.py,sha256=8PlMYrb_8jI8h9F0_EagpM
285
285
  wolfhece/ui/wolf_times_selection_comparison_models.py,sha256=ORy7fz4dcp691qKzaOZHrRLZ0uXNhL-LIHxmpDGL6BI,5007
286
286
  wolfhece/wintab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
287
287
  wolfhece/wintab/wintab.py,sha256=8A-JNONV6ujgsgG3lM5Uw-pVgglPATwKs86oBzzljoc,7179
288
- wolfhece-2.1.93.dist-info/METADATA,sha256=Rws7W6QN1NdDV2S30eXAeX-vTVauNTaWIzCTfEzkOpk,2548
289
- wolfhece-2.1.93.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
290
- wolfhece-2.1.93.dist-info/entry_points.txt,sha256=ZZ-aSfbpdcmo-wo84lRFzBN7LaSnD1XRGSaAKVX-Gpc,522
291
- wolfhece-2.1.93.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
292
- wolfhece-2.1.93.dist-info/RECORD,,
288
+ wolfhece-2.1.94.dist-info/METADATA,sha256=7QKX23LbIgX7dd_Qxm_3o1ItJk0-1y0clPJ_xQP3wwU,2570
289
+ wolfhece-2.1.94.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
290
+ wolfhece-2.1.94.dist-info/entry_points.txt,sha256=ZZ-aSfbpdcmo-wo84lRFzBN7LaSnD1XRGSaAKVX-Gpc,522
291
+ wolfhece-2.1.94.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
292
+ wolfhece-2.1.94.dist-info/RECORD,,