wolfhece 2.1.96__py3-none-any.whl → 2.1.98__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/PyConfig.py CHANGED
@@ -29,10 +29,10 @@ class ConfigurationKeys(Enum):
29
29
  COLOR_BACKGROUND = "ColorBackground"
30
30
  ACTIVE_ARRAY_PALETTE_FOR_IMAGE = "Use active array palette for image"
31
31
  ACTIVE_RES2D_PALETTE_FOR_IMAGE = "Use active result palette for image"
32
+ ASSEMBLY_IMAGES = "AssemblyImages"
32
33
 
33
34
  class WolfConfiguration:
34
- """ Holds the PyWolf configuration.
35
- """
35
+ """ Holds the PyWolf configuration """
36
36
 
37
37
  def __init__(self, path=None):
38
38
  # We make sure we use a standard location
@@ -71,7 +71,8 @@ class WolfConfiguration:
71
71
  ConfigurationKeys.ACTIVE_ARRAY_PALETTE_FOR_IMAGE.value: True,
72
72
  ConfigurationKeys.ACTIVE_RES2D_PALETTE_FOR_IMAGE.value: False,
73
73
  ConfigurationKeys.TICKS_BOUNDS.value: True,
74
- ConfigurationKeys.COLOR_BACKGROUND.value: [255, 255, 255, 255]
74
+ ConfigurationKeys.COLOR_BACKGROUND.value: [255, 255, 255, 255],
75
+ ConfigurationKeys.ASSEMBLY_IMAGES.value: 0
75
76
  }
76
77
  self._types = {
77
78
  ConfigurationKeys.VERSION.value: int,
@@ -80,10 +81,10 @@ class WolfConfiguration:
80
81
  ConfigurationKeys.ACTIVE_ARRAY_PALETTE_FOR_IMAGE.value: bool,
81
82
  ConfigurationKeys.ACTIVE_RES2D_PALETTE_FOR_IMAGE.value: bool,
82
83
  ConfigurationKeys.TICKS_BOUNDS.value: bool,
83
- ConfigurationKeys.COLOR_BACKGROUND.value: list
84
+ ConfigurationKeys.COLOR_BACKGROUND.value: list,
85
+ ConfigurationKeys.ASSEMBLY_IMAGES.value: int
84
86
  }
85
87
 
86
-
87
88
  self._check_config()
88
89
 
89
90
  def _check_config(self):
@@ -128,7 +129,7 @@ class GlobalOptionsDialog(wx.Dialog):
128
129
  super(GlobalOptionsDialog, self).__init__(*args, **kw)
129
130
 
130
131
  self.InitUI()
131
- self.SetSize((400, 300))
132
+ self.SetSize((600, 400))
132
133
  self.SetTitle(_("Global options"))
133
134
 
134
135
  def push_configuration(self, configuration):
@@ -138,6 +139,7 @@ class GlobalOptionsDialog(wx.Dialog):
138
139
  self.cfg_bkg_color.SetColour(configuration[ConfigurationKeys.COLOR_BACKGROUND])
139
140
  self.cfg_active_array_pal.SetValue(configuration[ConfigurationKeys.ACTIVE_ARRAY_PALETTE_FOR_IMAGE])
140
141
  self.cfg_active_res_pal.SetValue(configuration[ConfigurationKeys.ACTIVE_RES2D_PALETTE_FOR_IMAGE])
142
+ self.cfg_assembly_images.SetSelection(configuration[ConfigurationKeys.ASSEMBLY_IMAGES])
141
143
 
142
144
  def pull_configuration(self, configuration):
143
145
  configuration[ConfigurationKeys.PLAY_WELCOME_SOUND] = self.cfg_welcome_voice.IsChecked()
@@ -146,6 +148,7 @@ class GlobalOptionsDialog(wx.Dialog):
146
148
  configuration[ConfigurationKeys.COLOR_BACKGROUND] = list(self.cfg_bkg_color.GetColour())
147
149
  configuration[ConfigurationKeys.ACTIVE_ARRAY_PALETTE_FOR_IMAGE] = self.cfg_active_array_pal.IsChecked()
