wolfhece 2.1.30__py3-none-any.whl → 2.1.32__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/PyPalette.py CHANGED
@@ -329,7 +329,7 @@ class wolfpalette(wx.Frame,LinearSegmentedColormap):
329
329
  nbl=i-1
330
330
  break
331
331
 
332
- if i < self.nb-1:
332
+ if i < self.nb:
333
333
  self.nb = i
334
334
  self.values=self.values[0:i]
335
335
  self.colors=self.colors[0:i,:]
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 = 30
8
+ self.patch = 32
9
9
 
10
10
  def __str__(self):
11
11
 
@@ -868,7 +868,11 @@ class Config_Manager_2D_GPU:
868
868
  else:
869
869
  logging.error(_("No 'bathymetry.tif' file found in the root directory !"))
870
870
 
871
- def create_simulation(self, dir:Path, idx_hydros:list[int] = [-1], delete_existing:bool = False) -> list[Path]:
871
+ def create_simulation(self,
872
+ dir:Path,
873
+ idx_hydros:list[int] = [-1],
874
+ delete_existing:bool = False,
875
+ preserve_ic:bool=False) -> list[Path]:
872
876
  """ Create a simulation from different hydrographs """
873
877
 
874
878
  if isinstance(dir, str):
@@ -996,9 +1000,23 @@ class Config_Manager_2D_GPU:
996
1000
  cursim.nap[cursim.bathymetry != 99999.] = 1
997
1001
 
998
1002
  if curic is None:
999
- cursim.h = np.zeros((self._header.nbx, self._header.nby), dtype=np.float32)
1000
- cursim.qx = np.zeros((self._header.nbx, self._header.nby), dtype=np.float32)
1001
- cursim.qy = np.zeros((self._header.nbx, self._header.nby), dtype=np.float32)
1003
+ if not preserve_ic:
1004
+ cursim.h = np.zeros((self._header.nbx, self._header.nby), dtype=np.float32)
1005
+ cursim.qx = np.zeros((self._header.nbx, self._header.nby), dtype=np.float32)
1006
+ cursim.qy = np.zeros((self._header.nbx, self._header.nby), dtype=np.float32)
1007
+ else:
1008
+ if (curdir / 'h.npy').exists():
1009
+ cursim.h = np.load(curdir / 'h.npy')
1010
+ else:
1011
+ cursim.h = np.zeros((self._header.nbx, self._header.nby), dtype=np.float32)
1012
+ if (curdir / 'qx.npy').exists():
1013
+ cursim.qx = np.load(curdir / 'qx.npy')
1014
+ else:
1015
+ cursim.qx = np.zeros((self._header.nbx, self._header.nby), dtype=np.float32)
1016
+ if (curdir / 'qy.npy').exists():
1017
+ cursim.qy = np.load(curdir / 'qy.npy')
1018
+ else:
1019
+ cursim.qy = np.zeros((self._header.nbx, self._header.nby), dtype=np.float32)
1002
1020
  else:
1003
1021
  if curic.h is not None:
1004
1022
  cursim.h = curic.h
@@ -1466,7 +1484,13 @@ class UI_Manager_2D_GPU():
1466
1484
  destroy_if_exists = ret == wx.ID_YES
1467
1485
  dlg.Destroy()
1468
1486
 
1469
- allsims = self._parent.create_simulation(Path(path), hydro, destroy_if_exists)
1487
+ if not destroy_if_exists:
1488
+ dlg = wx.MessageDialog(None, _('Do you want to preserve initial conditions ?'), _('Warning'), wx.YES_NO)
1489
+ ret = dlg.ShowModal()
1490
+ preserve_ic = ret == wx.ID_YES
1491
+ dlg.Destroy()
1492
+
1493
+ allsims = self._parent.create_simulation(Path(path), hydro, destroy_if_exists, preserve_ic)
1470
1494
 
1471
1495
  self._parent.load_data()
1472
1496
 
@@ -1561,10 +1585,31 @@ class UI_Manager_2D_GPU():
1561
1585
 
1562
1586
  def _callbackwp(self):
1563
1587
  """ Callback for wolfparam """
