wolfhece 2.0.21__py3-none-any.whl → 2.0.22__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
@@ -392,6 +392,7 @@ class WolfMapViewer(wx.Frame):
392
392
  # Help
393
393
  self.helpmenu = wx.Menu()
394
394
  self.helpmenu.Append(wx.ID_ANY, _('Shortcuts'), _('Shortcuts'))
395
+ self.helpmenu.Append(wx.ID_ANY, _('About'), _('About'))
395
396
 
396
397
  self.menubar.Append(self.helpmenu, _('&Help'))
397
398
 
@@ -760,7 +761,7 @@ class WolfMapViewer(wx.Frame):
760
761
 
761
762
  if 'domain' in ret_dict:
762
763
  if len(ret_dict['domain']) == 1:
763
- domain = self.get_object(draw_type.ARRAYS, ret_dict['domain'][0])
764
+ domain = self.getobj_from_id(ret_dict['domain'][0])
764
765
  self.active_particle_system.set_domain(domain)
765
766
  if 'u' in ret_dict and 'v' in ret_dict:
766
767
  if len(ret_dict['u']) >0:
@@ -768,8 +769,8 @@ class WolfMapViewer(wx.Frame):
768
769
 
769
770
  time = 0.
770
771
  for u,v in zip(ret_dict['u'], ret_dict['v']):
771
- u = self.get_object(draw_type.ARRAYS, u)
772
- v = self.get_object(draw_type.ARRAYS, v)
772
+ u = self.getobj_from_id(u)
773
+ v = self.getobj_from_id(v)
773
774
  u:WolfArray
774
775
  v:WolfArray
775
776
  assert u.array.shape == v.array.shape, _('Please select arrays with the same shape')
@@ -782,7 +783,7 @@ class WolfMapViewer(wx.Frame):
782
783
 
783
784
  if 'emitters' in ret_dict:
784
785
  if len(ret_dict['emitters'])>0:
785
- emitters = [self.get_object(draw_type.VECTORS, cur) for cur in ret_dict['emitters']]
786
+ emitters = [self.getobj_from_id(cur) for cur in ret_dict['emitters']]
786
787
  self.active_particle_system.set_emitters(emitters)
787
788
 
788
789
  if self.active_particle_system._ui is not None:
@@ -3027,6 +3028,10 @@ class WolfMapViewer(wx.Frame):
3027
3028
  # show shortcuts in log
3028
3029
  self.print_shortcuts(True)
3029
3030
 
3031
+ elif itemlabel == _('About'):
3032
+ #print About Frame
3033
+ self.print_About()
3034
+
3030
3035
  elif itemlabel == _("Plot active vector..."):
3031
3036
 
3032
3037
 
@@ -3215,6 +3220,18 @@ class WolfMapViewer(wx.Frame):
3215
3220
  logging.warning(_("Bad value -- Rety"))
3216
3221
  return
3217
3222
 
3223
+ dlg = wx.TextEntryDialog(None,_("Density grain [-] ?"), value = str(self.active_res2d.sediment_density))
3224
+ ret = dlg.ShowModal()
3225
+ if ret == wx.ID_CANCEL:
3226
+ dlg.Destroy()
3227
+ return
3228
+ try:
3229
+ density = float(dlg.GetValue())
3230
+ except:
3231
+ dlg.Destroy()
3232
+ logging.warning(_("Bad value -- Rety"))
3233
+ return
3234
+
3218
3235
  if len(self.myres2D)>1:
3219
3236
 
3220
3237
  dlg = wx.MessageDialog(None, _('Apply to all results?'), style=wx.YES_NO)
@@ -3222,6 +3239,7 @@ class WolfMapViewer(wx.Frame):
3222
3239
  if ret == wx.ID_NO:
3223
3240
  if diamsize is not None:
3224
3241
  self.active_res2d.sediment_diameter = diamsize
3242
+ self.active_res2d.sediment_density = density
3225
3243
  self.active_res2d.load_default_colormap('shields_cst')
3226
3244
  self.active_res2d.set_currentview(method, True)
3227
3245
  else:
@@ -3229,12 +3247,14 @@ class WolfMapViewer(wx.Frame):
3229
3247
  curarray:Wolfresults_2D
3230
3248
  if diamsize is not None:
3231
3249
  curarray.sediment_diameter = diamsize
3250
+ curarray.sediment_density = density
3232
3251
  curarray.load_default_colormap('shields_cst')
3233
3252
  curarray.set_currentview(method)
3234
3253
 
3235
3254
  else:
3236
3255
  if diamsize is not None:
3237
3256
  self.active_res2d.sediment_diameter = diamsize
3257
+ self.active_res2d.sediment_density = density
3238
3258
  self.active_res2d.load_default_colormap('shields_cst')
3239
3259
  self.active_res2d.set_currentview(method, True)
3240
3260
 
@@ -4457,7 +4477,7 @@ class WolfMapViewer(wx.Frame):
4457
4477
 
4458
4478
  if file.ShowModal() == wx.ID_CANCEL:
4459
4479
  file.Destroy()
4460
- return
4480
+ return -1
4461
4481
  else:
4462
4482
  # récuparétaion du nom de fichier avec chemin d'accès
4463
4483
  filename = file.GetPath()
@@ -4470,7 +4490,7 @@ class WolfMapViewer(wx.Frame):
4470
4490
  if filename != '':