148
150
  configuration[ConfigurationKeys.ACTIVE_RES2D_PALETTE_FOR_IMAGE] = self.cfg_active_res_pal.IsChecked()
151
+ configuration[ConfigurationKeys.ASSEMBLY_IMAGES] = self.cfg_assembly_images.GetSelection()
149
152
 
150
153
  def InitUI(self):
151
154
 
@@ -191,9 +194,8 @@ class GlobalOptionsDialog(wx.Dialog):
191
194
  self.cfg_ticks_size = wx.TextCtrl(pnl, value='500.',style = wx.TE_CENTRE )
192
195
 
193
196
  hboxticks.Add(self.label_ticks_size, 1, wx.EXPAND)
194
- hboxticks.Add(self.cfg_ticks_size, 1, wx.EXPAND)
195
-
196
- sbs.Add(hboxticks, 1, wx.EXPAND)
197
+ hboxticks.Add(self.cfg_ticks_size, 1, wx.EXPAND, 5)
198
+ sbs.Add(hboxticks, 1, wx.EXPAND,5)
197
199
 
198
200
  self.cfg_ticks_bounds = wx.CheckBox(pnl, label=_('Add bounds to ticks'))
199
201
  self.cfg_ticks_bounds.SetToolTip(_('If not checked, the extreme values of the ticks will not be displayed'))
@@ -207,6 +209,16 @@ class GlobalOptionsDialog(wx.Dialog):
207
209
  self.cfg_active_res_pal.SetToolTip(_('If checked, the active result palette will be used for the image (but priority to active array palette if checked)'))
208
210
  sbs.Add(self.cfg_active_res_pal, 1, wx.EXPAND, 5)
209
211
 
212
+ locsizer = wx.BoxSizer(wx.HORIZONTAL)
213
+ self.label_assembly_images = wx.StaticText(pnl, label=_('Assembly mode for images (if linked viewers)'))
214
+ self.cfg_assembly_images = wx.ListBox(pnl, choices=['horizontal', 'vertical', 'square'], style=wx.LB_SINGLE)
215
+ self.cfg_assembly_images.SetToolTip(_('Choose the assembly mode for images -- horizontal, vertical or square'))
216
+
217
+ locsizer.Add(self.label_assembly_images, 1, wx.EXPAND, 2)
218
+ locsizer.Add(self.cfg_assembly_images, 1, wx.EXPAND,5)
219
+
220
+ sbs.Add(locsizer, 3, wx.EXPAND, 5)
221
+
210
222
  pnl.SetSizer(sbs)
211
223
  pnl.Layout()
212
224
 
wolfhece/PyDraw.py CHANGED
@@ -1217,6 +1217,14 @@ class WolfMapViewer(wx.Frame):
1217
1217
  # # print(msg)
1218
1218
  # return 0
1219
1219
 
1220
+ @property
1221
+ def viewer_name(self):
1222
+ return self.GetTitle()
1223
+
1224
+ @viewer_name.setter
1225
+ def viewer_name(self, value):
1226
+ self.SetTitle(value)
1227
+
1220
1228
  @property
1221
1229
  def wxlogging(self):
1222
1230
  return self._wxlogging
@@ -2450,6 +2458,16 @@ class WolfMapViewer(wx.Frame):
2450
2458
  else:
2451
2459
  return config[ConfigurationKeys.TICKS_SIZE]
2452
2460
 
2461
+ @property
2462
+ def assembly_mode(self) -> str:
2463
+ """ Return the assembly mode from configs """
2464
+
2465
+ config = self.get_configuration()
2466
+ if config is None:
2467
+ return 'square'
2468
+ else:
2469
+ return config[ConfigurationKeys.ASSEMBLY_IMAGES]
2470
+
2453
2471
  @property
2454
2472
  def ticks_bounds(self) -> bool:
2455
2473
  """ Return the ticks bounds from configs """
@@ -3041,7 +3059,12 @@ class WolfMapViewer(wx.Frame):
3041
3059
 
3042
3060
  return myimage
3043
3061
 