1564
- for cursim, curwp in self._wp.items():
1565
- if curwp.Shown:
1566
- cursim.from_wolfparam(curwp)
1567
- cursim.save_json()
1588
+ for cursim in self._wp:
1589
+ curwp = self._wp[cursim]
1590
+ if curwp is not None:
1591
+ try:
1592
+ if curwp.Shown:
1593
+ cursim.from_wolfparam(curwp)
1594
+ cursim.save_json()
1595
+ except Exception as e:
1596
+ self._wp[cursim] = None
1597
+ logging.debug(_('Error while saving parameters for simulation {}'.format(cursim.path.name)))
1598
+ logging.debug(str(e))
1599
+
1600
+ def _callbackwp_destroy(self):
1601
+ """ Callback for wolfparam """
1602
+ for cursim in self._wp:
1603
+ curwp = self._wp[cursim]
1604
+ if curwp is not None:
1605
+ try:
1606
+ if curwp.Shown:
1607
+ cursim.from_wolfparam(curwp)
1608
+ cursim.save_json()
1609
+ except Exception as e:
1610
+ self._wp[cursim] = None
1611
+ logging.debug(_('Error while saving parameters for simulation {}'.format(cursim.path.name)))
1612
+ logging.debug(str(e))
1568
1613
 
1569
1614
  def OnActivateTreeElem(self, e):
1570
1615
  """
@@ -1707,7 +1752,7 @@ class UI_Manager_2D_GPU():
1707
1752
 
1708
1753
  wp = sim.to_wolfparam()
1709
1754
  self._wp[sim] = wp
1710
- wp.set_callbacks(self._callbackwp, self._callbackwp)
1755
+ wp.set_callbacks(self._callbackwp, self._callbackwp_destroy)
1711
1756
  wp._set_gui(title='Parameters for simulation {}'.format(mydata['path'].name), toShow=False)
1712
1757
  wp.hide_selected_buttons()
1713
1758
  wp.Show()
wolfhece/wolf_array.py CHANGED
@@ -6544,7 +6544,7 @@ class WolfArray(Element_To_Draw, header_wolf):
6544
6544
  def read_all(self, which_band = None):
6545
6545
  """ Lecture d'un Wolf aray depuis le nom de fichier """
6546
6546
 
6547
- THRESHOLD = 20_000_000
6547
+ THRESHOLD = 100_000_000
6548
6548
 
6549
6549
  if not os.path.exists(self.filename):
6550
6550
  if self.wx_exists:
@@ -1779,8 +1779,9 @@ class OneWolfResult:
1779
1779
 
1780
1780
  self._current.mypal = curpal
1781
1781
  self._current.mypal.interval_cst = curpal.interval_cst
1782
- if VERSION_RGB==1 : self._current.rgb = curpal.get_rgba(self._current.array)
1783
- self._current.rgb[self._current.array.mask] = [1., 1., 1., 1.]
1782
+ if VERSION_RGB==1 :
1783
+ self._current.rgb = curpal.get_rgba(self._current.array)
1784
+ self._current.rgb[self._current.array.mask] = [1., 1., 1., 1.]
1784
1785
 
1785
1786
  if which == 'wd_u':
1786
1787
  self._view.pals = [bluepal,curpal]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wolfhece
3
- Version: 2.1.30
3
+ Version: 2.1.32
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
@@ -10,7 +10,7 @@ wolfhece/PyDraw.py,sha256=rF_TaicOrLMk122Mflc82kyz0DoJ-ldWgeYrMkjNIOY,390213
10
10
  wolfhece/PyGui.py,sha256=8UWyaYwiHD9juDbPs__pmCXIDoM8r9_bGKLf29xVGZI,103140
11
11
  wolfhece/PyGuiHydrology.py,sha256=r8kcY2eGAQzSwVtLpyMUiBL5xBpMBsi7ovs0PgStGWw,14648
12
12
  wolfhece/PyHydrographs.py,sha256=GKK8U0byI45H9O_e4LAOOi7Aw0Tg7Q0Lx322stPg5IQ,3453