4471
4491
  if (not (os.path.exists(filename))):
4472
4492
  logging.warning("Warning : the following file is not present here : " + filename)
4473
- return
4493
+ return -1
4474
4494
 
4475
4495
  if which.lower() == 'array' or which.lower() == 'array_crop':
4476
4496
  curdict = self.myarrays
@@ -4525,7 +4545,7 @@ class WolfMapViewer(wx.Frame):
4525
4545
 
4526
4546
  logging.info(_('End of importing arrays from npz file'))
4527
4547
  del wait
4528
- return
4548
+ return -1
4529
4549
  else:
4530
4550
  testobj = WolfArray()
4531
4551
  testobj.filename = filename
@@ -4563,7 +4583,7 @@ class WolfMapViewer(wx.Frame):
4563
4583
  ret = dlg_pos.ShowModal()
4564
4584
  if ret == wx.ID_CANCEL:
4565
4585
  newcrop.Destroy()
4566
- return
4586
+ return -1
4567
4587
  else:
4568
4588
  cropini = [[float(dlg_pos.ox.Value), float(dlg_pos.ex.Value)],
4569
4589
  [float(dlg_pos.oy.Value), float(dlg_pos.ey.Value)]]
@@ -4623,7 +4643,7 @@ class WolfMapViewer(wx.Frame):
4623
4643
  file = wx.DirDialog(self, "Choose directory containing data")
4624
4644
  if file.ShowModal() == wx.ID_CANCEL:
4625
4645
  file.Destroy()
4626
- return
4646
+ return -1
4627
4647
  else:
4628
4648
  # récuparétaion du nom de fichier avec chemin d'accès
4629
4649
  dirname = file.GetPath()
@@ -4633,7 +4653,7 @@ class WolfMapViewer(wx.Frame):
4633
4653
  file = wx.DirDialog(self, "Choose directory containing comparison data")
4634
4654
  if file.ShowModal() == wx.ID_CANCEL:
4635
4655
  file.Destroy()
4636
- return
4656
+ return -1
4637
4657
  else:
4638
4658
  # récuparétaion du nom de fichier avec chemin d'accès
4639
4659
  dirname_comp = file.GetPath()
@@ -4671,7 +4691,7 @@ class WolfMapViewer(wx.Frame):
4671
4691
  ret = newcrop.ShowModal()
4672
4692
  if ret == wx.ID_CANCEL:
4673
4693
  newcrop.Destroy()
4674
- return
4694
+ return -1
4675
4695
  else:
4676
4696
  cropini = [[float(newcrop.ox.Value), float(newcrop.ex.Value)],
4677
4697
  [float(newcrop.oy.Value), float(newcrop.ey.Value)]]
@@ -4705,7 +4725,7 @@ class WolfMapViewer(wx.Frame):
4705
4725
  myhead.nby = int(np.max(myxyz[:, 1]) - myhead.origy) + 1
4706
4726
 
4707
4727
  if len(myxyz) == 0:
4708
- return
4728
+ return -1
4709
4729
 
4710
4730
  newobj = WolfArray()
4711
4731
 
@@ -4740,7 +4760,7 @@ class WolfMapViewer(wx.Frame):
4740
4760
  ret = newcrop.ShowModal()
4741
4761
  if ret == wx.ID_CANCEL:
4742
4762
  newcrop.Destroy()
4743
- return
4763
+ return -1
4744
4764
  else:
4745
4765
  cropini = [[float(newcrop.ox.Value), float(newcrop.ex.Value)],
4746
4766
  [float(newcrop.oy.Value), float(newcrop.ey.Value)]]
@@ -4753,7 +4773,7 @@ class WolfMapViewer(wx.Frame):
4753
4773
 
4754
4774
  if which.lower() == 'array_lidar_first':
4755
4775
  if len(first) == 0:
4756
- return
4776
+ return -1
4757
4777
 
4758
4778
  newobj = Lidar2002.create_wolfarray(first, bounds=cropini)
4759
4779
 
@@ -4769,7 +4789,7 @@ class WolfMapViewer(wx.Frame):
4769
4789
  id = 'lidar2002_firstecho'
4770
4790
  else:
4771
4791
  if len(sec) == 0:
4772
- return
4792
+ return -1
4773
4793
  newobj = Lidar2002.create_wolfarray(sec, bounds=cropini)
4774
4794
  if min(tmpdx, tmpdy) != 1.:
4775
4795
  newobj.rebin(min(tmpdx, tmpdy))
@@ -4995,6 +5015,8 @@ class WolfMapViewer(wx.Frame):
4995
5015
  if self.active_cs is None:
4996
5016
  self.active_cs = self.get_cross_sections()
4997
5017
 
5018
+ return 0
5019
+
4998
5020
  def get_obj_from_treeitem(self, treeitem):
4999
5021
  """ Find the object associated with treeitem """
5000
5022
  return self.treelist.GetItemData(treeitem)
@@ -5164,14 +5186,6 @@ class WolfMapViewer(wx.Frame):
5164
5186
  id = self.treelist.GetItemText(self.selected_treeitem).lower()
5165
5187
 
5166
5188
  self.removeobj_from_id(id)
5167
- # myobj = self.getobj_from_id(id)
5168
-
5169
- # if myobj is not None:
5170
- # self.treelist.DeleteItem(self.selected_treeitem)
5171
-
5172
- # for curlist in self.all_lists:
5173
- # if myobj in curlist:
5174
- # curlist.pop(curlist.index(myobj))
5175
5189
 
