wolfhece 2.1.44__py3-none-any.whl → 2.1.45__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
@@ -5520,8 +5520,8 @@ class WolfMapViewer(wx.Frame):
5520
5520
  del wait
5521
5521
 
5522
5522
  def export_shape(self, outdir='', fn = '', myarrays=[], descr=[], mask:WolfArray=None):
5523
- """ Export multiple arrays to shapefile
5524
-
5523
+ """ Export multiple arrays to shapefile
5524
+
5525
5525
  :param outdir: output directory
5526
5526
  :param fn: filename -- .shp will be added if not present
5527
5527
  :param myarrays: list of Wolfarrays to export
@@ -5598,12 +5598,12 @@ class WolfMapViewer(wx.Frame):
5598
5598
 
5599
5599
  def export_geotif(self, outdir='', fn = '', myarrays=[], descr=[]):
5600
5600
  """ Export multiple arrays to geotiff
5601
-
5601
+
5602
5602
  :param outdir: output directory
5603
5603
  :param fn: filename -- .tif will be added if not present
5604
5604
  :param myarrays: list of Wolfarrays to export
5605
- :param descr: list of descriptions -- Bands names
5606
-
5605
+ :param descr: list of descriptions -- Bands names
5606
+
5607
5607
  """
5608
5608
 
5609
5609
  if len(myarrays)==0:
@@ -6832,7 +6832,7 @@ class WolfMapViewer(wx.Frame):
6832
6832
  self.add_object('array', newobj=mb, id=self.selected_object.idx + '_mb')
6833
6833
  else:
6834
6834
  logging.warning(_('Convert to multi-blocks not yet implemented for this type of object'))
6835
-
6835
+
6836
6836
  elif _('Export to Shape file') in text:
6837
6837
 
6838
6838
  if isinstance(self.selected_object, Zones):
@@ -6845,9 +6845,9 @@ class WolfMapViewer(wx.Frame):
6845
6845
  fdlg.Destroy()
6846
6846
 
6847
6847
  elif _('Export active zone to Shape file') in text:
6848
-
6848
+
6849
6849
  if isinstance(self.selected_object, Zones):
6850
-
6850
+
6851
6851
  filterArray = "Shapefile (*.shp)|*.shp"
6852
6852
  fdlg = wx.FileDialog(self, "Choose file name for Vector :" + self.selected_object.idx, wildcard=filterArray,
6853
6853
  style=wx.FD_SAVE)
@@ -7876,7 +7876,7 @@ class WolfMapViewer(wx.Frame):
7876
7876
  if self.action == 'dynamic parallel':
7877
7877
  self.active_zone.parallel_active(self.dynapar_dist)
7878
7878
 
7879
- self.Refresh()
7879
+ self.Paint()
7880
7880
 
7881
7881
  self._last_mouse_pos = (x,y,pos)
7882
7882
  self._update_mytooltip()
wolfhece/PyGui.py CHANGED
@@ -7,38 +7,70 @@ Copyright (c) 2024 University of Liege. All rights reserved.
7
7
  This script and its content are protected by copyright law. Unauthorized
8
8
  copying or distribution of this file, via any medium, is strictly prohibited.
