wolfhece 2.1.58__py3-none-any.whl → 2.1.60__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
@@ -8397,22 +8397,23 @@ class WolfMapViewer(wx.Frame):
8397
8397
  def check_for_updates(self):
8398
8398
  """ Check for updates """
8399
8399
  from .apps.version import WolfVersion
8400
- import pkg_resources
8400
+ import requests
8401
8401
 
8402
8402
  current_version = str(WolfVersion())
8403
8403
  package_name = "wolfhece"
8404
8404
 
8405
8405
  try:
8406
- available_version = pkg_resources.get_distribution(package_name).version
8406
+ available_version = requests.get(f"https://pypi.org/pypi/{package_name}/json").json()["info"]["version"]
8407
+
8407
8408
  if available_version > current_version:
8408
- with wx.MessageDialog(None, _("A new version is available: {}").format(available_version), _("Update"), wx.OK | wx.ICON_INFORMATION) as dlg:
8409
+ with wx.MessageDialog(None, _("A new version is available: {}\n\nYour version is {}\n\nIf you want to upgrade, 'pip install wolfhece --upgrade' from your Python environment.").format(available_version, current_version), _("Upgrade"), wx.OK | wx.ICON_INFORMATION) as dlg:
8409
8410
  dlg.ShowModal()
8410
8411
  else:
8411
- with wx.MessageDialog(None, _("You have the latest version."), _("Update"), wx.OK | wx.ICON_INFORMATION) as dlg:
8412
+ with wx.MessageDialog(None, _("You have the latest version."), _("Upgrade"), wx.OK | wx.ICON_INFORMATION) as dlg:
8412
8413
  dlg.ShowModal()
8413
8414
 
8414
- except pkg_resources.DistributionNotFound:
8415
- print("Package not found on PyPI.")
8415
+ except Exception as e:
8416
+ logging.error("Package not found on PyPI. -- {}".format(e))
8416
8417
 
8417
8418
  def print_shortcuts(self, inframe:bool = None):
8418
8419
  """ Print the list of shortcuts into logging """
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 = 58
8
+ self.patch = 60
9
9
 
10
10
  def __str__(self):
11
11
 
wolfhece/libs/__init__.py CHANGED
@@ -3,6 +3,21 @@ import sys
3
3
  import os
4
4
  import shutil
5
5
 
