wolfhece 2.0.22__py3-none-any.whl → 2.0.23__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
@@ -235,6 +235,9 @@ class WolfMapViewer(wx.Frame):
235
235
  compareitem = self.menugltf.Append(wx.ID_ANY, _('Compare...'), _('Create new frames to compare sculpting'))
236
236
  updategltf = self.menugltf.Append(wx.ID_ANY, _('Update...'), _('Update data from gltf files'))
237
237
 
238
+ self.filemenu.AppendSeparator()
239
+ check2D = self.filemenu.Append(wx.ID_ANY, _('Check 2D simulation headers'), _('Check 2D sim'))
240
+
238
241
  self.filemenu.AppendSeparator()
239
242
  compareitem = self.filemenu.Append(wx.ID_ANY, _('Set comparison'), _('Set comparison'))
240
243
  multiview = self.filemenu.Append(wx.ID_ANY, _('Multiviewer'), _('Multiviewer'))
@@ -478,7 +481,7 @@ class WolfMapViewer(wx.Frame):
478
481
  self.cloudmenu=None
479
482
  self._configuration = None
480
483
 
481
- self.compare_results={}
484
+ self.compare_results = None
482
485
 
483
486
  self.InitUI()
484
487
 
@@ -3192,6 +3195,9 @@ class WolfMapViewer(wx.Frame):
3192
3195
  fig.show()
3193
3196
 
3194
3197
  elif itemlabel == _("Change current view"):
3198
+
3199
+ # Change view for results
3200
+
3195
3201
  autoscale = False
3196
3202
  choices = [cur.value for cur in views_2D]
3197
3203
  dlg = wx.SingleChoiceDialog(None, _("Pick a view"), "Choices", choices)
@@ -3252,11 +3258,15 @@ class WolfMapViewer(wx.Frame):
3252
3258
  curarray.set_currentview(method)
3253
3259
 
3254
3260
  else:
3255
- if diamsize is not None:
3256
- self.active_res2d.sediment_diameter = diamsize
3257
- self.active_res2d.sediment_density = density
3258
- self.active_res2d.load_default_colormap('shields_cst')
3259
- self.active_res2d.set_currentview(method, True)
3261
+ if self.active_res2d is not None:
3262
+ if diamsize is not None:
3263
+ self.active_res2d.sediment_diameter = diamsize
3264
+ self.active_res2d.sediment_density = density
3265
+ self.active_res2d.load_default_colormap('shields_cst')
3266
+ self.active_res2d.set_currentview(method, True)
3267
+
3268
+ if self.compare_results is not None:
3269
+ self.compare_results.update_type_result(method)
3260
3270
 
3261
3271
  elif itemlabel == _("Read last result"):
3262
3272
 
@@ -3558,6 +3568,23 @@ class WolfMapViewer(wx.Frame):
3558
3568
 
3559
3569
  pass
3560
3570
 
3571
+ elif itemlabel == _('Check 2D simulation headers'):
3572
+
3573
+ # Check 2D simulation
3574
+ dlg = wx.FileDialog(self, _("Choose 2D simulation file"), wildcard="all (*.*)|*.*", style=wx.FD_OPEN)
3575
+ if dlg.ShowModal() == wx.ID_CANCEL:
3576
+ dlg.Destroy()
3577
+ return
3578
+
3579
+ filename = dlg.GetPath()
3580
+ dlg.Destroy()
3581
+
3582
+ from .mesh2d.wolf2dprev import prev_sim2D
3583
+
3584
+ sim = prev_sim2D(filename)
3585
+ sim.verify_files()
3586
+
3587
+
3561
3588
  elif itemlabel == _('Set comparison'):
3562
3589
 
3563
3590
  self.compare_results = Compare_Arrays_Results(self, True, True)
@@ -7580,13 +7607,36 @@ class Compare_Arrays_Results():
7580
7607
  self.linked_elts.append(curelt.as_WolfArray())
7581
7608
 
7582
7609
  for curelt, curlink in zip(self.elements, self.linked_elts):
7583
- curlink.idx = curelt.idx
7610
+ curlink.idx = curelt.idx + ' ' + curelt.get_currentview().value
7584
7611
 
7585
7612
  self.set_diff()
7586
7613
 
7587
7614
  if self._initialized_viewers:
7588
7615
  self.update_viewers()
7589
7616
 