3044
- def save_canvasogl(self, fn:str='', mpl:bool=True, ds:float=0., dpi:int= 300):
3062
+ def save_canvasogl(self,
3063
+ fn:str='',
3064
+ mpl:bool=True,
3065
+ ds:float=0.,
3066
+ dpi:int= 300,
3067
+ add_title:bool = False):
3045
3068
  """
3046
3069
  Sauvegarde de la fenêtre d'affichage dans un fichier
3047
3070
 
@@ -3151,6 +3174,8 @@ class WolfMapViewer(wx.Frame):
3151
3174
 
3152
3175
  # self.Paint()
3153
3176
 
3177
+ if add_title:
3178
+ ax.set_title(self.viewer_name)
3154
3179
  fig.set_size_inches(12, 10)
3155
3180
  fig.tight_layout()
3156
3181
 
@@ -3257,19 +3282,32 @@ class WolfMapViewer(wx.Frame):
3257
3282
  # liste des éléments modifiable dans l'arbre
3258
3283
  self.all_lists = [self.myarrays, self.myvectors, self.myclouds, self.mytri, self.myothers, self.myviews, self.myres2D, self.mytiles, self.mypartsystems, self.myviewers3d]
3259
3284
 
3285
+ self.menu_options = wx.Menu()
3286
+ self._change_title = self.menu_options.Append(wx.ID_ANY, _('Change title'), _('Change title of the window'))
3287
+ self.Bind(wx.EVT_MENU, self.OnChangeTitle, self._change_title)
3288
+
3260
3289
  if self.get_configuration() is not None:
3261
3290
  # see PyGui.py if necessary
3262
3291
 
3263
- self.menu_options = wx.Menu()
3264
3292
  self.menubar.Append(self.menu_options, _('Options'))
3265
3293
  self.option_global = self.menu_options.Append(wx.ID_ANY,_("Global"),_("Modify global options"))
3266
3294
  self.Bind(wx.EVT_MENU, self.GlobalOptionsDialog, self.option_global)
3267
3295
 
3268
- self.menu_1to9 =self.menu_options.Append(wx.ID_ANY, _('Colors for selections 1->9'), _('Selections'))
3269
- self.Bind(wx.EVT_MENU, self.colors1to9.change_colors, self.menu_1to9)
3296
+ self.menu_1to9 =self.menu_options.Append(wx.ID_ANY, _('Colors for selections 1->9'), _('Selections'))
3297
+ self.Bind(wx.EVT_MENU, self.colors1to9.change_colors, self.menu_1to9)
3270
3298
 
3271
3299
  self.Show(True)
3272
3300
 
3301
+ def OnChangeTitle(self, e):
3302
+ """
3303
+ Change the title of the window
3304
+ """
3305
+
3306
+ dlg = wx.TextEntryDialog(None, _('Enter the new title'), _('Change title'), self.GetTitle())
3307
+ if dlg.ShowModal() == wx.ID_OK:
3308
+ self.SetTitle(dlg.GetValue())
3309
+ dlg.Destroy()
3310
+
3273
3311
  def OnSize(self, e):
3274
3312
  """
3275
3313
  Redimensionnement de la fenêtre
@@ -6092,8 +6130,11 @@ class WolfMapViewer(wx.Frame):
6092
6130
 
6093
6131
  elif itemlabel == 'Save to image...':
6094
6132
  autoscale = False
6095
- fn, ds = self.save_canvasogl()
6096
- self.save_linked_canvas(fn[:-4], ds)
6133
+
6134
+ fn, ds = self.save_canvasogl(mpl=True)
6135
+
6136
+ all_images = self.save_linked_canvas(fn[:-4], mpl= True, ds= ds, add_title= True)
6137
+ self.assembly_images(all_images, mode= self.assembly_mode)
6097
6138
 
6098
6139
  elif itemlabel == _('Copy image...'):
6099
6140
  autoscale = False
@@ -6663,12 +6704,89 @@ class WolfMapViewer(wx.Frame):
6663
6704
 
6664
6705
  return linkedarrays
6665
6706
 