6
+ """
7
+ Mandatory DLLs for MKL and Fortran.
8
+
9
+ MKL package and Fortran package installezd by pip
10
+ copy the DLLs to the Library/bin folder of Python.
11
+
12
+ This folder may not be in the PATH, so we need
13
+ to copy the DLLs to the wolfhece's libs folder.
14
+
15
+ Depending on the Python installation, the Library/bin
16
+ folder may be in different locations. We search for it
17
+ in the main directory of the Python interpreter and
18
+ in the different site-packages folder.
19
+
20
+ """
6
21
  MKL_DLLS = ['libiomp5md.dll',
7
22
  'mkl_core.2.dll',
8
23
  'mkl_intel_thread.2.dll',
@@ -14,66 +29,60 @@ FORTRAN_DLLS = ['libifcoremd.dll',
14
29
  'libmmdd.dll',
15
30
  'svml_dispmd.dll',
16
31
  '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
32
 
33
+ from site import getsitepackages
34
+
35
+ def find_Librarybin(test):
36
+ """ Searching Library/bin folder """
37
+
38
+ interpreter_path = Path(sys.executable).parent
39
+ sites = getsitepackages()
40
+
41
+ candidate = interpreter_path / 'Library/bin'
42
+ if candidate.exists():
43
+ if (candidate/test).exists():
44
+ return candidate
45
+
46
+ for cursite in sites:
47
+ candidate = Path(cursite) / 'Library/bin'
48
+ if candidate.exists():
49
+ if (candidate/test).exists():
50
+ return candidate
51
+
52
+ return None
53
+
54
+ mkl_path = find_Librarybin(MKL_DLLS[0])
55
+ fortran_path = find_Librarybin(FORTRAN_DLLS[0])
56
+
57
+ if mkl_path is None:
58
+ print("MKL package not found -- Please install MKL with 'pip install mkl'")
59
+ if fortran_path is None:
60
+ print("Fortran package not found -- Please install Intel Fortran RunTime with 'pip install intel_fortran_rt'")
61
+
62
+ if mkl_path is None or fortran_path is None:
63
+ raise FileNotFoundError("Missing MKL or Fortran package. Please check the output above.")
64
+
65
+ mydir = Path(__file__).parent
31
66
 
32
67
  error = False
33
- if library_bin_path.exists():
68
+ if mkl_path.exists():
34
69
  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
70
+ dll_path = mkl_path / dll
54
71
  if not dll_path.exists():
55
72
  error = True
56
- print(f"Missing DLL: {dll}")
73
+ print(f"Missing DLL: {dll} in {mkl_path}")
57
74
  else:
58
75
  if not (mydir / dll).exists():
59
76
  shutil.copy(dll_path, mydir / dll)
60
77
 
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.")
78
+ for dll in FORTRAN_DLLS:
79
+ dll_path = fortran_path / dll
80
+ if not dll_path.exists():
81
+ error = True
82
+ print(f"Missing DLL: {dll} in {fortran_path}")
83
+ else:
84
+ if not (mydir / dll).exists():
85
+ shutil.copy(dll_path, mydir / dll)
77
86
 
78
87
  if error:
79
88
  raise FileNotFoundError("Missing DLLs. Please check the output above.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wolfhece
3
- Version: 2.1.58
3
+ Version: 2.1.60
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
@@ -7,7 +7,7 @@ wolfhece/ManageParams.py,sha256=EeuUI5Vvh9ixCvYf8YShMC1s1Yacc7OxOCN7q81gqiQ,517
7
7
  wolfhece/Model1D.py,sha256=uL1DJVmDI2xVSE7H6n3icn3QbsPtTHeg8E-6wkDloKw,476914
8
8
  wolfhece/PyConfig.py,sha256=FB8u0belXOXTb03Ln6RdVWvMgjzi3oGPCmw2dWa3lNg,8332
9
9
  wolfhece/PyCrosssections.py,sha256=FnmM9DWY_SAF2EDH9Gu2PojXNtSTRF4-aYQuAAJXBh4,112771
10
- wolfhece/PyDraw.py,sha256=ZJoYLDrz5_jSMwLfdE0wjWa3eBmdmHOsZbrgxMPcbSU,407046
10
+ wolfhece/PyDraw.py,sha256=OWcScU6OB2PSOizOBFc7ilSwpPrWfDYBhJAIxQ7lA-Q,407210
11
11
  wolfhece/PyGui.py,sha256=oBIBpgBQRR_XXucKE5-RFrtqKj0DRg9VlUCRo8Mzalc,105009
12
12
  wolfhece/PyGuiHydrology.py,sha256=f60E8K9eGTnRq5RDF6yvt-ahf2AYegwQ9t25zZ2Mk1A,14946
13
13
  wolfhece/PyHydrographs.py,sha256=jwtSNMMACwarxrtN1UeQYth99UNrhwPx1IGgUwcooHA,3774
@@ -72,7 +72,7 @@ wolfhece/apps/check_install.py,sha256=SG024u18G7VRLKynbp7DKD1jImtHwuWwN4bJWHm-YH
72
72
  wolfhece/apps/curvedigitizer.py,sha256=Yps4bcayzbsz0AoVc_dkSk35dEhhn_esIBy1Ziefgmk,5334
73
73
  wolfhece/apps/isocurrent.py,sha256=dagmGR8ja9QQ1gwz_8fU-N052hIw-W0mWGVkzLu6C7I,4247
74
74
  wolfhece/apps/splashscreen.py,sha256=SrustmIQeXnsiD-92OzjdGhBi-S7c_j-cSvuX4T6rtg,2929
75
- wolfhece/apps/version.py,sha256=0lp2iLnoPUFxdKcw_jzmegskBPc16FjVo0YHgsdgPpQ,388
75
+ wolfhece/apps/version.py,sha256=JxmjSazuCXVG7m7Z0RPKfHDtapKv30Ya4LTjYWXXdPg,388
76
76
  wolfhece/apps/wolf.py,sha256=j_CgvsL8rwixbVvVD5Z0s7m7cHZ86gmFLojKGuetMls,729
77
77
  wolfhece/apps/wolf2D.py,sha256=4z_OPQ3IgaLtjexjMKX9ppvqEYyjFLt1hcfFABy3-jU,703
78
78
  wolfhece/apps/wolf_logo.bmp,sha256=ruJ4MA51CpGO_AYUp_dB4SWKHelvhOvd7Q8NrVOjDJk,3126
@@ -175,7 +175,7 @@ wolfhece/lazviewer/viewer/viewer.exe,sha256=pF5nwE8vMWlEzkk-SOekae9zpOsPhTWhZbqa
175
175
  wolfhece/lazviewer/viewer/viewer.py,sha256=8_MQCaQOS0Z_oRPiGoRy1lq-aCirReX3hWEBjQID0ig,24665
176
176
  wolfhece/libs/MSVCP140.dll,sha256=2GrBWBI6JFuSdZLIDMAg_qKcjErdwURGbEYloAypx3o,565640
177
177
  wolfhece/libs/WolfDll.dll,sha256=E8SeV0AHVXW5ikAQuVtijqIvaYx7UIMeqvnnsmTMCT8,132934144
178
- wolfhece/libs/__init__.py,sha256=KHR7OIX5YURmKmbx5LkORqUIhF1dz6e1Pf60yLuj0jw,2452
178
+ wolfhece/libs/__init__.py,sha256=eAA6dNfD15XEuBk24yYUtSRpFc6MpJ_g42F_05gtRSA,2651
179
179
  wolfhece/libs/api-ms-win-crt-heap-l1-1-0.dll,sha256=r0euvgZa8vBFoZ8g7H5Upuc8DD6aUQimMJWnIyt1OBo,19720
180
180
  wolfhece/libs/api-ms-win-crt-math-l1-1-0.dll,sha256=ol0GVN6wzqGu8Ym6IXTQ8TvfUvCY06nsNtFeS_swxJk,27912
181
181
  wolfhece/libs/api-ms-win-crt-runtime-l1-1-0.dll,sha256=NxpEq5FhSowm0Vm-uHKntD9WnLX6yK2pms6Y8mSjtQM,23304
@@ -283,8 +283,8 @@ wolfhece/ui/wolf_multiselection_collapsiblepane.py,sha256=8PlMYrb_8jI8h9F0_EagpM
283
283
  wolfhece/ui/wolf_times_selection_comparison_models.py,sha256=ORy7fz4dcp691qKzaOZHrRLZ0uXNhL-LIHxmpDGL6BI,5007
284
284
  wolfhece/wintab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
285
285
  wolfhece/wintab/wintab.py,sha256=8A-JNONV6ujgsgG3lM5Uw-pVgglPATwKs86oBzzljoc,7179
286
- wolfhece-2.1.58.dist-info/METADATA,sha256=otlu_91hkUtPzxtyi71YB3WkoTgL4Lf-YaMPAGm9LBM,2541
287
- wolfhece-2.1.58.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
288
- wolfhece-2.1.58.dist-info/entry_points.txt,sha256=Q5JuIWV4odeIJI3qc6fV9MwRoz0ezqPVlFC1Ppm_vdQ,395
289
- wolfhece-2.1.58.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
290
- wolfhece-2.1.58.dist-info/RECORD,,
286
+ wolfhece-2.1.60.dist-info/METADATA,sha256=BCXpcCPuPZ8Kpe_9bCPZoPTvQ69o041Ia9aF6uyAxmA,2541
287
+ wolfhece-2.1.60.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
288
+ wolfhece-2.1.60.dist-info/entry_points.txt,sha256=Q5JuIWV4odeIJI3qc6fV9MwRoz0ezqPVlFC1Ppm_vdQ,395
289
+ wolfhece-2.1.60.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
290
+ wolfhece-2.1.60.dist-info/RECORD,,