7617
+ def update_type_result(self, newtype):
7618
+ """
7619
+ Update the result type for each element
7620
+
7621
+ """
7622
+ assert newtype in views_2D, 'This type is not a 2D result'
7623
+ assert self.type in (Comp_Type.RES2D, Comp_Type.RES2D_GPU), 'This method is only for 2D results'
7624
+
7625
+ for curelt in self.elements:
7626
+ curelt.set_currentview(newtype)
7627
+
7628
+ # remove elements
7629
+ for baselt, curelt, curmap in zip(self.elements, self.linked_elts, self.mapviewers):
7630
+
7631
+ curmap.removeobj_from_id(curelt.idx)
7632
+
7633
+ for curdiff, curmap in zip(self.diff, self.mapviewers_diff):
7634
+
7635
+ curmap.removeobj_from_id(curdiff.idx)
7636
+
7637
+
7638
+ self.update_comp(self.times.get_times_idx())
7639
+
7590
7640
  def set_elements(self):
7591
7641
  """ Set the elements to compare with the right type """
7592
7642
  from .ui.wolf_times_selection_comparison_models import Times_Selection
@@ -7595,6 +7645,7 @@ class Compare_Arrays_Results():
7595
7645
  self.type = self.paths[0][0]
7596
7646
 
7597
7647
  if self.type == Comp_Type.RES2D_GPU:
7648
+ self.parent.menu_wolf2d()
7598
7649
  self.elements = [wolfres2DGPU(cur[1], plotted=False, idx = cur[1].name + '_' + str(idx)) for idx, cur in enumerate(self.paths)]
7599
7650
 
7600
7651
  times = [curmod.get_times_steps()[0] for curmod in self.elements]
@@ -7603,6 +7654,7 @@ class Compare_Arrays_Results():
7603
7654
  self.times.Show()
7604
7655
 
7605
7656
  elif self.type == Comp_Type.RES2D:
7657
+ self.parent.menu_wolf2d()
7606
7658
  self.elements = [Wolfresults_2D(cur[1], plotted=False, idx = cur[1].name + '_' + str(idx)) for idx, cur in enumerate(self.paths)]
7607
7659
 
7608
7660
  times = [curmod.get_times_steps()[0] for curmod in self.elements]
@@ -7695,7 +7747,10 @@ class Compare_Arrays_Results():
7695
7747
 
7696
7748
  # on attribue une matrice par interface graphique
7697
7749
  ref = elts[0]
7698
- for curelt, curmap in zip(elts, self.mapviewers):
7750
+ for baselt, curelt, curmap in zip(self.elements, elts, self.mapviewers):
7751
+
7752
+ # if self.type in (Comp_Type.RES2D, Comp_Type.RES2D_GPU):
7753
+ # curmap.active_res2d = baselt
7699
7754
 
7700
7755
  curmap.removeobj_from_id(curelt.idx)
7701
7756
 
@@ -7706,7 +7761,7 @@ class Compare_Arrays_Results():
7706
7761
  # diff = self.diff[0]
7707
7762
  for curdiff, curmap in zip(self.diff, self.mapviewers_diff):
7708
7763
 
7709
- curmap.removeobj_from_id('diff '+ curdiff.idx)
7764
+ curmap.removeobj_from_id(curdiff.idx)
7710
7765
 
7711
7766
  curdiff.change_gui(curmap)
7712
7767
  curmap.active_array = curdiff
@@ -7754,7 +7809,7 @@ class Compare_Arrays_Results():
7754
7809
  curmap.add_object('array', newobj = curelt, ToCheck = True, id = curelt.idx)
7755
7810
 
7756
7811
  for curdiff, curmap in zip(self.diff, self.mapviewers_diff):
7757
- curmap.add_object('array', newobj = curdiff, ToCheck = True, id = 'diff '+ curdiff.idx)
7812
+ curmap.add_object('array', newobj = curdiff, ToCheck = True, id = curdiff.idx)
7758
7813
 
7759
7814
  if self.independent:
7760
7815
  for curmap in self.mapviewers + self.mapviewers_diff:
wolfhece/apps/version.py CHANGED
@@ -5,7 +5,7 @@ class WolfVersion():
5
5
 
6
6
  self.major = 2
7
7
  self.minor = 0
8
- self.patch = 22
8
+ self.patch = 23
9
9
 
10
10
  def __str__(self):
11
11
 
@@ -19,7 +19,8 @@ import logging
19
19
  from enum import Enum
20
20
 