13
- wolfhece/PyPalette.py,sha256=-F3E2dyGNMHCZa3xTd_StNYOQZv9fPGO051Z0TtvEqo,25885
13
+ wolfhece/PyPalette.py,sha256=3NK2bvFNmBTjnghTEKMSVQdNRWW3CATMrIGA1DwaajU,25883
14
14
  wolfhece/PyParams.py,sha256=R3AWcb7Mhixwnw4iONSN4gk1DOXKcJR2lj7jaIml4B8,97085
15
15
  wolfhece/PyPictures.py,sha256=-mJB0JL2YYiEK3D7_ssDkvYiMWK4ve9kXhozQXNeSx8,2216
16
16
  wolfhece/PyTranslate.py,sha256=4appkmNeHHZLFmUtaA_k5_5QL-5ymxnbVN4R2OblmtE,622
@@ -48,13 +48,13 @@ wolfhece/rain_SPWMI.py,sha256=YqsF-yFro3y_a6MfVRFfr-Rxi7NR1gl_i8VX7scmzes,13548
48
48
  wolfhece/test_Results2DGPU.py,sha256=NOJ_hFXrcLSQXS1dtsqXRQltqIZtDSHMz_EgAJ2_FHU,307
49
49
  wolfhece/textpillow.py,sha256=zEfLrKhfCDyMaVuQOUjHqz6MGKeQ4aewMxOsWi5-wKI,13832
50
50
  wolfhece/tools_mpl.py,sha256=q8Yc4aukPPiUcEzREvZRM_em67XqXaahdoaNt0DETfE,266
51
- wolfhece/wolf_array.py,sha256=lgo1SQaiEZe7yF1vUuH1SyKsK6lT2ccT0WM7cGTxhDg,355711
51
+ wolfhece/wolf_array.py,sha256=7TOryanTy1kyO480VJ6zBjaTRXxcUu7c9TeDAKT-76c,355712
52
52
  wolfhece/wolf_hist.py,sha256=JpRXvzJLUP-RkSkvth3DQWglgTMFI2ZEUDb4RYOfeeI,3284
53
53
  wolfhece/wolf_texture.py,sha256=llQ7aV8scWXIkhpri9XjaPejzoBJsGfsln2ZnlRbFkU,16270
54
54
  wolfhece/wolf_tiles.py,sha256=F2JsJHdAP8fIffNJdG_J26bonCIRtIwMmxKFqdSCRDA,10088
55
55
  wolfhece/wolf_vrt.py,sha256=un5CKzAUmzSsjLXK7YLnQEWz8FLoafXJs8oqUvS_-h0,10271
56
56
  wolfhece/wolf_zi_db.py,sha256=Ok0MxQYZMMLRJN1QY-HSplLhUzzb6gkXgBQ3ihhLQHk,12669
57
- wolfhece/wolfresults_2D.py,sha256=wF-wIyqpTrUJX_fT-QCVuNxLZCgUsqK9ptGz8izpyIQ,165590
57
+ wolfhece/wolfresults_2D.py,sha256=fhRRfz6Lb_lkr4YldLuCWS_bboljVfKS90pCI3ZArT0,165608
58
58
  wolfhece/xyz_file.py,sha256=aQOcTHkHRhXHxL_WxTHwzygp6e47San7SHSpxKQU0dw,5457
59
59
  wolfhece/acceptability/Parallels.py,sha256=wpCdwkqR6PAFeRkV5TvSSL33Vf368j-bvYcl7D1Y-sc,3695
60
60
  wolfhece/acceptability/__init__.py,sha256=hfgoPKLDpX7drN1Vpvux-_5Lfyc_7feT2C2zQr5v-Os,258
@@ -72,7 +72,7 @@ wolfhece/apps/check_install.py,sha256=jrKR-njqnpIh6ZJqvP6KbDUPVCfwTNQj4glQhcyzs9
72
72
  wolfhece/apps/curvedigitizer.py,sha256=avWERHuVxPnJBOD_ibczwW_XG4vAenqWS8W1zjhBox8,4898
73
73
  wolfhece/apps/isocurrent.py,sha256=4XnNWPa8mYUK7V4zdDRFrHFIXNG2AN2og3TqWKKcqjY,3811
74
74
  wolfhece/apps/splashscreen.py,sha256=EjEjZGuWV-8ZfHhnFH4XLrrtB-YpzPDVhFzRrjgFUzI,2624