6666
- def save_linked_canvas(self, fn, mpl=True, ds=0.):
6667
- """ Save canvas of all linked viewers """
6707
+ def save_linked_canvas(self, fn:str, mpl:bool= True, ds:float= 0., add_title:bool= True) -> tuple[(str, float), str]:
6708
+ """ Save canvas of all linked viewers
6709
+
6710
+ :param fn: filename without extension -- '.png' will be added
6711
+ :param mpl: save as matplotlib image
6712
+ :param ds: Ticks size for matplotlib image
6713
+ :return: list of tuple ((filename, ds), viewer_name)
6714
+ """
6668
6715
 
6716
+ fn = str(fn)
6717
+ ret = []
6669
6718
  if self.linked:
6670
6719
  for idx, curel in enumerate(self.linkedList):
6671
- curel.save_canvasogl(fn + '_' + str(idx) + '.png', mpl, ds)
6720
+ ret.append((curel.save_canvasogl(fn + '_' + str(idx) + '.png', mpl, ds, add_title= add_title), self.viewer_name))
6721
+
6722
+ return ret
6723
+
6724
+ def assembly_images(self, all_images, mode:Literal['horizontal', 'vertical', 'square']= 'square'):
6725
+ """ Assembly images
6726
+
6727
+ Every image has the same size (width, height)
6728
+
6729
+ :param all_images: list of tuple (filename, viewer_name)
6730
+ :param mode: 'horizontal', 'vertical', 'square'
6731
+ """
6732
+
6733
+ assert mode in ['horizontal', 'vertical', 'square', 0, 1, 2], 'Mode not recognized'
6734
+
6735
+ from PIL import Image
6736
+
6737
+ images = [Image.open(fn) for (fn, ds), viewername in all_images]
6738
+
6739
+ widths, heights = zip(*(i.size for i in images))
6740
+
6741
+ if mode == 'horizontal' or mode==0:
6742
+
6743
+ total_width = sum(widths)
6744
+ max_height = max(heights)
6745
+
6746
+ new_im = Image.new('RGB', (total_width, max_height), color=(255,255,255))
6747
+
6748
+ x_offset = 0
6749
+ for im in images:
6750
+ new_im.paste(im, (x_offset,0))
6751
+ x_offset += im.size[0]
6752
+
6753
+ new_im.save(all_images[0][0][0][:-4] + '_assembly.png')
6754
+
6755
+ elif mode == 'vertical' or mode==1:
6756
+
6757
+ total_height = sum(heights)
6758
+ max_width = max(widths)
6759
+
6760
+ new_im = Image.new('RGB', (max_width, total_height), color=(255,255,255))
6761
+
6762
+ y_offset = 0
6763
+ for im in images:
6764
+ new_im.paste(im, (0, y_offset))
6765
+ y_offset += im.size[1]
6766
+
6767
+ new_im.save(all_images[0][0][0][:-4] + '_assembly.png')
6768
+
6769
+ elif mode == 'square' or mode==2:
6770
+
6771
+ max_width = max(widths)
6772
+ max_height = max(heights)
6773
+
6774
+ nb_hor = int(np.ceil(np.sqrt(len(images))))
6775
+
6776
+ new_im = Image.new('RGB', (max_width*nb_hor, max_height*nb_hor), color=(255,255,255))
6777
+
6778
+ x_offset = 0
6779
+ y_offset = 0
6780
+ for idx, im in enumerate(images):
6781
+ new_im.paste(im, (x_offset, y_offset))
6782
+ x_offset += im.size[0]
6783
+ if (idx+1) % nb_hor == 0:
6784
+ y_offset += im.size[1]
6785
+ x_offset = 0
6786
+
6787
+ new_im.save(all_images[0][0][0][:-4] + '_assembly.png')
6788
+
6789
+ return new_im
6672
6790
 
6673
6791
  def thread_update_blender(self):
6674
6792
  print("Update blender")
@@ -9314,7 +9432,7 @@ class WolfMapViewer(wx.Frame):
9314
9432
  # \n \
9315
9433
  # CTRL+Q : Quit application\n \
9316
9434
  # CTRL+U : Import GLTF/GLB\n \
9317
- # CTRL+C : Set copy source / Copy canvas to Clipboard\n \
9435
+ # CTRL+C : Set copy source\n \
9318
9436
  # CTRL+V : Paste selected values\n \