21
21
  from ..wolf_array import WOLF_ARRAY_FULL_INTEGER, WOLF_ARRAY_FULL_SINGLE, WolfArray, WolfArrayMB, WolfArrayMNAP, \
22
- header_wolf,WolfArray_Sim2D
22
+ header_wolf, WolfArray_Sim2D, WolfArrayMNAP, WOLF_ARRAY_MB_SINGLE, WOLF_ARRAY_FULL_LOGICAL, WOLF_ARRAY_FULL_SINGLE, getkeyblock
23
+
23
24
  from ..PyVertexvectors import *
24
25
  from ..PyVertex import getIfromRGB
25
26
  from ..PyTranslate import _
@@ -2985,3 +2986,91 @@ class xy_file():
2985
2986
  myvect.add_vertex(curvert)
2986
2987
 
2987
2988
  self.myzones.find_minmax(True)
2989
+
2990
+
2991
+ class prev_sim2D():
2992
+
2993
+ def __init__(self, fname:str) -> None:
2994
+
2995
+ from pathlib import Path
2996
+
2997
+ self.filename = fname
2998
+ self.mydir = Path(fname).parent.as_posix()
2999
+ self.filenamegen = self.filename
3000
+ self.myparam = prev_parameters_simul(self)
3001
+ self.myparam.read_file()
3002
+ self.mymnap = WolfArrayMNAP(self.filenamegen)
3003
+
3004
+ self.files_MB_array={'Initial Conditions':[
3005
+ ('.topini','Bed elevation [m]',WOLF_ARRAY_MB_SINGLE),
3006
+ ('.hbinb','Water depth [m]',WOLF_ARRAY_MB_SINGLE),
3007
+ ('.qxbinb','Discharge X [m²/s]',WOLF_ARRAY_MB_SINGLE),
3008
+ ('.qybinb','Discharge Y [m²/s]',WOLF_ARRAY_MB_SINGLE),
3009
+ ('.frotini','Roughness coeff',WOLF_ARRAY_MB_SINGLE)
3010
+ ]}
3011
+
3012
+ self.files_fine_array={'Characteristics':[
3013
+ ('.napbin','Mask [-]',WOLF_ARRAY_FULL_LOGICAL),
3014
+ ('.top','Bed Elevation [m]',WOLF_ARRAY_FULL_SINGLE),
3015
+ ('.topini_fine','Bed Elevation - computed [m]',WOLF_ARRAY_FULL_SINGLE),
3016
+ ('.frot','Roughness coefficient [law dependent]',WOLF_ARRAY_FULL_SINGLE),
3017
+ ('.inf','Infiltration zone [-]',WOLF_ARRAY_FULL_SINGLE),
3018
+ ('.hbin','Initial water depth [m]',WOLF_ARRAY_FULL_SINGLE),
3019
+ ('.qxbin','Initial discharge along X [m^2/s]',WOLF_ARRAY_FULL_SINGLE),
3020
+ ('.qybin','Initial discharge along Y [m^2/s]',WOLF_ARRAY_FULL_SINGLE)
3021
+ ]}
3022
+
3023
+ def get_header(self):
3024
+ curhead = header_wolf()
3025
+
3026
+ curhead.nbx = self.myparam.nxfin
3027
+ curhead.nby = self.myparam.nyfin
3028
+
3029
+ curhead.dx = self.myparam.dxfin
3030
+ curhead.dy = self.myparam.dyfin
3031
+
3032
+ curhead.origx = self.myparam.xminfin
3033
+ curhead.origy = self.myparam.yminfin
3034
+
3035
+ curhead.translx = self.myparam.translx
3036
+ curhead.transly = self.myparam.transly
3037
+
3038
+ return curhead
3039
+
3040
+ def get_header_MB(self,abs=False):
3041
+ """#> Renvoit un header avec les infos multi-blocs"""
3042
+ myheader:header_wolf
3043
+ myheader = self.mymnap.get_header(abs=abs)
3044
+ for curblock in self.mymnap.myblocks.values():
3045
+ myheader.head_blocks[getkeyblock(curblock.blockindex)] = curblock.get_header(abs=abs)
3046
+ return myheader
3047
+
3048
+ def verify_files(self):
3049
+ """
3050
+ Vérification de la présence des en-têtes dans les différents fichiers
3051
+ """
3052
+
3053
+ fhead = self.get_header()
3054
+ mbhead = self.get_header_MB()
3055
+
3056
+ fine = self.files_fine_array['Characteristics']
3057
+ for curextent,text,wolftype in fine:
3058
+ fname = self.filenamegen + curextent
3059
+ if exists(fname):
3060
+ logging.info(f'Verifying header for {fname}')
3061
+ fname += '.txt'
3062
+ fhead.write_txt_header(fname,wolftype)
3063
+
3064
+ mb = self.files_MB_array['Initial Conditions']
3065
+ for curextent,text,wolftype in mb:
3066
+ fname = self.filenamegen + curextent
3067
+ if exists(fname):
3068
+ logging.info(f'Verifying header for {fname}')
3069
+ fname += '.txt'
3070
+ mbhead.write_txt_header(fname,wolftype)
3071
+
3072
+ fname = self.filenamegen + '.lst'
3073
+ if not exists(fname):
3074
+ logging.warning(f'File {fname} does not exist -- Creating it')
3075
+ with open(fname,'w') as f:
3076
+ f.write('0\n')
@@ -142,3 +142,10 @@ class Times_Selection(wx.Dialog):
142
142
  self.times = times