5176
5190
  def removeobj_from_id(self, id:str):
5177
5191
 
@@ -6465,6 +6479,15 @@ class WolfMapViewer(wx.Frame):
6465
6479
  self.Refresh()
6466
6480
  self.mimicme()
6467
6481
 
6482
+ def print_About(self):
6483
+ """ Print the About window """
6484
+ from .apps.version import WolfVersion
6485
+
6486
+ version = WolfVersion()
6487
+ dlg = wx.MessageDialog(None, _('Wolf - Version {}\n\n'.format(str(version))) + _('Developed by : ') + 'HECE ULiège\n' + _('Contact : pierre.archambeau@uliege.be'), _('About'), wx.OK | wx.ICON_INFORMATION)
6488
+ dlg.ShowModal()
6489
+ dlg.Destroy()
6490
+
6468
6491
  def print_shortcuts(self, inframe:bool = None):
6469
6492
  """ Print the list of shortcuts into logging """
6470
6493
 
wolfhece/PyGui.py CHANGED
@@ -1,22 +1,16 @@
1
1
  from os import scandir, getcwd, makedirs
2
- import os.path
2
+ from os.path import exists, join, isdir, isfile, dirname, normpath, splitext
3
3
  from pathlib import Path
4
4
  import numpy.ma as ma
5
5
  import wx
6
6
  from wx.lib.busy import BusyInfo
7
+ import logging
8
+ from pathlib import Path
7
9
 
8
10
  from .apps.splashscreen import WolfLauncher
9
11
  from .wolf_array import WOLF_ARRAY_FULL_LOGICAL, WOLF_ARRAY_MB_SINGLE, WolfArray,getkeyblock, WolfArray_Sim2D
10
12
  from .PyTranslate import _
11
13
  from .PyDraw import WolfMapViewer,imagetexture
12
- from .PyParams import Wolf_Param
13
- from .PyVertexvectors import Grid
14
- from .RatingCurve import SPWMIGaugingStations,SPWDCENNGaugingStations
15
- from .PyGuiHydrology import GuiHydrology
16
- from .Results2DGPU import wolfres2DGPU
17
- from .hydrology.Catchment import Catchment
18
- from .hydrology.forcedexchanges import forced_exchanges
19
- from .mesh2d.wolf2dprev import *
20
14
 
21
15
  try:
22
16
  from .hydrometry_hece.kiwis_hece import hydrometry_hece as hydrometry
@@ -27,6 +21,15 @@ except:
27
21
  from .PyConfig import WolfConfiguration, ConfigurationKeys
28
22
  from .pylogging import create_wxlogwindow
29
23
 
24
+ from .RatingCurve import SPWMIGaugingStations,SPWDCENNGaugingStations
25
+ from .mesh2d.wolf2dprev import *
26
+ from .Results2DGPU import wolfres2DGPU
27
+ from .PyGuiHydrology import GuiHydrology
28
+ from .RatingCurve import SPWMIGaugingStations,SPWDCENNGaugingStations
29
+ from .hydrology.Catchment import Catchment
30
+ from .hydrology.forcedexchanges import forced_exchanges
31
+ from .PyParams import Wolf_Param
32
+
30
33
  # FIXME : Is it necessary to override wx.Frame ? WolfMapManager is a wx.Frame.
31
34
  # Is it sufficient to run a wx.App ?
32
35
  class GenMapManager(wx.Frame):
@@ -143,7 +146,7 @@ class MapManager(GenMapManager):
143
146
 
144
147
  self.setup_mapviewer(title = 'Wolf - main data manager', wolfparent=self)
145
148
 
146
- dir_hydro = path.join(getcwd(),'data\\hydrometry')
149
+ dir_hydro = join(getcwd(),'data\\hydrometry')
147
150
  if not exists(dir_hydro):
148
151
  makedirs(dir_hydro, exist_ok=True)
149
152
 
@@ -171,11 +174,11 @@ class GPU2DModel(GenMapManager):
171
174
  return
172
175
  self.mydir =idir.GetPath()
173
176
  else:
174
- self.mydir=path.normpath(dir)
177
+ self.mydir=normpath(dir)
175
178
 
176
179
  ext=['.top','.frott','.cls_pos','.cls_Z','.hbin','.zbin','.srcq']
177
180
  for myext in ext:
178
- if path.exists(self.mydir+'//simul'+myext):
181
+ if exists(self.mydir+'//simul'+myext):
179
182
 