9319
9437
  # CTRL+ALT+V ou ALTGr+V : Paste/Recopy selection\n \
9320
9438
  # CTRL+L : chargement d'une matrice sur base du nom de fichier de la tile\n \
@@ -9350,7 +9468,8 @@ class WolfMapViewer(wx.Frame):
9350
9468
  'F7': _('Drawing : refresh'),
9351
9469
  'Arrows': _('Drawing : lateral movements'),
9352
9470
  'c or C': _('Drawing : copy canvas to Clipboard wo axes'),
9353
- 'CTRL+C': _('Drawing : copy canvas to Clipboard as Matplotlib image'),
9471
+ 'ALT+C': _('Drawing : copy canvas to Clipboard as Matplotlib image'),
9472
+ 'ALT+SHIFT+C': _('Drawing : copy canvas to Clipboard as Matplotlib image with axes - linked arrays'),
9354
9473
 
9355
9474
  'CTRL+o': _('Results : increase transparency of the current result'),
9356
9475
  'CTRL+O': _('Results : decrease transparency of the current result'),
@@ -9641,11 +9760,45 @@ class WolfMapViewer(wx.Frame):
9641
9760
  elif key == wx.WXK_DOWN:
9642
9761
  self.downobj()
9643
9762
 
9644
- elif key == ord('C') and altdown and not ctrldown:
9763
+ elif key == ord('C') and altdown and not ctrldown and not shiftdown:
9645
9764
  # ALT+C
9646
9765
  #Copie du canvas dans le clipboard pour transfert vers autre application
9647
9766
  self.copy_canvasogl()
9648
9767
 
9768
+ elif key == ord('C') and altdown and not ctrldown and shiftdown:
9769
+ # ALT+SHIFT+C
9770
+ # Copie du canvas dans le clipboard pour transfert vers autre application
9771
+ # Copie des canvas liés
9772
+
9773
+ from tempfile import TemporaryDirectory
9774
+
9775
+ logging.info(_('Creating images'))
9776
+
9777
+ with TemporaryDirectory() as tmpdirname:
9778
+ all_images = self.save_linked_canvas(Path(tmpdirname) / 'fig', mpl= True, ds= self.ticks_size, add_title= True)
9779
+ im_assembly = self.assembly_images(all_images, mode= self.assembly_mode)
9780
+
9781
+ logging.info(_('Creating images - done'))
9782
+
9783
+ # Copy image to clipboard
9784
+ if im_assembly is not None:
9785
+ if wx.TheClipboard.Open():
9786
+
9787
+ #création d'un objet bitmap wx
9788
+ wxbitmap = wx.Bitmap().FromBuffer(im_assembly.width, im_assembly.height, im_assembly.tobytes())
9789
+
9790
+ # objet wx exportable via le clipboard
9791
+ dataobj = wx.BitmapDataObject()
9792
+ dataobj.SetBitmap(wxbitmap)
9793
+
9794
+ wx.TheClipboard.SetData(dataobj)
9795
+ wx.TheClipboard.Close()
9796
+ logging.info(_('Image copied to clipboard'))
9797
+ else:
9798
+ logging.error(_('Cannot open the clipboard'))
9799
+ else:
9800
+ logging.error(_('No image to copy to clipboard'))
9801
+
9649
9802
  elif key == ord('C') and ctrldown and not altdown:
9650
9803
  # CTRL+C
9651
9804
  if self.active_array is None:
@@ -2200,7 +2200,7 @@ class vector:
2200
2200
  myvec=vector(name=curlabel,parentzone=myzone)
2201
2201
  myzone.add_vector(myvec)
2202
2202
 
2203
- ds = min(curarray.dx,curarray.dy)
2203
+ ds = curarray.get_dxdy_min()
2204
2204
 
2205
2205
  pts = self._refine2D(ds)
2206
2206
 
@@ -2238,6 +2238,9 @@ class vector:
2238
2238
  """
2239
2239
  Graphique Matplolib de valeurs dans les matrices liées
2240
2240
  """
2241
+ # from .wolf_array import WolfArray
2242
+ # from .wolfresults_2D import Wolfresults_2D
2243
+
2241
2244
  colors=['red','blue','green']