143
143
  for cur, curlb in zip(self.times, self.lb):
144
144
  curlb[1].Set([str(curtime) for curtime in cur])
145
+
146
+ def get_times_idx(self):
147
+ """
148
+ Retourne les index des temps sélectionnés dans les listes de temps.
149
+
150
+ """
151
+ return [curlb[1].GetSelection() for curlb in self.lb]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wolfhece
3
- Version: 2.0.22
3
+ Version: 2.0.23
4
4
  Author-email: Stéphane Champailler <stephane.champailler@uliege.be>, Pierre Archambeau <pierre.archambeau@uliege.be>
5
5
  Project-URL: Homepage, https://uee.uliege.be/hece
6
6
  Project-URL: Issues, https://uee.uliege.be/hece
@@ -5,7 +5,7 @@ wolfhece/Lidar2002.py,sha256=sXZ6p8_EKI5l8fJswIMAABT6dqHKVexU52Tjl1uuisU,5770
5
5
  wolfhece/ManageParams.py,sha256=Wgt5Zh7QBtyiwTAltPHunSLqt4XuVuRH76GTUrXabS4,219
6
6
  wolfhece/PyConfig.py,sha256=oGSL1WsLM9uinlNP4zGBLK3uHPmBfduUi7R-VtWuRFA,8034
7
7
  wolfhece/PyCrosssections.py,sha256=wdq-KYaLDBAa-gu3plWFBJN0Stx-oZX2dxs-iKjGBHo,111109
8
- wolfhece/PyDraw.py,sha256=JR4Y9Jzd8JZbT6sd7pwMMd0YNLdtRsQCOYy8FkCrUi0,320904
8
+ wolfhece/PyDraw.py,sha256=C501ZkqfL42RBw0ytO7u3amB3bFiz5W4bobqratdt4A,322796
9
9
  wolfhece/PyGui.py,sha256=TLhXjfEZhMRucPmtu1ntz-wlvX4phntPHG6jYhGPMUk,52687
10
10
  wolfhece/PyGuiHydrology.py,sha256=t7EqOMyA1mkVg_aATMaduR-aqs04V-uRCifyHVmPqRs,7133
11
11
  wolfhece/PyHydrographs.py,sha256=h2OfgmRkKc5XZn0iPFOVy60pGTSa5EFoUOEya0SeG7o,3411
@@ -59,7 +59,7 @@ wolfhece/apps/check_install.py,sha256=jrKR-njqnpIh6ZJqvP6KbDUPVCfwTNQj4glQhcyzs9
59
59
  wolfhece/apps/curvedigitizer.py,sha256=avWERHuVxPnJBOD_ibczwW_XG4vAenqWS8W1zjhBox8,4898
60
60
  wolfhece/apps/isocurrent.py,sha256=4XnNWPa8mYUK7V4zdDRFrHFIXNG2AN2og3TqWKKcqjY,3811
61
61
  wolfhece/apps/splashscreen.py,sha256=9BNArfcoRcyWglzFDQdLv2Dlvqz8w5qYKdE5zA66-Kw,2117
62
- wolfhece/apps/version.py,sha256=1jx_QTbyGIcrkyQcMDkU-l3GQnfA1Q4BUAYhgLZWlNA,388
62
+ wolfhece/apps/version.py,sha256=AR5VuDo0rvldetfOPlc0jtls3HgiewRprm7x_oDnjKM,388
63
63
  wolfhece/apps/wolf.py,sha256=gqfm-ZaUJqNsfCzmdtemSeqLw-GVdSVix-evg5WArJI,293
