wolfhece 2.2.24__py3-none-any.whl → 2.2.26__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/PyVertex.py CHANGED
@@ -36,7 +36,6 @@ from .drawing_obj import Element_To_Draw
36
36
  from .textpillow import Text_Image, Text_Infos, Font_Priority
37
37
  from .wolf_texture import Text_Image_Texture
38
38
 
39
-
40
39
  def getRGBfromI(rgbint:int):
41
40
  """ Convert integer to RGB """
42
41
 
@@ -731,6 +730,20 @@ class cloud_vertices(Element_To_Draw):
731
730
  curval = curline.split(sep)
732
731
  nbcols = len(curval)
733
732
 
733
+ if not header:
734
+ try:
735
+ x = float(curval[0])
736
+ y = float(curval[1])
737
+ z = 0.
738
+ if nbcols > 2:
739
+ z = float(curval[2])
740
+ except ValueError as e:
741
+ logging.error(_('Error converting first row to float as "header" is set to False.'))
742
+ logging.error(_('Check your input file : ')+fname)
743
+ logging.info(_('Using the first row as header.'))
744
+ header = True
745
+ headers = curhead.split(sep)
746
+
734
747
  if nbcols < 2:
735
748
  logging.warning(_('Not enough values on one line -- Retry !!'))
736
749
  return
@@ -1799,7 +1799,7 @@ class vector:
1799
1799
 
1800
1800
  myls = self.asshapely_ls()
1801
1801
 
1802
- mypar = myls.parallel_offset(distance=abs(distance),side=side,join_style=JOIN_STYLE.round)
1802
+ mypar = myls.parallel_offset(distance=abs(distance), side=side, join_style=JOIN_STYLE.round)
1803
1803
 
1804
1804
  if mypar.geom_type=='MultiLineString':
1805
1805
  return None
@@ -1810,7 +1810,7 @@ class vector:
1810
1810
  # #On souhaite garder une même orientation pour les vecteurs
1811
1811
  # mypar = substring(mypar, 1., 0., normalized=True)
1812
1812
 
1813
- newvec = vector(name='par'+str(distance), parentzone=self.parentzone)
1813
+ newvec = vector(name='par' + str(distance) +'_'+ self.myname, parentzone= self.parentzone)
1814
1814
 
1815
1815
  for x,y in mypar.coords:
1816
1816
  xy = Point(x,y)
@@ -4133,8 +4133,8 @@ class zone:
4133
4133
  if mypl is None or mypr is None:
4134
4134
  return
4135
4135
 
4136
- self.add_vector(mypl,0)
4137
- self.add_vector(mypr,2)
4136
+ self.add_vector(mypl, 0)
4137
+ self.add_vector(mypr, 2)
4138
4138
 
4139
4139
  def create_multibin(self, nb:int = None, nb2:int = 0) -> Triangulation:
4140
4140
  """
@@ -7468,6 +7468,15 @@ class Zones(wx.Frame, Element_To_Draw):
7468
7468
  if self.verify_activevec():
7469
7469
  return
7470
7470
 
7471
+ if self.active_zone.nbvectors > 1:
7472
+ dlg = wx.MessageDialog(None, _('You already have more than one vector in the active zone. This action will conserve only the active vector.\nDo you want to continue?'), _('Warning'), style=wx.YES_NO | wx.ICON_WARNING)
7473
+ ret = dlg.ShowModal()
7474
+ if ret == wx.ID_NO:
7475
+ dlg.Destroy()
7476
+ return
7477
+ logging.warning(_('You already have more than one vector in the active zone. This action will conserve only the active vector and you want it.'))
7478
+ dlg.Destroy()
7479
+
7471
7480
  self.mapviewer.start_action('dynamic parallel', _('Dynamic parallel'))
7472
7481
 
7473
7482
  firstvert=wolfvertex(0.,0.)
wolfhece/apps/version.py CHANGED
@@ -5,7 +5,7 @@ class WolfVersion():
5
5
 
6
6
  self.major = 2
7
7
  self.minor = 2
8
- self.patch = 24
8
+ self.patch = 26
9
9
 
10
10
  def __str__(self):
11
11
 
@@ -445,6 +445,8 @@ class Polygons_Analyze(Zones):
445
445
  return float(obj)
446
446
  elif isinstance(obj, np.ndarray):
447
447
  return obj.tolist()
448
+ elif isinstance(obj, tuple):
449
+ return [list(lst1) for lst1 in obj]
448
450
  elif obj == Wolfresults_2D:
449
451
  return 'CPU'
450
452
  elif obj == wolfres2DGPU:
@@ -919,7 +921,8 @@ class Polygons_Analyze(Zones):
919
921
  operator:operators=operators.MEDIAN,
920
922
  options:dict=None,
921
923
  label=True,
922
- show=False):
924
+ show=False,
925
+ which_sim:str=None):
923
926
  """ Plot the values of the river polygons
924
927
 
925
928
  :param figax: tuple (fig, ax) for the plot
@@ -929,6 +932,8 @@ class Polygons_Analyze(Zones):
929
932
  :param options: options for the plot
930
933
  :param label: show the labels or not
931
934
  :param show: show the plot or not
935
+ :param which_sim: simulation to plot (if None, all simulations are plotted)
936
+ :return: tuple (fig, ax) of the plot
932
937
  """
933
938
 
934
939
  if figax is None:
@@ -1022,9 +1027,9 @@ class Polygons_Analyze(Zones):
1022
1027
  figax=(fig,ax)
1023
1028
  self.plot_unk(figax, stored_values_unk.WATERLEVEL, which_group, operator, options={'color':'blue', 'linewidth':2}, label=True, show=False)
1024
1029
 
1025
- ax.set_ylabel(_('Water leval [mDNG]'))
1030
+ ax.set_ylabel(_('Water surface elevation [mDNG]'))
1026
1031
  ax.set_xlabel(_('Abscissa from upstream [m]'))
1027
- fig.suptitle(self.myname + ' -- ' +_('Water surface profile'))
1032
+ fig.suptitle(self.myname + ' -- ' +_('Water surface elevation'))
1028
1033
 
1029
1034
  if show:
1030
1035
  fig.show()
@@ -1055,10 +1060,10 @@ class Polygons_Analyze(Zones):
1055
1060
  return fig,ax
1056
1061
 
1057
1062
  def plot_stage(self,
1058
- figax=None,
1059
- which_group=None,
1060
- operator:operators=operators.MEDIAN,
1061
- show=False):
1063
+ figax=None,
1064
+ which_group=None,
1065
+ operator:operators=operators.MEDIAN,
1066
+ show=False):
1062
1067
  """ Plot the water stage /water level
1063
1068
 
1064
1069
  :param figax: tuple (fig, ax) for the plot