180
183
  self.mapviewer.add_object(which='array',
181
184
  filename=self.mydir+'//simul'+myext,
@@ -240,10 +243,10 @@ class HydrologyModel(GenMapManager):
240
243
  return
241
244
  self.mydir =idir.GetPath()
242
245
  else:
243
- self.mydir=path.normpath(dir)
246
+ self.mydir=normpath(dir)
244
247
 
245
- self.mydircharact=path.join(self.mydir,'Characteristic_maps\\Drainage_basin')
246
- self.mydirwhole=path.join(self.mydir,'Whole_basin\\')
248
+ self.mydircharact=join(self.mydir,'Characteristic_maps\\Drainage_basin')
249
+ self.mydirwhole=join(self.mydir,'Whole_basin\\')
247
250
 
248
251
  self.mycatchment = Catchment('Mysim',self.mydir,False,True)
249
252
  self.myexchanges = forced_exchanges(self.mydir)
@@ -291,7 +294,7 @@ class HydrologyModel(GenMapManager):
291
294
  for curfile in self.files_hydrology_vectors['Whole_basin']:
292
295
  curext=curfile[0]
293
296
  curidx=curfile[1]
294
- if path.exists(self.mydirwhole+curext):
297
+ if exists(self.mydirwhole+curext):
295
298
  self.mapviewer.add_object(which='vector',filename=self.mydirwhole+curext,id=curidx,ToCheck=False)
296
299
 
297
300
  self.mapviewer.add_object(which='vector',newobj=self.myexchanges.mysegs,id='Forced exchanges',ToCheck=False)
@@ -372,7 +375,7 @@ class Wolf2DModel(GenMapManager):
372
375
  @base_file Directroy where the model should reside.
373
376
  @myparam The parameters to build the model with.
374
377
  """
375
- assert os.path.isdir(Path(base_file).parent), \
378
+ assert isdir(Path(base_file).parent), \
376
379
  f"When creating from parameters you must give a path containing the generic final name, prepended by a an existing directory (you gave a directory: {base_file} which doesn't exist)"
377
380
 
378
381
  self.mydir = Path(base_file).parent.as_posix()
@@ -518,8 +521,7 @@ class Wolf2DModel(GenMapManager):
518
521
  if dir != '':
519
522
  # Either a directory or a file "/_/_/_/dir/simul" for example.
520
523
 
521
- assert os.path.exists(dir) or os.path.dirname(dir), f"'{dir}' does nto exists"
522
- #assert os.path.isdir(dir), f"'{dir}' is not a directory"
524
+ assert exists(dir) or dirname(dir), f"'{dir}' does nto exists"
523
525
 
524
526
  if dir=='':
525
527
  if self.wx_exists:
@@ -535,14 +537,14 @@ class Wolf2DModel(GenMapManager):
535
537
 
536
538
  self.mydir =idir.GetPath()
537
539
  else:
538
- self.mydir=path.normpath(dir)
540
+ self.mydir=normpath(dir)
539
541
 
540
542
  if self.wx_exists:
541
543
  wait_dlg, wait_cursor = BusyInfo(_('Opening 2D model')), wx.BusyCursor()
542
544
  self.setup_mapviewer(title='2D model : '+self.mydir, wolfparent=self)
543
545
 
544
546
  try:
545
- if os.path.exists(self.mydir) and os.path.isfile(self.mydir): # Either a file or doesn't exist
547
+ if exists(self.mydir) and isfile(self.mydir): # Either a file or doesn't exist
546
548
  assert not Path(self.mydir).suffix, \
547
549
  "A generic file path should have no extension," \
548
550
  f" we have {self.mydir}"
@@ -554,8 +556,8 @@ class Wolf2DModel(GenMapManager):
554
556
  # or a path to the generic file. Morevoer the
555
557
  # MNAP code confuses the generic name and the
556
558
  # .MNAP name when checking if it can load an array.
557
- if not os.path.exists(self.mydir):
558
- self.mydir = os.path.dirname(self.mydir)
559
+ if not exists(self.mydir):
560
+ self.mydir = dirname(self.mydir)
559
561
 
560
562
  self.filenamegen=""
561
563
  second_choice = None
@@ -563,9 +565,9 @@ class Wolf2DModel(GenMapManager):
563
565
  scandir_obj = scandir(self.mydir)
564
566
  for curfile in scandir_obj:
565
567
  if curfile.is_file():
566
- ext=path.splitext(curfile)
568
+ ext=splitext(curfile)
567
569
  if len(ext[1])==0:
568
- self.filenamegen = path.join(self.mydir,curfile.name)
570
+ self.filenamegen = join(self.mydir,curfile.name)
569
571
  break
570
572
  elif ext[1] == ".sux":
571
573
  # Some extension present, we choose .sux because
@@ -1,14 +1,15 @@
1
1
  import wx
2
2
 
3
- try:
4
- from ..PyTranslate import _
5
- from ..PyParams import Wolf_Param
6
- except:
7
- from wolfhece.PyTranslate import _
8
- from wolfhece.PyParams import Wolf_Param
3
+ from ..PyTranslate import _
9
4
 
10
5
  def main():
11
6
  ex = wx.App()
7
+
8
+ from .splashscreen import WolfLauncher
9
+ first_launch = WolfLauncher(play_sound=False)
10
+
11
+ from ..PyParams import Wolf_Param
12
+
12
13
  frame = Wolf_Param(None,"Params")
13
14
  ex.MainLoop()
14
15
 
@@ -1,14 +1,15 @@
1
1
  import wx
2
2
 
3
- try:
4
- from ..PyTranslate import _
5
- from ..hydrology.Optimisation import Optimisation
6
- except:
7
- from wolfhece.PyTranslate import _
8
- from wolfhece.hydrology.Optimisation import Optimisation
3
+ from ..PyTranslate import _
9
4
 
10
5
  def main():
11
6
  app = wx.App()
7
+
8
+ from .splashscreen import WolfLauncher
9
+ first_launch = WolfLauncher(play_sound=False)
10
+
11
+ from ..hydrology.Optimisation import Optimisation
12
+
12
13
  myOpti = Optimisation()
13
14
  myOpti.Show()
14
15
  app.MainLoop()
@@ -16,4 +17,3 @@ def main():
16
17
 
17
18
  if __name__=='__main__':
18
19
  main()
19
-
@@ -0,0 +1,20 @@
1
+
2
+ def main():
3
+ # Check if installation is complete
4
+ ret = 'Checking installation\n---------------------\n\n'
5
+ try:
6
+ from osgeo import ogr, gdal
7
+ ret += 'GDAL/OGR installed\n\n'
8
+ except:
9
+ ret += 'GDAL/OGR not installed\n Please install GDAL from https://github.com/cgohlke/geospatial-wheels/releases\n\n'
10
+
11
+ try:
12
+ from ..PyGui import MapManager
13
+ ret += 'Wolfhece installed\n\n'
14
+ except:
15
+ ret += 'Wolfhece not installed\n Retry installation : pip install wolfhece or pip install wolfhece --upgrade\n\n'
16
+
17
+ print(ret)
18
+
19
+ if __name__=='__main__':
20
+ main()
@@ -1,7 +1,4 @@
1
- try:
2
- from ..PyTranslate import _
3
- except:
4
- from wolfhece.PyTranslate import _
1
+ from ..PyTranslate import _
5
2
 
6
3
  import wx
7
4
  import numpy as np
@@ -1,7 +1,5 @@
1
- try:
2
- from ..PyTranslate import _
3
- except:
4
- from wolfhece.PyTranslate import _
1
+
2
+ from ..PyTranslate import _
5
3
 
6
4
 
7
5
  import numpy as np
@@ -0,0 +1,20 @@
1
+
2
+ class WolfVersion():
3
+
4
+ def __init__(self):
5
+
6
+ self.major = 2
7
+ self.minor = 0
8
+ self.patch = 22
9
+
10
+ def __str__(self):
11
+
12
+ return self.get_version()
13
+
14
+ def get_version(self):
15
+
16
+ return f'{self.major}.{self.minor}.{self.patch}'
17
+
18
+ def print_version(self):
19
+
20
+ print(f'WolfHece version {self.major}.{self.minor}.{self.patch}')
wolfhece/apps/wolf.py CHANGED
@@ -1,17 +1,14 @@
1
1
  import wx
2
-
3
2
  from ..PyTranslate import _
4
- from ..PyGui import MapManager
5
-
6
- # try:
7
- # from ..PyTranslate import _
8
- # from ..PyGui import MapManager
9
- # except:
10
- # from wolfhece.PyTranslate import _
11
- # from wolfhece.PyGui import MapManager
12
3
 
13
4
  def main():
14
5
  ex = wx.App()
6
+
7
+ from .splashscreen import WolfLauncher
8
+ first_launch = WolfLauncher(play_sound=False)
9
+
10
+ from ..PyGui import MapManager
11
+
15
12
  mywolf=MapManager()
16
13
  ex.MainLoop()
17
14
 
wolfhece/apps/wolf2D.py CHANGED
@@ -1,11 +1,15 @@
1
1
  import wx
2
- from wolfhece.PyGui import Wolf2DModel
3
2
 
4
3
  def main():
5
4
  ex = wx.App()
5
+
6
+ from .splashscreen import WolfLauncher
7
+ first_launch = WolfLauncher(play_sound=False)
8
+
9
+ from ..PyGui import Wolf2DModel
10
+
6
11
  mydro=Wolf2DModel()
7
12
  ex.MainLoop()
8
13
 
9
14
  if __name__=='__main__':
10
15
  main()
11
-
@@ -6,14 +6,9 @@ from pathlib import Path
6
6
  from typing import Union
7
7
 
8
8
  #Import des modules WOLF
9
- try:
10
- from ..PyTranslate import _
11
- from ..PyDraw import WolfMapViewer
12
- from ..wolf_array import WolfArray
13
- except:
14
- from wolfhece.PyTranslate import _
15
- from wolfhece.PyDraw import WolfMapViewer
16
- from wolfhece.wolf_array import WolfArray
9
+ from ..PyTranslate import _
10
+ from ..PyDraw import WolfMapViewer
11
+ from ..wolf_array import WolfArray
17
12
 
18
13
  def main(mydir:Path=None, ListArrays:list[WolfArray]=None):
19
14
  """
@@ -1,14 +1,15 @@
1
- import os
2
1
  import wx
3
- try:
4
- from ..PyTranslate import _
5
- from ..PyGui import HydrologyModel
6
- except:
7
- from wolfhece.PyTranslate import _
8
- from wolfhece.PyGui import HydrologyModel
2
+
3
+ from ..PyTranslate import _
9
4
 
10
5
  def main(strmydir=''):
11
6
  ex = wx.App()
7
+
8
+ from .splashscreen import WolfLauncher
9
+ first_launch = WolfLauncher(play_sound=False)
10
+
11
+ from ..PyGui import HydrologyModel
12
+
12
13
  exLocale = wx.Locale()
13
14
  exLocale.Init(wx.LANGUAGE_ENGLISH)
14
15
  mydro=HydrologyModel()
wolfhece/cli.py CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ def check():
3
+ """ Main wolf application : Check """
4
+ from .apps.check_install import main
5
+ main()
6
+
2
7
  def wolf():
3
8
  """ Main wolf application : Map Manager"""
4
9
  from .apps.wolf import main
@@ -44,7 +49,7 @@ def compare():
44
49
  # arguments
45
50
  print("Total arguments passed:", n)
46
51
  assert n in [2,3], _('Usage : wolfcompare <directory> or wolfcompare <file1> <file2>')
47
-
52
+
48
53
  if n==2:
49
54
  mydir = Path(sys.argv[1])
50
55
  if mydir.exists():
wolfhece/libs/WolfDll.dll CHANGED
Binary file
wolfhece/pyshields.py CHANGED
@@ -503,24 +503,49 @@ def shieldsdia_dim(figax=None) -> tuple[plt.Figure,plt.Axes]:
503
503
 
504
504
  return fig,ax
505
505
 
506
- def get_Shields_2D_Manning(s:float, d:float, q:float, h:float, K:float) -> float:
506
+ def get_Shields_2D_Manning(s:float, d:float, q:float, h:float, n:float) -> float:
507
507
  """
508
- Compute Shields dimensionless parameter for 2D flow with Manning friction law
508
+ Compute Shields dimensionless parameter for 2D flow with Manning/Strickler friction law
509
509
 
510
510
  :param s : sediment density / water density [-]
511
511
  :param d : sediment diameter [m]
512
512
  :param q : discharge [m3/s]
513
513
  :param h : water depth [m]
514
- :param K : Strickler friction coefficient [m1/3/s]
514
+ :param n : Manning friction coefficient [m-1/3.s]
515
+
516
+ See also get_Shields_2D_Strickler
515
517
  """
516
518
  # calcul de terme de pente de frottement
517
519
 
518
- j = (q/h)**2.0 / K**2. / h**(4./3.)
520
+ # j = (q/h)**2.0 / K**2. / h**(4./3.)
521
+ denom = h**(4./3.)
522
+ if denom > 0.:
523
+ j = (q/h * n)**2.0 / denom
524
+ else:
525
+ j = 0.
519
526
 
520
527
  shields = j*h / (d*(s-1))
521
528
 
522
529
  return shields
523
530
 
531
+ def get_Shields_2D_Strickler(s:float, d:float, q:float, h:float, K:float) -> float:
532
+ """
533
+ Compute Shields dimensionless parameter for 2D flow with Manning/Strickler friction law
534
+
535
+ :param s : sediment density / water density [-]
536
+ :param d : sediment diameter [m]
537
+ :param q : discharge [m3/s]
538
+ :param h : water depth [m]
539
+ :param K : Strickler friction coefficient [m1/3/s]
540
+
541
+ See also get_Shields_2D_Manning
542
+ """
543
+ # calcul de terme de pente de frottement
544
+
545
+ n = 1./K
546
+ return get_Shields_2D_Manning(s, d, q, h, n)
547
+
548
+
524
549
  def izbach_d_cr(q:float, h:float, rhom:float=2650, rho:float=RHO_PUREWATER, method='ridder') -> float:
525
550
  """
526
551
  https://en.wikipedia.org/wiki/Izbash_formula
@@ -1374,7 +1374,7 @@ class OneWolfResult:
1374
1374
  self._min_field_size = .1
1375
1375
 
1376
1376
  self._sedimentdiam = 1e-3
1377
- self._sedimentdensity = 2.5
1377
+ self._sedimentdensity = 2.65
1378
1378
  self._force_update_shields = True # Force la MAJ du Shields si le diametre ou la densité change
1379
1379
 
1380
1380
  @property
@@ -1735,7 +1735,7 @@ class OneWolfResult:
1735
1735
  self.sediment_diameter,
1736
1736
  qnorm.array[i,j],
1737
1737
  self.waterdepth.array[i,j],
1738
- 1./self.rough_n.array[i,j]) for i,j in ij])
1738
+ self.rough_n.array.data[i,j]) for i,j in ij])
1739
1739
 
1740
1740
  shields.array[ij[:,0],ij[:,1]] = _shields
1741
1741
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wolfhece
3
- Version: 2.0.21
3
+ Version: 2.0.22
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,8 +5,8 @@ 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=f4EYYTAJQ2v5m_7sBkD0LWZYL3XW-XryrQJn6RKvyGI,319917
9
- wolfhece/PyGui.py,sha256=mzJCRjMHtebFrxmPnwUK6YpQgMf5iiiCTm0hCOuRsOY,52722
8
+ wolfhece/PyDraw.py,sha256=JR4Y9Jzd8JZbT6sd7pwMMd0YNLdtRsQCOYy8FkCrUi0,320904
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
12
12
  wolfhece/PyPalette.py,sha256=nb9oPLZF-xx-yvOWvw2XVVmis6XTmYT2i7hvH3qPwAg,21932
@@ -23,7 +23,7 @@ wolfhece/ReadDataDCENN.py,sha256=4OMDBgkZ_v7OWmVhyQ-reab7MPxGhFEDY2qS8yThhdM,124
23
23
  wolfhece/Results2DGPU.py,sha256=IyBOwA_S72rABMARCJp3xLSv9s8lQgDjWHsvCYwqohM,16579
24
24
  wolfhece/__init__.py,sha256=FRDE8PiJAWxX9PMXsShRMZ8YADAY4WIgKMRh52rmhiw,23
25
25
  wolfhece/_add_path.py,sha256=nudniS-lsgHwXXq5o626XRDzIeYj76GoGKYt6lcu2Nc,616
26
- wolfhece/cli.py,sha256=Xj0yfgs7MnvNCk5Td_Qp_oz4DMI66eBHu2bkVrGW3OU,1828
26
+ wolfhece/cli.py,sha256=rHxZGgs_R776VCWhs36pYFoiuiQycwgGTVOLK-JNzjE,1937
27
27
  wolfhece/color_constants.py,sha256=Snc5RX11Ydi756EkBp_83C7DiAQ_Z1aHD9jFIBsosAU,37121
28
28
  wolfhece/drawing_obj.py,sha256=rHMGdiihIv68WZnWFNdgiA51QhSm8EX-pykdyTSOdoo,3136
29
29
  wolfhece/flow_SPWMI.py,sha256=mdiupyOem6_FZ0OSKn8Vq5Nmr9Av-j83d2YyRPLZFlQ,20658
@@ -38,7 +38,7 @@ wolfhece/pybridges.py,sha256=BVUESKoTdL1i_rdoe_jEsItgjKS0oqLohwrHj8snjxQ,57190
38
38
  wolfhece/pydike.py,sha256=G4jfSZaAHHr4VWEJqnXSvEswXvlOz1yhbhQ6uu3AqyM,1943
39
39
  wolfhece/pylogging.py,sha256=i9Zugx3t9dPc7nBwcP20L_R4_k_WawpAQsvbZU8l9Hg,4230
40
40
  wolfhece/pypolygons_scen.py,sha256=lrUty990vT1iiILiIuTY8pNStiaZOi2dXWJuL9C-4Ps,26211
41
- wolfhece/pyshields.py,sha256=LlFxcCkWywbsf2_6AaMU0Vgbm5h92AKqb4NyYT6kBYE,22219
41
+ wolfhece/pyshields.py,sha256=YS6VVjjzoA-ZR6YRccqjMcW3McNqNLoQODC6TNNkmPw,22983
42
42
  wolfhece/pyviews.py,sha256=hYdyrEvWF48dGBDOLIwmC28C0L8I28U4ohXk9nltF94,9666
43
43
  wolfhece/pywalous.py,sha256=jwp251AzGBc0VmMzOqA0IJiRRa6yQIfccRM8lVGszIY,4474
44
44
  wolfhece/rain_SPWMI.py,sha256=YqsF-yFro3y_a6MfVRFfr-Rxi7NR1gl_i8VX7scmzes,13548
@@ -49,19 +49,21 @@ wolfhece/wolf_hist.py,sha256=JpRXvzJLUP-RkSkvth3DQWglgTMFI2ZEUDb4RYOfeeI,3284
49
49
  wolfhece/wolf_texture.py,sha256=quflEvi32lWSvOPa0aDCDl-8Jv-jGtLHbR2rdx67LsI,14883
50
50
  wolfhece/wolf_tiles.py,sha256=F2JsJHdAP8fIffNJdG_J26bonCIRtIwMmxKFqdSCRDA,10088
51
51
  wolfhece/wolf_vrt.py,sha256=wuMPAXNYTByNGNtvWhwW1fQelPstAPTQZECgXHZ0oTM,5180
52
- wolfhece/wolfresults_2D.py,sha256=83bh4EHZZSFVqmme1UWbj5IK4aUiDzjKRDrY18YfWnk,145711
52
+ wolfhece/wolfresults_2D.py,sha256=gGXTg1nKS3lPd8eYUsyUtMuzTcgNy8GpUBw5pbKUKTA,145714
53
53
  wolfhece/xyz_file.py,sha256=aQOcTHkHRhXHxL_WxTHwzygp6e47San7SHSpxKQU0dw,5457
54
- wolfhece/apps/ManageParams.py,sha256=its7JhceQiwzQVl95wA51GZs1zjtbpUNvbqvdvDTeyM,316
55
- wolfhece/apps/Optimisation_hydro.py,sha256=25H5PVN_Gh3mkDQ6BWbJjBqsGCNdGapZOqKECcOGJIQ,398
54
+ wolfhece/apps/ManageParams.py,sha256=heg5L4fMn0ettR7Bad_Q680o_JWnTbe3WFkL_9IziAk,312
55
+ wolfhece/apps/Optimisation_hydro.py,sha256=mHazBazTUGyxPbHPXhaQim8vqIeOOuKPjH0B48VWduA,374
56
56
  wolfhece/apps/WolfPython.png,sha256=K3dcbeZUiJCFNwOAAlGMaRGLJ56yM8WD2I_0bk0xT1g,104622
57
57
  wolfhece/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
- wolfhece/apps/curvedigitizer.py,sha256=JC2SW4n3-QFrnpmm0Zn0Yqog2SW4wvXfpIXuyd9ZifY,4957
59
- wolfhece/apps/isocurrent.py,sha256=AG29IGdH-MStdg25QbBrMSW_AHOQDEVGLRslOaxWnHM,3868
58
+ wolfhece/apps/check_install.py,sha256=jrKR-njqnpIh6ZJqvP6KbDUPVCfwTNQj4glQhcyzs9o,630
59
+ wolfhece/apps/curvedigitizer.py,sha256=avWERHuVxPnJBOD_ibczwW_XG4vAenqWS8W1zjhBox8,4898
60
+ wolfhece/apps/isocurrent.py,sha256=4XnNWPa8mYUK7V4zdDRFrHFIXNG2AN2og3TqWKKcqjY,3811
60
61
  wolfhece/apps/splashscreen.py,sha256=9BNArfcoRcyWglzFDQdLv2Dlvqz8w5qYKdE5zA66-Kw,2117
61
- wolfhece/apps/wolf.py,sha256=H0wdBA3Akg_3UjmprIoUOgkniMO67PhSk-6iMleiQHg,371
62
- wolfhece/apps/wolf2D.py,sha256=nQ5SbGBJLODmIbqazYR6L0FsXp6K5oIo-hKIxtvqoaA,173
63
- wolfhece/apps/wolfcompare2Darrays.py,sha256=fbwTAfy2X-yuJlwYlDFuwE7Al53InvUZVJIz1mwfR7I,3904
64
- wolfhece/apps/wolfhydro.py,sha256=XO4x_ieXv_VqOwRkF11greH68FTc8rx4IfFkRGBYiJE,402
62
+ wolfhece/apps/version.py,sha256=1jx_QTbyGIcrkyQcMDkU-l3GQnfA1Q4BUAYhgLZWlNA,388
63
+ wolfhece/apps/wolf.py,sha256=gqfm-ZaUJqNsfCzmdtemSeqLw-GVdSVix-evg5WArJI,293
64
+ wolfhece/apps/wolf2D.py,sha256=gWD9ee2-1pw_nUxjgRaJMuSe4kUT-RWhOeoTt_Lh1mM,267
65
+ wolfhece/apps/wolfcompare2Darrays.py,sha256=MucG5h4sU4jicDVCKohiCDUVUqx_RQ1qKrZKokpnxhQ,3743
66
+ wolfhece/apps/wolfhydro.py,sha256=UK_YtyhsozvHQW_TRNccFHUr_bGOwHONMCqNjqoiqpM,381
65
67
  wolfhece/blender/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
66
68
  wolfhece/blender/array2polygons.py,sha256=r7wIAsP2M4qJQqdhIRaLFwyQ8P0b9DeSBorBXG0Lyx8,8559
67
69
  wolfhece/blender/ply.py,sha256=jTRUqRGD_XyGdE865Iv214DE8-m_ZscqlfTJP99lUOE,555
@@ -146,7 +148,7 @@ wolfhece/lazviewer/viewer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
146
148
  wolfhece/lazviewer/viewer/viewer.exe,sha256=pF5nwE8vMWlEzkk-SOekae9zpOsPhTWhZbqaJntumJc,202240
147
149
  wolfhece/lazviewer/viewer/viewer.py,sha256=8_MQCaQOS0Z_oRPiGoRy1lq-aCirReX3hWEBjQID0ig,24665
148
150
  wolfhece/libs/MSVCP140.dll,sha256=2GrBWBI6JFuSdZLIDMAg_qKcjErdwURGbEYloAypx3o,565640
149
- wolfhece/libs/WolfDll.dll,sha256=QAkGhbfYRZVHy8SZfq1Hi42M_4bmDn3x2ATxYNlCPPU,19238400
151
+ wolfhece/libs/WolfDll.dll,sha256=s-Fwboq8EethHHmipZZjdniEQtyqZv6vS-bQRKNTVgs,132915712
150
152
  wolfhece/libs/WolfDll_CD.dll,sha256=kC1svCwD1qSmppsiVfHwDkIvoJO_1l6TG1GfIxgiqQQ,131415040
151
153
  wolfhece/libs/WolfOGL.c,sha256=tBWGfpFFe8gfRjImUUlqdxhcRpQ6ytEWU7Z6PC0v9as,1085242
152
154
  wolfhece/libs/WolfOGL.pyx,sha256=kc1uxbO2wQx0Qoe7BVQnqTJgUWYx_Vtf1wzXMxzf8bI,65911
@@ -244,8 +246,8 @@ wolfhece/sounds/sonsw2.wav,sha256=pFLVt6By0_EPQNt_3KfEZ9a1uSuYTgQSX1I_Zurv9Rc,11
244
246
  wolfhece/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
245
247
  wolfhece/ui/wolf_multiselection_collapsiblepane.py,sha256=yGbU_JsF56jsmms0gh7mxa7tbNQ_SxqhpAZxhm-mTy4,14860
246
248
  wolfhece/ui/wolf_times_selection_comparison_models.py,sha256=G3g_t2tz69jU6mxvZ6XrKdIqcs8jZrN4FmXx9GdCoHU,4509
247
- wolfhece-2.0.21.dist-info/METADATA,sha256=bEiYPFGptkm8DZhgP8F5ojffp1cg-UFURZnsR2Ksudc,2239
248
- wolfhece-2.0.21.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
249
- wolfhece-2.0.21.dist-info/entry_points.txt,sha256=IHhq-i2W9QpyXFHKe2Ld8j1R4hW5DmYqrZsuSsXkdEE,245
250
- wolfhece-2.0.21.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
251
- wolfhece-2.0.21.dist-info/RECORD,,
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,,
@@ -1,6 +1,7 @@
1
1
  [gui_scripts]
2
2
  wolf = wolfhece.cli:wolf
3
3
  wolf2d = wolfhece.cli:wolf2d
4
+ wolfcheck = wolfhece.cli:check
4
5
  wolfcompare = wolfhece.cli:compare
5
6
  wolfdigitizer = wolfhece.cli:digitizer
6
7
  wolfhydro = wolfhece.cli:hydro