2242
2245
 
2243
2246
  exit=True
@@ -2257,30 +2260,49 @@ class vector:
2257
2260
 
2258
2261
  zmin=99999.
2259
2262
  zmax=-99999.
2263
+ nullvalue = -99999
2260
2264
 
2261
2265
  for curlabel, curarray in linked_arrays.items():
2262
2266
  if curarray.plotted:
2263
2267
 
2264
- ds = min(curarray.dx,curarray.dy)
2268
+ ds = curarray.get_dxdy_min()
2269
+
2265
2270
  nb = int(np.ceil(length/ds*2))
2266
2271
 
2267
2272
  alls = np.linspace(0,int(length),nb)
2268
2273
 
2269
2274
  pts = [myls.interpolate(curs) for curs in alls]
2270
2275
 
2271
- allz = [curarray.get_value(curpt.x,curpt.y) for curpt in pts]
2276
+ allz = np.asarray([curarray.get_value(curpt.x,curpt.y, nullvalue= nullvalue) for curpt in pts])
2272
2277
 
2273
- zmaxloc=np.max(allz)
2274
- zminloc=np.min(allz)
2278
+ zmaxloc=np.max(allz[allz!=nullvalue])
2279
+ zminloc=np.min(allz[allz!=nullvalue])
2275
2280
 
2276
2281
  zmax=max(zmax,zmaxloc)
2277
2282
  zmin=min(zmin,zminloc)
2278
2283
 
2279
- if np.max(allz)>-99999:
2280
- ax.plot(alls,allz,
2281
- color=colors[np.mod(k,3)],
2282
- lw=2.0,
2283
- label=curlabel)
2284
+ if np.max(allz)>nullvalue:
2285
+ # select parts
2286
+ if nullvalue in allz:
2287
+ # find all parts separated by nullvalue
2288
+ nulls = np.argwhere(allz==nullvalue)
2289
+ nulls = np.insert(nulls,0,-1)
2290
+ nulls = np.append(nulls,len(allz))
2291
+
2292
+ addlabel = True
2293
+ for i in range(len(nulls)-1):
2294
+ if nulls[i+1]-nulls[i]>1:
2295
+ ax.plot(alls[nulls[i]+1:nulls[i+1]],allz[nulls[i]+1:nulls[i+1]],
2296
+ color=colors[np.mod(k,3)],
2297
+ lw=2.0,
2298
+ label=curlabel if addlabel else None)
2299
+ addlabel = False
2300
+
2301
+ else:
2302
+ ax.plot(alls,allz,
2303
+ color=colors[np.mod(k,3)],
2304
+ lw=2.0,
2305
+ label=curlabel)
2284
2306
  k+=1
2285
2307
 
2286
2308
  ax.set_ylim(zmin,zmax)
@@ -5213,7 +5235,7 @@ class Zones(wx.Frame, Element_To_Draw):
5213
5235
  boxright.Add(self.getxyfromsz,0,wx.EXPAND) # Added
5214
5236
 
5215
5237
  self.butgetval = wx.Button(self,label=_('Get values (self or active array)'))
5216
- self.butgetval.SetToolTip(_("Get values of the attached/active array on each vertex of the active vector and update the editor"))
5238
+ self.butgetval.SetToolTip(_("Get values of the attached/active array (not working with 2D results) on each vertex of the active vector and update the editor"))
5217
5239
  self.butgetval.Bind(wx.EVT_BUTTON,self.Ongetvalues)
5218
5240
  boxright.Add(self.butgetval,0,wx.EXPAND)
5219
5241
 
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 = 96
8
+ self.patch = 98
9
9
 
10
10
  def __str__(self):
11
11
 
@@ -709,7 +709,21 @@ class Config_Manager_2D_GPU:
709
709
 
710
710
  def _select_tif_partname(self, curdict:dict, tifstr:Literal['bath_', 'mann_', 'infil_']):
711
711
  """ Select tif files with a 'str' as name's prefix """