75
- wolfhece/apps/version.py,sha256=DOnhV0acM8wlohylXhs6wwbgGzeJWQwuSC3SgXqFsRg,388
75
+ wolfhece/apps/version.py,sha256=P4inP6CexgdmRIkkT_nMwMYPjOHtwIwHikcTMnJuoTk,388
76
76
  wolfhece/apps/wolf.py,sha256=gqfm-ZaUJqNsfCzmdtemSeqLw-GVdSVix-evg5WArJI,293
77
77
  wolfhece/apps/wolf2D.py,sha256=gWD9ee2-1pw_nUxjgRaJMuSe4kUT-RWhOeoTt_Lh1mM,267
78
78
  wolfhece/apps/wolf_logo.bmp,sha256=ruJ4MA51CpGO_AYUp_dB4SWKHelvhOvd7Q8NrVOjDJk,3126
@@ -257,7 +257,7 @@ wolfhece/report/reporting.py,sha256=LrOUI7j1vPefsGhqag1f2KpKRXR-5cH7SyGIsf6nOG0,
257
257
  wolfhece/report/wolf_report.png,sha256=NoSV58LSwb-oxCcZScRiJno-kxDwRdm_bK-fiMsKJdA,592485
258
258
  wolfhece/scenario/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
259
259
  wolfhece/scenario/check_scenario.py,sha256=nFiCscEGHyz1YvjmZoKlYrfmW03-nLiDTDdRoeE6MUs,4619
260
- wolfhece/scenario/config_manager.py,sha256=r3E7ZyOewoB_0M-ox3rIZ3-cO_JIbE1zD4b87pPXn6c,77957
260
+ wolfhece/scenario/config_manager.py,sha256=OnQPPJwd70-N93gGGVwr16qAQZq1MPvWV2I9KV-lhkc,80113
261
261
  wolfhece/scenario/imposebc_void.py,sha256=pl7c99HQQMQT7i15fDlOOFYCdOtR5c_XIBOveOTOaLc,5273
262
262
  wolfhece/scenario/update_void.py,sha256=MmiDiwWHvuk0mpXOlMeB2ImY-d1Wi3Wfmg9hrDTAraE,7176
263
263
  wolfhece/shaders/fragment_shader_texture.glsl,sha256=w6h8d5mJqFaGbao0LGmjRcFFdcEQ3ICIl9JpuT71K5k,177
@@ -280,8 +280,8 @@ wolfhece/ui/wolf_multiselection_collapsiblepane.py,sha256=yGbU_JsF56jsmms0gh7mxa
280
280
  wolfhece/ui/wolf_times_selection_comparison_models.py,sha256=wCxGRnE3kzEkWlWA6-3X8ADOFux_B0a5QWJ2GnXTgJw,4709
281
281
  wolfhece/wintab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
282
282
  wolfhece/wintab/wintab.py,sha256=8A-JNONV6ujgsgG3lM5Uw-pVgglPATwKs86oBzzljoc,7179
283
- wolfhece-2.1.30.dist-info/METADATA,sha256=3IcGhCz-MaGj4jP2HATNkudS-Ae869L61Ec7nyjt5rE,2356
284
- wolfhece-2.1.30.dist-info/WHEEL,sha256=rWxmBtp7hEUqVLOnTaDOPpR-cZpCDkzhhcBce-Zyd5k,91
285
- wolfhece-2.1.30.dist-info/entry_points.txt,sha256=MAG6NrF64fcxiVNb2g1JPYPGcn9C0HWtqqNurB83oX0,330
286
- wolfhece-2.1.30.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
287
- wolfhece-2.1.30.dist-info/RECORD,,
283
+ wolfhece-2.1.32.dist-info/METADATA,sha256=WC53YHFEL1sGIHLobwvzv65N9zIFDqSRBLKmVHrMdpk,2356
284
+ wolfhece-2.1.32.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
285
+ wolfhece-2.1.32.dist-info/entry_points.txt,sha256=MAG6NrF64fcxiVNb2g1JPYPGcn9C0HWtqqNurB83oX0,330
286
+ wolfhece-2.1.32.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
287
+ wolfhece-2.1.32.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (71.0.4)
2
+ Generator: setuptools (71.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5