wolfhece 2.1.96__py3-none-any.whl → 2.1.97__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/PyConfig.py +18 -3
- wolfhece/PyDraw.py +69 -3
- wolfhece/PyVertexvectors.py +34 -9
- wolfhece/apps/version.py +1 -1
- wolfhece/scenario/config_manager.py +15 -1
- {wolfhece-2.1.96.dist-info → wolfhece-2.1.97.dist-info}/METADATA +1 -1
- {wolfhece-2.1.96.dist-info → wolfhece-2.1.97.dist-info}/RECORD +10 -10
- {wolfhece-2.1.96.dist-info → wolfhece-2.1.97.dist-info}/WHEEL +0 -0
- {wolfhece-2.1.96.dist-info → wolfhece-2.1.97.dist-info}/entry_points.txt +0 -0
- {wolfhece-2.1.96.dist-info → wolfhece-2.1.97.dist-info}/top_level.txt +0 -0
wolfhece/PyConfig.py
CHANGED
@@ -29,6 +29,7 @@ class ConfigurationKeys(Enum):
|
|
29
29
|
COLOR_BACKGROUND = "ColorBackground"
|
30
30
|
ACTIVE_ARRAY_PALETTE_FOR_IMAGE = "Use active array palette for image"
|
31
31
|
ACTIVE_RES2D_PALETTE_FOR_IMAGE = "Use active result palette for image"
|
32
|
+
ASSEMBLY_IMAGES = "AssemblyImages"
|
32
33
|
|
33
34
|
class WolfConfiguration:
|
34
35
|
""" Holds the PyWolf configuration.
|
@@ -71,7 +72,8 @@ class WolfConfiguration:
|
|
71
72
|
ConfigurationKeys.ACTIVE_ARRAY_PALETTE_FOR_IMAGE.value: True,
|
72
73
|
ConfigurationKeys.ACTIVE_RES2D_PALETTE_FOR_IMAGE.value: False,
|
73
74
|
ConfigurationKeys.TICKS_BOUNDS.value: True,
|
74
|
-
ConfigurationKeys.COLOR_BACKGROUND.value: [255, 255, 255, 255]
|
75
|
+
ConfigurationKeys.COLOR_BACKGROUND.value: [255, 255, 255, 255],
|
76
|
+
ConfigurationKeys.ASSEMBLY_IMAGES.value: 0
|
75
77
|
}
|
76
78
|
self._types = {
|
77
79
|
ConfigurationKeys.VERSION.value: int,
|
@@ -80,7 +82,8 @@ class WolfConfiguration:
|
|
80
82
|
ConfigurationKeys.ACTIVE_ARRAY_PALETTE_FOR_IMAGE.value: bool,
|
81
83
|
ConfigurationKeys.ACTIVE_RES2D_PALETTE_FOR_IMAGE.value: bool,
|
82
84
|
ConfigurationKeys.TICKS_BOUNDS.value: bool,
|
83
|
-
ConfigurationKeys.COLOR_BACKGROUND.value: list
|
85
|
+
ConfigurationKeys.COLOR_BACKGROUND.value: list,
|
86
|
+
ConfigurationKeys.ASSEMBLY_IMAGES.value: int
|
84
87
|
}
|
85
88
|
|
86
89
|
|
@@ -128,7 +131,7 @@ class GlobalOptionsDialog(wx.Dialog):
|
|
128
131
|
super(GlobalOptionsDialog, self).__init__(*args, **kw)
|
129
132
|
|
130
133
|
self.InitUI()
|
131
|
-
self.SetSize((400,
|
134
|
+
self.SetSize((400, 400))
|
132
135
|
self.SetTitle(_("Global options"))
|
133
136
|
|
134
137
|
def push_configuration(self, configuration):
|
@@ -138,6 +141,7 @@ class GlobalOptionsDialog(wx.Dialog):
|
|
138
141
|
self.cfg_bkg_color.SetColour(configuration[ConfigurationKeys.COLOR_BACKGROUND])
|
139
142
|
self.cfg_active_array_pal.SetValue(configuration[ConfigurationKeys.ACTIVE_ARRAY_PALETTE_FOR_IMAGE])
|
140
143
|
self.cfg_active_res_pal.SetValue(configuration[ConfigurationKeys.ACTIVE_RES2D_PALETTE_FOR_IMAGE])
|
144
|
+
self.cfg_assembly_images.SetSelection(configuration[ConfigurationKeys.ASSEMBLY_IMAGES])
|
141
145
|
|
142
146
|
def pull_configuration(self, configuration):
|
143
147
|
configuration[ConfigurationKeys.PLAY_WELCOME_SOUND] = self.cfg_welcome_voice.IsChecked()
|
@@ -146,6 +150,7 @@ class GlobalOptionsDialog(wx.Dialog):
|
|
146
150
|
configuration[ConfigurationKeys.COLOR_BACKGROUND] = list(self.cfg_bkg_color.GetColour())
|
147
151
|
configuration[ConfigurationKeys.ACTIVE_ARRAY_PALETTE_FOR_IMAGE] = self.cfg_active_array_pal.IsChecked()
|
148
152
|
configuration[ConfigurationKeys.ACTIVE_RES2D_PALETTE_FOR_IMAGE] = self.cfg_active_res_pal.IsChecked()
|
153
|
+
configuration[ConfigurationKeys.ASSEMBLY_IMAGES] = self.cfg_assembly_images.GetSelection()
|
149
154
|
|
150
155
|
def InitUI(self):
|
151
156
|
|
@@ -207,6 +212,16 @@ class GlobalOptionsDialog(wx.Dialog):
|
|
207
212
|
self.cfg_active_res_pal.SetToolTip(_('If checked, the active result palette will be used for the image (but priority to active array palette if checked)'))
|
208
213
|
sbs.Add(self.cfg_active_res_pal, 1, wx.EXPAND, 5)
|
209
214
|
|
215
|
+
locsizer = wx.BoxSizer(wx.HORIZONTAL)
|
216
|
+
self.label_assembly_images = wx.StaticText(pnl, label=_('Assembly mode for images (if linked viewers)'))
|
217
|
+
self.cfg_assembly_images = wx.ListBox(pnl, choices=['horizontal', 'vertical', 'square'], style=wx.LB_SINGLE)
|
218
|
+
self.cfg_assembly_images.SetToolTip(_('Choose the assembly mode for images -- horizontal, vertical or square'))
|
219
|
+
|
220
|
+
locsizer.Add(self.label_assembly_images, 1, wx.EXPAND, 2)
|
221
|
+
locsizer.Add(self.cfg_assembly_images, 1, wx.EXPAND)
|
222
|
+
|
223
|
+
sbs.Add(locsizer, 3, wx.EXPAND, 5)
|
224
|
+
|
210
225
|
pnl.SetSizer(sbs)
|
211
226
|
pnl.Layout()
|
212
227
|
|
wolfhece/PyDraw.py
CHANGED
@@ -6092,8 +6092,11 @@ class WolfMapViewer(wx.Frame):
|
|
6092
6092
|
|
6093
6093
|
elif itemlabel == 'Save to image...':
|
6094
6094
|
autoscale = False
|
6095
|
-
|
6096
|
-
|
6095
|
+
|
6096
|
+
fn, ds = self.save_canvasogl(mpl=True)
|
6097
|
+
all_images = self.save_linked_canvas(fn[:-4], mpl= True, ds= ds)
|
6098
|
+
|
6099
|
+
self.assembly_images(all_images)
|
6097
6100
|
|
6098
6101
|
elif itemlabel == _('Copy image...'):
|
6099
6102
|
autoscale = False
|
@@ -6666,9 +6669,72 @@ class WolfMapViewer(wx.Frame):
|
|
6666
6669
|
def save_linked_canvas(self, fn, mpl=True, ds=0.):
|
6667
6670
|
""" Save canvas of all linked viewers """
|
6668
6671
|
|
6672
|
+
ret = []
|
6669
6673
|
if self.linked:
|
6670
6674
|
for idx, curel in enumerate(self.linkedList):
|
6671
|
-
curel.save_canvasogl(fn + '_' + str(idx) + '.png', mpl, ds)
|
6675
|
+
ret.append(curel.save_canvasogl(fn + '_' + str(idx) + '.png', mpl, ds))
|
6676
|
+
|
6677
|
+
return ret
|
6678
|
+
|
6679
|
+
def assembly_images(self, all_images, mode:Literal['horizontal', 'vertical', 'square']= 'square'):
|
6680
|
+
""" Assembly images
|
6681
|
+
|
6682
|
+
Every image has the same size (width, height)
|
6683
|
+
"""
|
6684
|
+
|
6685
|
+
from PIL import Image
|
6686
|
+
|
6687
|
+
images = [Image.open(fn) for fn, ds in all_images]
|
6688
|
+
|
6689
|
+
widths, heights = zip(*(i.size for i in images))
|
6690
|
+
|
6691
|
+
if mode == 'horizontal':
|
6692
|
+
|
6693
|
+
total_width = sum(widths)
|
6694
|
+
max_height = max(heights)
|
6695
|
+
|
6696
|
+
new_im = Image.new('RGB', (total_width, max_height))
|
6697
|
+
|
6698
|
+
x_offset = 0
|
6699
|
+
for im in images:
|
6700
|
+
new_im.paste(im, (x_offset,0))
|
6701
|
+
x_offset += im.size[0]
|
6702
|
+
|
6703
|
+
new_im.save(all_images[0][0][:-4] + '_assembly.png')
|
6704
|
+
|
6705
|
+
elif mode == 'vertical':
|
6706
|
+
|
6707
|
+
total_height = sum(heights)
|
6708
|
+
max_width = max(widths)
|
6709
|
+
|
6710
|
+
new_im = Image.new('RGB', (max_width, total_height))
|
6711
|
+
|
6712
|
+
y_offset = 0
|
6713
|
+
for im in images:
|
6714
|
+
new_im.paste(im, (0, y_offset))
|
6715
|
+
y_offset += im.size[1]
|
6716
|
+
|
6717
|
+
new_im.save(all_images[0][0][:-4] + '_assembly.png')
|
6718
|
+
|
6719
|
+
elif mode == 'square':
|
6720
|
+
|
6721
|
+
max_width = max(widths)
|
6722
|
+
max_height = max(heights)
|
6723
|
+
|
6724
|
+
nb_hor = int(np.ceil(np.sqrt(len(images))))
|
6725
|
+
|
6726
|
+
new_im = Image.new('RGB', (max_width*nb_hor, max_height*nb_hor))
|
6727
|
+
|
6728
|
+
x_offset = 0
|
6729
|
+
y_offset = 0
|
6730
|
+
for idx, im in enumerate(images):
|
6731
|
+
new_im.paste(im, (x_offset, y_offset))
|
6732
|
+
x_offset += im.size[0]
|
6733
|
+
if (idx+1) % nb_hor == 0:
|
6734
|
+
y_offset += im.size[1]
|
6735
|
+
x_offset = 0
|
6736
|
+
|
6737
|
+
new_im.save(all_images[0][0][:-4] + '_assembly.png')
|
6672
6738
|
|
6673
6739
|
def thread_update_blender(self):
|
6674
6740
|
print("Update blender")
|
wolfhece/PyVertexvectors.py
CHANGED
@@ -2238,6 +2238,9 @@ class vector:
|
|
2238
2238
|
"""
|
2239
2239
|
Graphique Matplolib de valeurs dans les matrices liées
|
2240
2240
|
"""
|
2241
|
+
from .wolf_array import WolfArray
|
2242
|
+
from .wolfresults_2D import Wolfresults_2D
|
2243
|
+
|
2241
2244
|
colors=['red','blue','green']
|
2242
2245
|
|
2243
2246
|
exit=True
|
@@ -2257,30 +2260,52 @@ class vector:
|
|
2257
2260
|
|
2258
2261
|
zmin=99999.
|
2259
2262
|
zmax=-99999.
|
2263
|
+
nullvalue = -99999
|
2260
2264
|
|
2261
2265
|
for curlabel, curarray in linked_arrays.items():
|
2262
2266
|
if curarray.plotted:
|
2263
2267
|
|
2264
|
-
|
2268
|
+
if isinstance(curarray, WolfArray):
|
2269
|
+
ds = min(curarray.dx,curarray.dy)
|
2270
|
+
elif isinstance(curarray, Wolfresults_2D):
|
2271
|
+
ds = min(curarray[0].dx,curarray[0].dy)
|
2272
|
+
|
2265
2273
|
nb = int(np.ceil(length/ds*2))
|
2266
2274
|
|
2267
2275
|
alls = np.linspace(0,int(length),nb)
|
2268
2276
|
|
2269
2277
|
pts = [myls.interpolate(curs) for curs in alls]
|
2270
2278
|
|
2271
|
-
allz = [curarray.get_value(curpt.x,curpt.y) for curpt in pts]
|
2279
|
+
allz = np.asarray([curarray.get_value(curpt.x,curpt.y, nullvalue= nullvalue) for curpt in pts])
|
2272
2280
|
|
2273
|
-
zmaxloc=np.max(allz)
|
2274
|
-
zminloc=np.min(allz)
|
2281
|
+
zmaxloc=np.max(allz[allz!=nullvalue])
|
2282
|
+
zminloc=np.min(allz[allz!=nullvalue])
|
2275
2283
|
|
2276
2284
|
zmax=max(zmax,zmaxloc)
|
2277
2285
|
zmin=min(zmin,zminloc)
|
2278
2286
|
|
2279
|
-
if np.max(allz)
|
2280
|
-
|
2281
|
-
|
2282
|
-
|
2283
|
-
|
2287
|
+
if np.max(allz)>nullvalue:
|
2288
|
+
# select parts
|
2289
|
+
if nullvalue in allz:
|
2290
|
+
# find all parts separated by nullvalue
|
2291
|
+
nulls = np.argwhere(allz==nullvalue)
|
2292
|
+
nulls = np.insert(nulls,0,-1)
|
2293
|
+
nulls = np.append(nulls,len(allz))
|
2294
|
+
|
2295
|
+
addlabel = True
|
2296
|
+
for i in range(len(nulls)-1):
|
2297
|
+
if nulls[i+1]-nulls[i]>1:
|
2298
|
+
ax.plot(alls[nulls[i]+1:nulls[i+1]],allz[nulls[i]+1:nulls[i+1]],
|
2299
|
+
color=colors[np.mod(k,3)],
|
2300
|
+
lw=2.0,
|
2301
|
+
label=curlabel if addlabel else None)
|
2302
|
+
addlabel = False
|
2303
|
+
|
2304
|
+
else:
|
2305
|
+
ax.plot(alls,allz,
|
2306
|
+
color=colors[np.mod(k,3)],
|
2307
|
+
lw=2.0,
|
2308
|
+
label=curlabel)
|
2284
2309
|
k+=1
|
2285
2310
|
|
2286
2311
|
ax.set_ylim(zmin,zmax)
|
wolfhece/apps/version.py
CHANGED
@@ -709,7 +709,21 @@ class Config_Manager_2D_GPU:
|
|
709
709
|
|
710
710
|
def _select_tif_partname(self, curdict:dict, tifstr:Literal['bath_', 'mann_', 'infil_']):
|
711
711
|
""" Select tif files with a 'str' as name's prefix """
|
712
|
-
|
712
|
+
|
713
|
+
if tifstr == 'bath_':
|
714
|
+
forced_add = ['bathymetry.tif']
|
715
|
+
elif tifstr == 'mann_':
|
716
|
+
forced_add = ['manning.tif']
|
717
|
+
elif tifstr == 'infil_':
|
718
|
+
forced_add = ['infiltration.tif']
|
719
|
+
|
720
|
+
tif_list = [curtif for curtif in curdict[GPU_2D_file_extensions.TIF.value] \
|
721
|
+
if curtif.name.lower().startswith(tifstr) or \
|
722
|
+
curtif.name.lower() in forced_add]
|
723
|
+
|
724
|
+
tif_list += [curtif for curtif in curdict[GPU_2D_file_extensions.TIFF.value] \
|
725
|
+
if curtif.name.lower().startswith(tifstr) or \
|
726
|
+
curtif.name.lower() in forced_add]
|
713
727
|
|
714
728
|
return tif_list
|
715
729
|
|
@@ -5,9 +5,9 @@ wolfhece/GraphProfile.py,sha256=OCgJo0YFFBI6H1z-5egJsOOoWF_iziiza0-bbPejNMc,6965
|
|
5
5
|
wolfhece/Lidar2002.py,sha256=bX-nIzdpjD7rOfEgJpTeaW6rIdAXwDp_z4YTM9CgANY,6068
|
6
6
|
wolfhece/ManageParams.py,sha256=EeuUI5Vvh9ixCvYf8YShMC1s1Yacc7OxOCN7q81gqiQ,517
|
7
7
|
wolfhece/Model1D.py,sha256=SI4oNF_J3MdjiWZoizS8kuRXLMVyymX9dYfYJNVCQVI,476989
|
8
|
-
wolfhece/PyConfig.py,sha256=
|
8
|
+
wolfhece/PyConfig.py,sha256=Mbzh9PxAjBI-XnVOoYh0clykGqRlrgtxjxHr3_3TqIY,11390
|
9
9
|
wolfhece/PyCrosssections.py,sha256=FnmM9DWY_SAF2EDH9Gu2PojXNtSTRF4-aYQuAAJXBh4,112771
|
10
|
-
wolfhece/PyDraw.py,sha256=
|
10
|
+
wolfhece/PyDraw.py,sha256=eTk6e6awgr_41s6tg5BjFQAibAJz_Evee0QKTDGZkeE,445795
|
11
11
|
wolfhece/PyGui.py,sha256=HY0beOMSp1JEyq8-vfVynzVrmKxvaO_sJSMwlNqCNrg,105289
|
12
12
|
wolfhece/PyGuiHydrology.py,sha256=f60E8K9eGTnRq5RDF6yvt-ahf2AYegwQ9t25zZ2Mk1A,14946
|
13
13
|
wolfhece/PyHydrographs.py,sha256=jwtSNMMACwarxrtN1UeQYth99UNrhwPx1IGgUwcooHA,3774
|
@@ -16,7 +16,7 @@ wolfhece/PyParams.py,sha256=6fREK5cUCGw84SDyPvuSzidnX-9BXOX3fve5XBG1K_I,98114
|
|
16
16
|
wolfhece/PyPictures.py,sha256=m1kY0saW6Y9Q0bDCo47lW6XxDkBrbQG-Fd8uVn8G5ic,2514
|
17
17
|
wolfhece/PyTranslate.py,sha256=4appkmNeHHZLFmUtaA_k5_5QL-5ymxnbVN4R2OblmtE,622
|
18
18
|
wolfhece/PyVertex.py,sha256=aj1Xp6n0pMb_q6AMADHnQ9pgjjRU4EQm0m4Tmc1uoEM,41912
|
19
|
-
wolfhece/PyVertexvectors.py,sha256=
|
19
|
+
wolfhece/PyVertexvectors.py,sha256=dLdRt6f8AQrWT_EsPfJCGHkOgrFLH5zycN0mNcGSF0Y,253832
|
20
20
|
wolfhece/PyWMS.py,sha256=fyyzm2HFwq8aRwVYHKiBatcZOeKnFi6DWhv4nfscySQ,4602
|
21
21
|
wolfhece/RatingCurve.py,sha256=bUjIrQjvIjkD4V-z8bZmA6pe1ILtYNM0-3fT6YUY1RU,22498
|
22
22
|
wolfhece/RatingCurveData.py,sha256=5UvnIm89BwqjnEbLCcY3CA8WoFd_xHJbooNy62fX5iY,57660
|
@@ -75,7 +75,7 @@ wolfhece/apps/curvedigitizer.py,sha256=Yps4bcayzbsz0AoVc_dkSk35dEhhn_esIBy1Ziefg
|
|
75
75
|
wolfhece/apps/hydrometry.py,sha256=lhhJsFeb4zGL4bNQTs0co85OQ_6ssL1Oy0OUJCzhfYE,656
|
76
76
|
wolfhece/apps/isocurrent.py,sha256=dagmGR8ja9QQ1gwz_8fU-N052hIw-W0mWGVkzLu6C7I,4247
|
77
77
|
wolfhece/apps/splashscreen.py,sha256=SrustmIQeXnsiD-92OzjdGhBi-S7c_j-cSvuX4T6rtg,2929
|
78
|
-
wolfhece/apps/version.py,sha256=
|
78
|
+
wolfhece/apps/version.py,sha256=NRYKULEmomDYlRJya_ox0EwLq8fqyB2CbzOltiPmlOo,388
|
79
79
|
wolfhece/apps/wolf.py,sha256=j_CgvsL8rwixbVvVD5Z0s7m7cHZ86gmFLojKGuetMls,729
|
80
80
|
wolfhece/apps/wolf2D.py,sha256=4z_OPQ3IgaLtjexjMKX9ppvqEYyjFLt1hcfFABy3-jU,703
|
81
81
|
wolfhece/apps/wolf_logo.bmp,sha256=ruJ4MA51CpGO_AYUp_dB4SWKHelvhOvd7Q8NrVOjDJk,3126
|
@@ -262,7 +262,7 @@ wolfhece/report/reporting.py,sha256=JUEXovx_S4jpYkJEBU0AC-1Qw2OkkWyV3VAp6iOfSHc,
|
|
262
262
|
wolfhece/report/wolf_report.png,sha256=NoSV58LSwb-oxCcZScRiJno-kxDwRdm_bK-fiMsKJdA,592485
|
263
263
|
wolfhece/scenario/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
264
264
|
wolfhece/scenario/check_scenario.py,sha256=VVjtxfcLAgq_Pf8VSqRq6BJ-y4Zi24CntJpZWxAv3n8,5162
|
265
|
-
wolfhece/scenario/config_manager.py,sha256=
|
265
|
+
wolfhece/scenario/config_manager.py,sha256=sILVXCdSsB-LcfVbCIF33fkPAGd-8qZR9q2598TxVcU,91130
|
266
266
|
wolfhece/scenario/imposebc_void.py,sha256=PqA_99hKcaqK5zsK6IRIc5Exgg3WVpgWU8xpwNL49zQ,5571
|
267
267
|
wolfhece/scenario/update_void.py,sha256=ay8C_FxfXN627Hx46waaAO6F3ovYmOCTxseUumKAY7c,7474
|
268
268
|
wolfhece/shaders/fragment_shader_texture.glsl,sha256=w6h8d5mJqFaGbao0LGmjRcFFdcEQ3ICIl9JpuT71K5k,177
|
@@ -285,8 +285,8 @@ wolfhece/ui/wolf_multiselection_collapsiblepane.py,sha256=8PlMYrb_8jI8h9F0_EagpM
|
|
285
285
|
wolfhece/ui/wolf_times_selection_comparison_models.py,sha256=ORy7fz4dcp691qKzaOZHrRLZ0uXNhL-LIHxmpDGL6BI,5007
|
286
286
|
wolfhece/wintab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
287
287
|
wolfhece/wintab/wintab.py,sha256=8A-JNONV6ujgsgG3lM5Uw-pVgglPATwKs86oBzzljoc,7179
|
288
|
-
wolfhece-2.1.
|
289
|
-
wolfhece-2.1.
|
290
|
-
wolfhece-2.1.
|
291
|
-
wolfhece-2.1.
|
292
|
-
wolfhece-2.1.
|
288
|
+
wolfhece-2.1.97.dist-info/METADATA,sha256=74i0-s485_JqC2Pb5WGIg19uvs3o2pyeGpg7KFvgtZU,2570
|
289
|
+
wolfhece-2.1.97.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
290
|
+
wolfhece-2.1.97.dist-info/entry_points.txt,sha256=ZZ-aSfbpdcmo-wo84lRFzBN7LaSnD1XRGSaAKVX-Gpc,522
|
291
|
+
wolfhece-2.1.97.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
|
292
|
+
wolfhece-2.1.97.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|