712
- tif_list = [curtif for curtif in curdict[GPU_2D_file_extensions.TIF.value] if curtif.name.lower().startswith(tifstr)]
712
+
713
+ if tifstr == 'bath_':
714
+ forced_add = ['bathymetry.tif']
715
+ elif tifstr == 'mann_':
716
+ forced_add = ['manning.tif']
717
+ elif tifstr == 'infil_':
718
+ forced_add = ['infiltration.tif']
719
+
720
+ tif_list = [curtif for curtif in curdict[GPU_2D_file_extensions.TIF.value] \
721
+ if curtif.name.lower().startswith(tifstr) or \
722
+ curtif.name.lower() in forced_add]
723
+
724
+ tif_list += [curtif for curtif in curdict[GPU_2D_file_extensions.TIFF.value] \
725
+ if curtif.name.lower().startswith(tifstr) or \
726
+ curtif.name.lower() in forced_add]
713
727
 
714
728
  return tif_list
715
729
 
wolfhece/wolf_array.py CHANGED
@@ -5639,6 +5639,25 @@ class WolfArray(Element_To_Draw, header_wolf):
5639
5639
  band.FlushCache()
5640
5640
  band.ComputeStatistics(True)
5641
5641
 
5642
+
5643
+ def get_dxdy_min(self):
5644
+ """
5645
+ Return the minimal size
5646
+
5647
+ Mainly useful in PyVertexVectors to get the minimal size of the cells
5648
+ and ensure compatibility with the 2D results (GPU and Multiblocks)
5649
+ """
5650
+ return min(self.dx, self.dy)
5651
+
5652
+ def get_dxdy_max(self):
5653
+ """
5654
+ Return the maximal size
5655
+
5656
+ Mainly useful in PyVertexVectors to get the minimal size of the cells
5657
+ and ensure compatibility with the 2D results (GPU and Multiblocks)
5658
+ """
5659
+ return max(self.dx, self.dy)
5660
+
5642
5661
  def _import_npy(self, fn:str='', crop:list[float]=None):