64
64
  wolfhece/apps/wolf2D.py,sha256=gWD9ee2-1pw_nUxjgRaJMuSe4kUT-RWhOeoTt_Lh1mM,267
65
65
  wolfhece/apps/wolfcompare2Darrays.py,sha256=MucG5h4sU4jicDVCKohiCDUVUqx_RQ1qKrZKokpnxhQ,3743
@@ -201,7 +201,7 @@ wolfhece/mesh2d/bc_manager.py,sha256=vSVogXy1x3A6fZKWA6mPZSGX2e3EAUVmEjD9Bgww_hU
201
201
  wolfhece/mesh2d/cell_tracker.py,sha256=AR-Bty-QnrY1ni8Lwak2kU2UWMAJSBCF2ugl2YpfsB4,8660
202
202
  wolfhece/mesh2d/config_manager.py,sha256=5im8G1efNXH-7km6JR__lTIKp93L4SlfXbAZwuVzfqs,14407
203
203
  wolfhece/mesh2d/cst_2D_boundary_conditions.py,sha256=BaJeKHyJiKEFWBkTQeYsDBW86703ooj65MFVpPMgjLg,2810
204
- wolfhece/mesh2d/wolf2dprev.py,sha256=YOXkKl0qZNkVO6x_-8u5xmL7q_3p29hl2jt0kVFMj_I,132625
204
+ wolfhece/mesh2d/wolf2dprev.py,sha256=TAgIRb8X0-Ktoa5PtZQ8Z_ev99MlDw-VmeJgq8IeRZo,136108
205
205
  wolfhece/models/HECE_169.pptx,sha256=OWJtsWz504A-REFaaxw8lwStHyQU2l7KEeiE7IZvtbk,3396930
206
206
  wolfhece/models/blue.pal,sha256=NnjJnjnYVdQkG54RyPXvo4Tl9ytB0cN7zpiHtj1N6bw,33
207
207
  wolfhece/models/diff16.pal,sha256=Pkp9kQ1GvmAKz3lgwohsw8eQySjVVKHbjhoWw-gZ6Nc,303
@@ -245,9 +245,9 @@ wolfhece/sounds/sonsw1.wav,sha256=HhuGeZ3iIyJdDALmM-jvGZDkKw3IZ3JXCuQZkN3Zjtc,21
245
245
  wolfhece/sounds/sonsw2.wav,sha256=pFLVt6By0_EPQNt_3KfEZ9a1uSuYTgQSX1I_Zurv9Rc,110636
246
246
  wolfhece/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
247
247
  wolfhece/ui/wolf_multiselection_collapsiblepane.py,sha256=yGbU_JsF56jsmms0gh7mxa7tbNQ_SxqhpAZxhm-mTy4,14860
248
- wolfhece/ui/wolf_times_selection_comparison_models.py,sha256=G3g_t2tz69jU6mxvZ6XrKdIqcs8jZrN4FmXx9GdCoHU,4509
249
- wolfhece-2.0.22.dist-info/METADATA,sha256=aIz0F6vP2sz9Qjhmw7qBpkOtdXtwfY0yUxLKCx_LV1o,2239
250
- wolfhece-2.0.22.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
251
- wolfhece-2.0.22.dist-info/entry_points.txt,sha256=AIu1KMswrdsqNq_2jPtrRIU4tLjuTnj2dCY-pxIlshw,276
252
- wolfhece-2.0.22.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
253
- wolfhece-2.0.22.dist-info/RECORD,,
248
+ wolfhece/ui/wolf_times_selection_comparison_models.py,sha256=wCxGRnE3kzEkWlWA6-3X8ADOFux_B0a5QWJ2GnXTgJw,4709
249
+ wolfhece-2.0.23.dist-info/METADATA,sha256=ILTWNh7V6XuNr1w9QKnT4QnoEI10GW-NAZgHg06UJAg,2239
250
+ wolfhece-2.0.23.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
251
+ wolfhece-2.0.23.dist-info/entry_points.txt,sha256=AIu1KMswrdsqNq_2jPtrRIU4tLjuTnj2dCY-pxIlshw,276
252
+ wolfhece-2.0.23.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
253
+ wolfhece-2.0.23.dist-info/RECORD,,