wolfhece 2.1.99__py3-none-any.whl → 2.1.100__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 +20 -13
- wolfhece/PyVertexvectors.py +2 -2
- wolfhece/acceptability/Parallels.py +2 -2
- wolfhece/acceptability/_add_path.py +23 -0
- wolfhece/acceptability/acceptability.py +594 -563
- wolfhece/acceptability/acceptability_gui.py +564 -331
- wolfhece/acceptability/cli.py +307 -120
- wolfhece/acceptability/func.py +1743 -1597
- wolfhece/apps/version.py +1 -1
- wolfhece/bernoulli/losses.py +75 -22
- wolfhece/bernoulli/losses_jax.py +143 -0
- wolfhece/bernoulli/pipe.py +7 -2
- wolfhece/math_parser/__init__.py +4 -4
- wolfhece/math_parser/calculator.py +50 -9
- wolfhece/mesh2d/simple_2d.py +2399 -0
- wolfhece/mesh2d/wolf2dprev.py +1 -1
- wolfhece/pidcontroller.py +131 -0
- wolfhece/pywalous.py +7 -7
- wolfhece/scenario/config_manager.py +1 -1
- wolfhece/wolf_array.py +156 -103
- wolfhece/wolf_vrt.py +108 -7
- wolfhece/wolfresults_2D.py +74 -0
- wolfhece/xyz_file.py +91 -51
- {wolfhece-2.1.99.dist-info → wolfhece-2.1.100.dist-info}/METADATA +1 -1
- {wolfhece-2.1.99.dist-info → wolfhece-2.1.100.dist-info}/RECORD +28 -24
- {wolfhece-2.1.99.dist-info → wolfhece-2.1.100.dist-info}/WHEEL +1 -1
- {wolfhece-2.1.99.dist-info → wolfhece-2.1.100.dist-info}/entry_points.txt +0 -0
- {wolfhece-2.1.99.dist-info → wolfhece-2.1.100.dist-info}/top_level.txt +0 -0
wolfhece/PyDraw.py
CHANGED
@@ -987,7 +987,7 @@ class Sim_Explorer(wx.Frame):
|
|
987
987
|
if mode == 0:
|
988
988
|
# By time [s]
|
989
989
|
prev_time = self._all_times_steps[0][idx] - float(self._interval.GetValue())
|
990
|
-
diff = [abs(prev_time - i) for i in self._all_times_steps[0][:
|
990
|
+
diff = [abs(prev_time - i) for i in self._all_times_steps[0][:idx]]
|
991
991
|
prev_idx = diff.index(min(diff))
|
992
992
|
|
993
993
|
return prev_idx
|
@@ -995,7 +995,7 @@ class Sim_Explorer(wx.Frame):
|
|
995
995
|
elif mode == 1:
|
996
996
|
# By time [hour]
|
997
997
|
prev_time = self._all_times_steps[0][idx] - float(self._interval.GetValue())*3600
|
998
|
-
diff = [abs(prev_time - i) for i in self._all_times_steps[0][:
|
998
|
+
diff = [abs(prev_time - i) for i in self._all_times_steps[0][:idx]]
|
999
999
|
prev_idx = diff.index(min(diff))
|
1000
1000
|
|
1001
1001
|
return prev_idx
|
@@ -1009,7 +1009,7 @@ class Sim_Explorer(wx.Frame):
|
|
1009
1009
|
elif mode == 3:
|
1010
1010
|
# By time step
|
1011
1011
|
prev_idx = self._all_times_steps[1].index(self._all_times_steps[1][idx] - int(self._interval.GetValue()))
|
1012
|
-
diff = [abs(prev_idx - i) for i in self._all_times_steps[1][:
|
1012
|
+
diff = [abs(prev_idx - i) for i in self._all_times_steps[1][:idx]]
|
1013
1013
|
prev_idx = diff.index(min(diff))
|
1014
1014
|
|
1015
1015
|
return prev_idx
|
@@ -7581,16 +7581,27 @@ class WolfMapViewer(wx.Frame):
|
|
7581
7581
|
# myhead.dy = 1.
|
7582
7582
|
|
7583
7583
|
else:
|
7584
|
+
|
7585
|
+
dlg = wx.TextEntryDialog(self,_('Spatial step size (assuming dx == dy) ?'), value='1')
|
7586
|
+
ret=dlg.ShowModal()
|
7587
|
+
|
7588
|
+
if ret == wx.ID_CANCEL:
|
7589
|
+
dlg.Destroy()
|
7590
|
+
return -1
|
7591
|
+
|
7592
|
+
tmpdx = float(dlg.GetValue())
|
7593
|
+
dlg.Destroy()
|
7594
|
+
|
7595
|
+
dy = dx
|
7596
|
+
|
7584
7597
|
myxyz = xyz_scandir(filename, None)
|
7585
7598
|
myhead = header_wolf()
|
7586
7599
|
|
7587
|
-
myhead.origx = np.min(myxyz[:, 0]) - .
|
7588
|
-
myhead.origy = np.min(myxyz[:, 1]) - .
|
7600
|
+
myhead.origx = np.min(myxyz[:, 0]) - dx/2.
|
7601
|
+
myhead.origy = np.min(myxyz[:, 1]) - dy/2.
|
7589
7602
|
|
7590
|
-
myhead.dx =
|
7591
|
-
myhead.dy =
|
7592
|
-
tmpdx = 1.
|
7593
|
-
tmpdy = 1.
|
7603
|
+
myhead.dx = dx
|
7604
|
+
myhead.dy = dy
|
7594
7605
|
|
7595
7606
|
myhead.nbx = int(np.max(myxyz[:, 0]) - myhead.origx) + 1
|
7596
7607
|
myhead.nby = int(np.max(myxyz[:, 1]) - myhead.origy) + 1
|
@@ -7608,10 +7619,6 @@ class WolfMapViewer(wx.Frame):
|
|
7608
7619
|
|
7609
7620
|
newobj.mask_data(newobj.nullvalue)
|
7610
7621
|
|
7611
|
-
# if min(tmpdx, tmpdy) != 1.:
|
7612
|
-
# newobj.rebin(min(tmpdx, tmpdy))
|
7613
|
-
# newobj.mask_data(newobj.nullvalue)
|
7614
|
-
|
7615
7622
|
newobj.change_gui(self)
|
7616
7623
|
newobj.updatepalette(0)
|
7617
7624
|
self.myarrays.append(newobj)
|
wolfhece/PyVertexvectors.py
CHANGED
@@ -7,7 +7,7 @@ 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
|
-
|
10
|
+
#import _add_path #AP
|
11
11
|
from .func import clip_layer, data_modification, vector_to_raster, compute_vulnerability, match_vulnerability2sim, compute_acceptability, shp_to_raster, Accept_Manager
|
12
12
|
import geopandas as gpd
|
13
13
|
import multiprocessing
|
@@ -76,7 +76,7 @@ def parallel_v2r(manager:Accept_Manager,
|
|
76
76
|
if number_procs == 1:
|
77
77
|
result_list=[]
|
78
78
|
for curlayer in layers:
|
79
|
-
result_list.append(vector_to_raster(curlayer, manager, attribute, pixel,convert_to_sparse))
|
79
|
+
result_list.append(vector_to_raster(curlayer, manager, attribute, pixel, convert_to_sparse))
|
80
80
|
|
81
81
|
else:
|
82
82
|
pool = multiprocessing.Pool(processes=number_procs)
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import os
|
2
|
+
import os.path
|
3
|
+
import sys
|
4
|
+
import platform
|
5
|
+
|
6
|
+
|
7
|
+
def _add_path():
|
8
|
+
_root_dir = os.path.dirname(os.path.realpath(__file__))
|
9
|
+
|
10
|
+
# manual specify list of dll directories, with paths relative to _root_dir
|
11
|
+
_dll_dirs = ['libs', 'shaders']
|
12
|
+
|
13
|
+
if platform.system() == 'Windows':
|
14
|
+
os.environ.setdefault('PATH', '')
|
15
|
+
paths = os.environ['PATH'].split(';')
|
16
|
+
for x in _dll_dirs:
|
17
|
+
x = os.path.join(_root_dir, x)
|
18
|
+
if os.path.isdir(x) and x not in paths:
|
19
|
+
paths = [x] + paths
|
20
|
+
os.environ['PATH'] = ';'.join(paths)
|
21
|
+
|
22
|
+
|
23
|
+
_add_path()
|