5643
5662
  """
5644
5663
  Import a numpy file.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wolfhece
3
- Version: 2.1.96
3
+ Version: 2.1.98
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
@@ -5,9 +5,9 @@ wolfhece/GraphProfile.py,sha256=OCgJo0YFFBI6H1z-5egJsOOoWF_iziiza0-bbPejNMc,6965
5
5
  wolfhece/Lidar2002.py,sha256=bX-nIzdpjD7rOfEgJpTeaW6rIdAXwDp_z4YTM9CgANY,6068
6
6
  wolfhece/ManageParams.py,sha256=EeuUI5Vvh9ixCvYf8YShMC1s1Yacc7OxOCN7q81gqiQ,517
7
7
  wolfhece/Model1D.py,sha256=SI4oNF_J3MdjiWZoizS8kuRXLMVyymX9dYfYJNVCQVI,476989
8
- wolfhece/PyConfig.py,sha256=UNtl5UzZ399JqjJT67-4DWaIkv76sc1FiEsSDJpXlL0,10458
8
+ wolfhece/PyConfig.py,sha256=Bb1T8qjgKMChadJYDrHO9uo6CwItiAXScZpYkDXqZF8,11387
9
9
  wolfhece/PyCrosssections.py,sha256=FnmM9DWY_SAF2EDH9Gu2PojXNtSTRF4-aYQuAAJXBh4,112771
10
- wolfhece/PyDraw.py,sha256=k1XDmBIohV4sGYxotU-BTD4m0KXQh-VbT6nv2itS_Oo,443861
10
+ wolfhece/PyDraw.py,sha256=JTl5RmJjzu-xmzL3X4_VXh0sqCbiZesd3SR3u9ZTeRs,449435
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=JV7a4kN4hbwR4fNHATl3X3iuZ7Vh2vyThxVWKtNWSrQ,252593
19
+ wolfhece/PyVertexvectors.py,sha256=VDmAGoUQYaM1DX9GVprpjpUnZTO8zjC1n2lqQX5MfJo,253678
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
@@ -48,7 +48,7 @@ wolfhece/pywalous.py,sha256=yRaWJjKckXef1d9D5devP0yFHC9uc6kRV4G5x9PNq9k,18972
48
48
  wolfhece/rain_SPWMI.py,sha256=qCfcmF7LajloOaCwnTrrSMzyME03YyilmRUOqrPrv3U,13846
49
49
  wolfhece/textpillow.py,sha256=map7HsGYML_o5NHRdFg2s_TVQed_lDnpYNDv27MM0Vw,14130
50
50
  wolfhece/tools_mpl.py,sha256=gQ3Jg1iuZiecmMqa5Eli2ZLSkttu68VXL8YmMDBaEYU,564
51
- wolfhece/wolf_array.py,sha256=Pv7Kbimou7t-wXkixwZ0Gcv2N9kTPWJxiHI8VYD8sCk,407304
51
+ wolfhece/wolf_array.py,sha256=C8Aj2utsA78-NmOqVdKIKcoFc5iA-j7gDMvCRoBFL3U,407876
52
52
  wolfhece/wolf_hist.py,sha256=7jeVrgSkM3ErJO6SRMH_PGzfLjIdw8vTy87kesldggk,3582
53
53
  wolfhece/wolf_texture.py,sha256=DS5eobLxrq9ljyebYfpMSQPn8shkUAZZVfqrOKN_QUU,16951
54
54
  wolfhece/wolf_tiles.py,sha256=2Ho2I20rHRY81KXxjgLOYISdF4OkJ2d6omeY4shDoGI,10386
@@ -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=5EAPTzfatYqx9GXoy44yzHoCW1DnjWdiOvkS-fo60-c,388
78
+ wolfhece/apps/version.py,sha256=W-lUgSzX807GdIal36FgVFUfuDGbULppRDeyBCXWNc8,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
@@ -262,7 +262,7 @@ wolfhece/report/reporting.py,sha256=JUEXovx_S4jpYkJEBU0AC-1Qw2OkkWyV3VAp6iOfSHc,
262
262
  wolfhece/report/wolf_report.png,sha256=NoSV58LSwb-oxCcZScRiJno-kxDwRdm_bK-fiMsKJdA,592485
263
263
  wolfhece/scenario/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
264
264
  wolfhece/scenario/check_scenario.py,sha256=VVjtxfcLAgq_Pf8VSqRq6BJ-y4Zi24CntJpZWxAv3n8,5162
265
- wolfhece/scenario/config_manager.py,sha256=aQFqY2aDcKR5r7NIFqjcO1VJngajK_lOE1ZX5LVKKpc,90591
265
+ wolfhece/scenario/config_manager.py,sha256=sILVXCdSsB-LcfVbCIF33fkPAGd-8qZR9q2598TxVcU,91130
266
266
  wolfhece/scenario/imposebc_void.py,sha256=PqA_99hKcaqK5zsK6IRIc5Exgg3WVpgWU8xpwNL49zQ,5571
267
267
  wolfhece/scenario/update_void.py,sha256=ay8C_FxfXN627Hx46waaAO6F3ovYmOCTxseUumKAY7c,7474
268
268
  wolfhece/shaders/fragment_shader_texture.glsl,sha256=w6h8d5mJqFaGbao0LGmjRcFFdcEQ3ICIl9JpuT71K5k,177
@@ -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.96.dist-info/METADATA,sha256=woDxgeDItCFEgqYP3HLrY3xiLGjHxXRQ-rV9TyNDgFQ,2570
289
- wolfhece-2.1.96.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
290
- wolfhece-2.1.96.dist-info/entry_points.txt,sha256=ZZ-aSfbpdcmo-wo84lRFzBN7LaSnD1XRGSaAKVX-Gpc,522
291
- wolfhece-2.1.96.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
292
- wolfhece-2.1.96.dist-info/RECORD,,
288
+ wolfhece-2.1.98.dist-info/METADATA,sha256=qoO8NN6PL2Ob5mCO_8jQ2-cd3Je5ft85wg4DoS8BuqA,2570
289
+ wolfhece-2.1.98.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
290
+ wolfhece-2.1.98.dist-info/entry_points.txt,sha256=ZZ-aSfbpdcmo-wo84lRFzBN7LaSnD1XRGSaAKVX-Gpc,522
291
+ wolfhece-2.1.98.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
292
+ wolfhece-2.1.98.dist-info/RECORD,,