9
9
  """
10
-
11
- from os import scandir, getcwd, makedirs
12
- from os.path import exists, join, isdir, isfile, dirname, normpath, splitext
13
- from pathlib import Path
14
- import numpy.ma as ma
15
- import wx
16
- import wx.adv
17
- from wx.lib.busy import BusyInfo
18
- import logging
19
- from pathlib import Path
20
-
21
- from .apps.splashscreen import WolfLauncher
22
- from .wolf_array import WOLF_ARRAY_FULL_LOGICAL, WOLF_ARRAY_MB_SINGLE, WolfArray, getkeyblock, WOLF_ARRAY_FULL_INTEGER16, WOLF_ARRAY_MB_INTEGER
23
- from .PyTranslate import _
24
- from .PyDraw import WolfMapViewer,imagetexture, draw_type
25
-
26
- from .hydrometry.kiwis_wolfgui import hydrometry_wolfgui
27
-
28
- from .PyConfig import WolfConfiguration, ConfigurationKeys
29
- from .pylogging import create_wxlogwindow
30
-
31
- from .RatingCurve import SPWMIGaugingStations,SPWDCENNGaugingStations
32
- from .mesh2d.wolf2dprev import *
33
- from .Results2DGPU import wolfres2DGPU
34
- from .PyGuiHydrology import GuiHydrology
35
- from .RatingCurve import SPWMIGaugingStations,SPWDCENNGaugingStations
36
- from .hydrology.Catchment import Catchment
37
- from .hydrology.forcedexchanges import forced_exchanges
38
- from .PyParams import Wolf_Param
39
- from .picc import Picc_data, Cadaster_data
40
- from .wolf_zi_db import ZI_Databse_Elt, PlansTerrier
41
- from .CpGrid import CpGrid
10
+ try:
11
+ from os import scandir, getcwd, makedirs
12
+ from os.path import exists, join, isdir, isfile, dirname, normpath, splitext
13
+ from pathlib import Path
14
+ import numpy.ma as ma
15
+ import wx
16
+ import wx.adv
17
+ from wx.lib.busy import BusyInfo
18
+ import logging
19
+ from pathlib import Path
20
+ except ImportError as e:
21
+ print(f"Import Error: {e} - extern modules")
22
+ print("Please install the required modules using 'pip install -r requirements.txt'")
23
+
24
+ try:
25
+ from .apps.splashscreen import WolfLauncher
26
+ except ImportError as e:
27
+ print(f"Import Error: {e} - Splashscreen")
28
+ print("Please install the required modules using 'pip install -r requirements.txt'")
29
+
30
+ try:
31
+ from .wolf_array import WOLF_ARRAY_FULL_LOGICAL, WOLF_ARRAY_MB_SINGLE, WolfArray, getkeyblock, WOLF_ARRAY_FULL_INTEGER16, WOLF_ARRAY_MB_INTEGER
32
+ except ImportError as e:
33
+ print(f"Import Error: {e} - WolfArray")
34
+ print("Please install the required modules using 'pip install -r requirements.txt'")
35
+ try:
36
+ from .PyTranslate import _
37
+ except ImportError as e:
38
+ print(f"Import Error: {e} - PyTranslate")
39
+ print("Please install the required modules using 'pip install -r requirements.txt'")
40
+ try:
41
+ from .PyDraw import WolfMapViewer,imagetexture, draw_type
42
+ except ImportError as e:
43
+ print(f"Import Error: {e} - PyDraw")
44
+ print("Please install the required modules using 'pip install -r requirements.txt'")
45
+
46
+ try:
47
+ from .hydrometry.kiwis_wolfgui import hydrometry_wolfgui
48
+ except ImportError as e:
49
+ print(f"Import Error: {e} - hydrometry_wolfgui")
50
+ print("Please install the required modules using 'pip install -r requirements.txt'")
51
+
52
+ try:
53
+ from .PyConfig import WolfConfiguration, ConfigurationKeys
54
+ from .pylogging import create_wxlogwindow
55
+ except ImportError as e:
56
+ print(f"Import Error: {e} - PyConfig, pylogging")
57
+ print("Please install the required modules using 'pip install -r requirements.txt'")
58
+
59
+ try:
60
+ from .RatingCurve import SPWMIGaugingStations,SPWDCENNGaugingStations
61
+ from .mesh2d.wolf2dprev import *
62
+ from .Results2DGPU import wolfres2DGPU
63
+ from .PyGuiHydrology import GuiHydrology
64
+ from .RatingCurve import SPWMIGaugingStations,SPWDCENNGaugingStations
65
+ from .hydrology.Catchment import Catchment
66
+ from .hydrology.forcedexchanges import forced_exchanges
67
+ from .PyParams import Wolf_Param
68
+ from .picc import Picc_data, Cadaster_data
69
+ from .wolf_zi_db import ZI_Databse_Elt, PlansTerrier
70
+ from .CpGrid import CpGrid
71
+ except ImportError as e:
72
+ print(f"Import Error: {e} - RatingCurve, mesh2d, Results2DGPU, PyGuiHydrology, RatingCurve, hydrology, PyParams, picc, wolf_zi_db, CpGrid")
73
+ print("Please install the required modules using 'pip install -r requirements.txt'")
42
74
 
43
75
 
44
76
  GEOM_GROUP_NAME = _('Block geometry')
@@ -15,14 +15,23 @@ def main():
15
15
  try:
16
16
  from osgeo import ogr, gdal
17
17
  ret += 'GDAL/OGR installed\n\n'
18
- except:
18
+ except ImportError as e:
19
19
  ret += 'GDAL/OGR not installed\n Please install GDAL from https://github.com/cgohlke/geospatial-wheels/releases\n\n'
20
+ ret += 'Error : ' + str(e) + '\n\n'
20
21
 
22
+ try:
23
+ from ..libs import wolfpy
24
+ ret += 'Wolfpy accessible\n\n'
25
+ except ImportError as e:
26
+ ret += 'Wolfpy not accessible\n\n'
27
+ ret += 'Error : ' + str(e) + '\n\n'
28
+
21
29
  try:
22
30
  from ..PyGui import MapManager
23
31
  ret += 'Wolfhece installed\n\n'
24
- except:
25
- ret += 'Wolfhece not installed\n Retry installation : pip install wolfhece or pip install wolfhece --upgrade\n\n'
32
+ except ImportError as e:
33
+ ret += 'Wolfhece not installed properly\n Retry installation : pip install wolfhece or pip install wolfhece --upgrade\n\n'
34
+ ret += 'Error : ' + str(e) + '\n\n'
26
35
 
27
36
  print(ret)
28
37
 
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 = 44
8
+ self.patch = 45
9
9
 
10
10
  def __str__(self):
11
11
 
@@ -0,0 +1,79 @@
1
+ from pathlib import Path
2
+ import sys
3
+ import os
4
+ import shutil
5
+
6
+ MKL_DLLS = ['libiomp5md.dll',
7
+ 'mkl_core.2.dll',
8
+ 'mkl_intel_thread.2.dll',
9
+ 'mkl_rt.2.dll']
10
+ FORTRAN_DLLS = ['libifcoremd.dll',
11
+ 'libifcoremdd.dll',
12
+ 'libmmd.dll',
13
+ 'libifportmd.dll',
14
+ 'libmmdd.dll',
15
+ 'svml_dispmd.dll',
16
+ 'libiomp5md.dll']
17
+ # VC_RUNTIME_DLLS = ['vcruntime140.dll',
18
+ # 'vcruntime140_1.dll']
19
+ # HDF5_DLLS = ['hdf5.dll',
20
+ # 'hdf5_hl.dll']
21
+
22
+ interpreter_path = Path(sys.executable).parent
23
+ library_bin_path = interpreter_path / 'Library' / 'bin'
24
+ if not library_bin_path.exists():
25
+ if 'Scripts' in interpreter_path.parts:
26
+ library_bin_path = interpreter_path.parent / 'Library' / 'bin'
27
+
28
+ h5py_path = interpreter_path / 'Lib' / 'site-packages' / 'h5py'
29
+ mydir = Path(__file__).parent
30
+
31
+
32
+ error = False
33
+ if library_bin_path.exists():
34
+ for dll in MKL_DLLS:
35
+ dll_path = library_bin_path / dll
36
+ if not dll_path.exists():
37
+ error = True
38
+ print(f"Missing DLL: {dll}")
39
+ else:
40
+ if not (mydir / dll).exists():
41
+ shutil.copy(dll_path, mydir / dll)
42
+
43
+ # for dll in VC_RUNTIME_DLLS:
44
+ # dll_path = interpreter_path / dll
45
+ # if not dll_path.exists():
46
+ # error = True
47
+ # print(f"Missing DLL: {dll}")
48
+ # else:
49
+ # if not (mydir / dll).exists():
50
+ # shutil.copy(dll_path, mydir / dll)
51
+
52
+ for dll in FORTRAN_DLLS:
53
+ dll_path = library_bin_path / dll
54
+ if not dll_path.exists():
55
+ error = True
56
+ print(f"Missing DLL: {dll}")
57
+ else:
58
+ if not (mydir / dll).exists():
59
+ shutil.copy(dll_path, mydir / dll)
60
+
61
+ else:
62
+ error = True
63
+ print("Library/bin directory not found -- Impossible to copy DLLs.")
64
+
65
+ # if h5py_path.exists():
66
+ # for dll in HDF5_DLLS:
67
+ # dll_path = h5py_path / dll
68
+ # if not dll_path.exists():
69
+ # error = True
70
+ # print(f"Missing DLL: {dll}")
71
+ # else:
72
+ # if not (mydir / dll).exists():
73
+ # shutil.copy(dll_path, mydir / dll)
74
+ # else:
75
+ # error = True
76
+ # print("h5py directory not found.")
77
+
78
+ if error:
79
+ raise FileNotFoundError("Missing DLLs. Please check the output above.")
@@ -1616,6 +1616,7 @@ class UI_Manager_2D_GPU():
1616
1616
  destroy_if_exists = ret == wx.ID_YES
1617
1617
  dlg.Destroy()
1618
1618
 
1619
+ preserve_ic = False
1619
1620
  if not destroy_if_exists:
1620
1621
  dlg = wx.MessageDialog(None, _('Do you want to preserve initial conditions ?'), _('Warning'), wx.YES_NO)
1621
1622
  ret = dlg.ShowModal()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wolfhece
3
- Version: 2.1.44
3
+ Version: 2.1.45
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
@@ -13,6 +13,7 @@ Classifier: Topic :: Scientific/Engineering :: Physics
13
13
  Requires-Python: <3.11,>=3.10
14
14
  Description-Content-Type: text/markdown
15
15
  Requires-Dist: wxpython
16
+ Requires-Dist: colorlog
16
17
  Requires-Dist: intel-fortran-rt
17
18
  Requires-Dist: scikit-learn
18
19
  Requires-Dist: cryptography
@@ -6,8 +6,8 @@ wolfhece/ManageParams.py,sha256=EeuUI5Vvh9ixCvYf8YShMC1s1Yacc7OxOCN7q81gqiQ,517
6
6
  wolfhece/Model1D.py,sha256=uL1DJVmDI2xVSE7H6n3icn3QbsPtTHeg8E-6wkDloKw,476914
7
7
  wolfhece/PyConfig.py,sha256=FB8u0belXOXTb03Ln6RdVWvMgjzi3oGPCmw2dWa3lNg,8332
8
8
  wolfhece/PyCrosssections.py,sha256=FnmM9DWY_SAF2EDH9Gu2PojXNtSTRF4-aYQuAAJXBh4,112771
9
- wolfhece/PyDraw.py,sha256=MQO149Cp8QtxWceXpKWLsDbE6JBrVbqEWoAOXWfHl2w,390751
10
- wolfhece/PyGui.py,sha256=_1LKelusQ-FS0AtgpwFiXKMZ2glky7K1WINTI93H0k0,103438
9
+ wolfhece/PyDraw.py,sha256=mMPowIkidxWrEqQwvsFG__HADLjIu-nVRX0ChllpAUA,390687
10
+ wolfhece/PyGui.py,sha256=aRWv9tBpRl7sKEd2gHWj8Bss0ZOKbGlUYIehWHFm8WY,105008
11
11
  wolfhece/PyGuiHydrology.py,sha256=f60E8K9eGTnRq5RDF6yvt-ahf2AYegwQ9t25zZ2Mk1A,14946
12
12
  wolfhece/PyHydrographs.py,sha256=jwtSNMMACwarxrtN1UeQYth99UNrhwPx1IGgUwcooHA,3774
13
13
  wolfhece/PyPalette.py,sha256=5TvXF5wWDxP4e70zO9B0UMgVP9c0oAzerM28aoJ1CTg,27982
@@ -67,11 +67,11 @@ wolfhece/apps/WolfPython.png,sha256=K3dcbeZUiJCFNwOAAlGMaRGLJ56yM8WD2I_0bk0xT1g,
67
67
  wolfhece/apps/WolfPython2.png,sha256=VMPV-M-3BCOg8zOJss8bXwPmzRYZy8Fo-XtnVYNgbaw,618073
68
68
  wolfhece/apps/WolfPython3.png,sha256=3G84zx14HnlB9YXMY4VUAO7IB3eu7JFvi4Kpmc_4zBE,403298
69
69
  wolfhece/apps/__init__.py,sha256=OzzKItATWV0mDkz_LC2L3w5sgT2rt8ExXXCbR_FwvlY,24
70
- wolfhece/apps/check_install.py,sha256=icFpkjfwNGDX-0NZVa-ijrCrqmGHEKDiFphjN8uTyh8,928
70
+ wolfhece/apps/check_install.py,sha256=SG024u18G7VRLKynbp7DKD1jImtHwuWwN4bJWHm-YHE,1271
71
71
  wolfhece/apps/curvedigitizer.py,sha256=_hRR2PWow7PU7rTHIbc6ykZ08tCXcK9uy7RFrb4EKkE,5196
72
72
  wolfhece/apps/isocurrent.py,sha256=MuwTodHxdc6PrqNpphR2ntYf1NLL2n9klTPndGrOHDQ,4109
73
73
  wolfhece/apps/splashscreen.py,sha256=SrustmIQeXnsiD-92OzjdGhBi-S7c_j-cSvuX4T6rtg,2929
74
- wolfhece/apps/version.py,sha256=42X8KC4MhMsyZkkbTyYj1S26AzOp9fQtCIqVNikPw5o,388
74
+ wolfhece/apps/version.py,sha256=ls80i8D7bLwHlLa8Q9f7hPR0HGZE2sGy0sqH0i67EBs,388
75
75
  wolfhece/apps/wolf.py,sha256=mM6Tyi4DlKQILmO49cDUCip9fYVy-hLXkY3YhZgIeUQ,591
76
76
  wolfhece/apps/wolf2D.py,sha256=yPQGee7fsegoQ8GfWKrWEjX1Az_ApL-UWlBiqPvaIyY,565
77
77
  wolfhece/apps/wolf_logo.bmp,sha256=ruJ4MA51CpGO_AYUp_dB4SWKHelvhOvd7Q8NrVOjDJk,3126
@@ -171,6 +171,7 @@ wolfhece/lazviewer/viewer/viewer.exe,sha256=pF5nwE8vMWlEzkk-SOekae9zpOsPhTWhZbqa
171
171
  wolfhece/lazviewer/viewer/viewer.py,sha256=8_MQCaQOS0Z_oRPiGoRy1lq-aCirReX3hWEBjQID0ig,24665
172
172
  wolfhece/libs/MSVCP140.dll,sha256=2GrBWBI6JFuSdZLIDMAg_qKcjErdwURGbEYloAypx3o,565640
173
173
  wolfhece/libs/WolfDll.dll,sha256=E8SeV0AHVXW5ikAQuVtijqIvaYx7UIMeqvnnsmTMCT8,132934144
174
+ wolfhece/libs/__init__.py,sha256=KHR7OIX5YURmKmbx5LkORqUIhF1dz6e1Pf60yLuj0jw,2452
174
175
  wolfhece/libs/api-ms-win-crt-heap-l1-1-0.dll,sha256=r0euvgZa8vBFoZ8g7H5Upuc8DD6aUQimMJWnIyt1OBo,19720
175
176
  wolfhece/libs/api-ms-win-crt-math-l1-1-0.dll,sha256=ol0GVN6wzqGu8Ym6IXTQ8TvfUvCY06nsNtFeS_swxJk,27912
176
177
  wolfhece/libs/api-ms-win-crt-runtime-l1-1-0.dll,sha256=NxpEq5FhSowm0Vm-uHKntD9WnLX6yK2pms6Y8mSjtQM,23304
@@ -253,7 +254,7 @@ wolfhece/report/reporting.py,sha256=JUEXovx_S4jpYkJEBU0AC-1Qw2OkkWyV3VAp6iOfSHc,
253
254
  wolfhece/report/wolf_report.png,sha256=NoSV58LSwb-oxCcZScRiJno-kxDwRdm_bK-fiMsKJdA,592485
254
255
  wolfhece/scenario/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
255
256
  wolfhece/scenario/check_scenario.py,sha256=w7_SST4n_uec-MUBK36gbJzz2KC8qT_bVJ_VNyp7cMo,4917
256
- wolfhece/scenario/config_manager.py,sha256=hw9NfD75sttg-BJfyclXqZUsJwzlqUwE0bQUnzX7IiM,85258
257
+ wolfhece/scenario/config_manager.py,sha256=k5wPR58AQk_xSN1uzKR0DjGume26NrbBFZvAbgMIhlc,85287
257
258
  wolfhece/scenario/imposebc_void.py,sha256=PqA_99hKcaqK5zsK6IRIc5Exgg3WVpgWU8xpwNL49zQ,5571
258
259
  wolfhece/scenario/update_void.py,sha256=ay8C_FxfXN627Hx46waaAO6F3ovYmOCTxseUumKAY7c,7474
259
260
  wolfhece/shaders/fragment_shader_texture.glsl,sha256=w6h8d5mJqFaGbao0LGmjRcFFdcEQ3ICIl9JpuT71K5k,177
@@ -276,8 +277,8 @@ wolfhece/ui/wolf_multiselection_collapsiblepane.py,sha256=8PlMYrb_8jI8h9F0_EagpM
276
277
  wolfhece/ui/wolf_times_selection_comparison_models.py,sha256=ORy7fz4dcp691qKzaOZHrRLZ0uXNhL-LIHxmpDGL6BI,5007
277
278
  wolfhece/wintab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
278
279
  wolfhece/wintab/wintab.py,sha256=8A-JNONV6ujgsgG3lM5Uw-pVgglPATwKs86oBzzljoc,7179
279
- wolfhece-2.1.44.dist-info/METADATA,sha256=z3vYq9zp0CQf9Rg8X1x3H2PER-At8R863VPkddKCfYo,2463
280
- wolfhece-2.1.44.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
281
- wolfhece-2.1.44.dist-info/entry_points.txt,sha256=yggeO1Fa80pi2BrOd9k5dTkiFlefGPwG6HztZhY0-qw,366
282
- wolfhece-2.1.44.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
283
- wolfhece-2.1.44.dist-info/RECORD,,
280
+ wolfhece-2.1.45.dist-info/METADATA,sha256=y63i_CDK02w9EiVXGhd2JlyrM_GCuI0iP7BTQfkmbAw,2488
281
+ wolfhece-2.1.45.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
282
+ wolfhece-2.1.45.dist-info/entry_points.txt,sha256=Q5JuIWV4odeIJI3qc6fV9MwRoz0ezqPVlFC1Ppm_vdQ,395
283
+ wolfhece-2.1.45.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
284
+ wolfhece-2.1.45.dist-info/RECORD,,
@@ -1,6 +1,7 @@
1
1
  [console_scripts]
2
2
  wolf_accept = wolfhece.cli:accept
3
3
  wolf_check = wolfhece.cli:check
4
+ wolf_gui = wolfhece.cli:wolf
4
5
  wolf_license = wolfhece.cli:license
5
6
 
6
7
  [gui_scripts]