wolfhece 2.1.66__py3-none-any.whl → 2.1.68__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/Model1D.py +39 -15
- wolfhece/PyDraw.py +31 -7
- wolfhece/apps/version.py +1 -1
- wolfhece/hydrometry/kiwis.py +400 -116
- wolfhece/math_parser/calculator.py +29 -24
- wolfhece/pyviews.py +2 -1
- wolfhece/wolf_array.py +17 -3
- {wolfhece-2.1.66.dist-info → wolfhece-2.1.68.dist-info}/METADATA +1 -1
- {wolfhece-2.1.66.dist-info → wolfhece-2.1.68.dist-info}/RECORD +12 -12
- {wolfhece-2.1.66.dist-info → wolfhece-2.1.68.dist-info}/WHEEL +0 -0
- {wolfhece-2.1.66.dist-info → wolfhece-2.1.68.dist-info}/entry_points.txt +0 -0
- {wolfhece-2.1.66.dist-info → wolfhece-2.1.68.dist-info}/top_level.txt +0 -0
@@ -10,14 +10,15 @@ copying or distribution of this file, via any medium, is strictly prohibited.
|
|
10
10
|
|
11
11
|
import wx
|
12
12
|
import logging
|
13
|
+
from pathlib import Path
|
13
14
|
|
14
15
|
|
15
16
|
from . import Parser, Expression
|
16
17
|
|
17
18
|
class Calculator(wx.Frame):
|
18
|
-
|
19
|
+
|
19
20
|
def __init__(self, mapviewer=None):
|
20
|
-
|
21
|
+
|
21
22
|
from ..PyDraw import WolfMapViewer, draw_type, WolfArray
|
22
23
|
|
23
24
|
super(Calculator, self).__init__(None, title='Calculator', size=(500, 300))
|
@@ -38,18 +39,23 @@ class Calculator(wx.Frame):
|
|
38
39
|
self._comment = wx.TextCtrl(self, style=wx.TE_RIGHT|wx.TE_RICH2|wx.TE_MULTILINE)
|
39
40
|
self.memory = wx.TextCtrl(self, style=wx.TE_RIGHT|wx.TE_RICH2|wx.TE_MULTILINE)
|
40
41
|
self.btn_reset_memory = wx.Button(self, label='Reset Memory')
|
41
|
-
|
42
|
+
|
42
43
|
self.Bind(wx.EVT_BUTTON, lambda v: self.bt_press(v.EventObject.Label))
|
43
44
|
|
44
|
-
self._btns[-1][-2].SetDefault()
|
45
|
+
self._btns[-1][-2].SetDefault()
|
45
46
|
|
46
47
|
self.Bind(wx.EVT_CHAR_HOOK, self.char_press)
|
47
48
|
self.btn_reset_memory.Bind(wx.EVT_BUTTON, lambda v: self._memory.clear())
|
48
|
-
|
49
|
+
|
49
50
|
self.SetSizer(self.pack([self._disp] + [self.pack(x) for x in self._btns] + [self.pack([self._comment, self.btn_reset_memory, self.memory])], orient=wx.VERTICAL))
|
50
51
|
|
51
52
|
self._disp.SetFocus()
|
52
53
|
|
54
|
+
icon = wx.Icon()
|
55
|
+
icon_path = Path(__file__).parent.parent / "apps/wolf_logo2.bmp"
|
56
|
+
icon.CopyFromBitmap(wx.Bitmap(str(icon_path), wx.BITMAP_TYPE_ANY))
|
57
|
+
self.SetIcon(icon)
|
58
|
+
|
53
59
|
self.Show()
|
54
60
|
|
55
61
|
def pack(self, items, orient=wx.HORIZONTAL):
|
@@ -57,11 +63,11 @@ class Calculator(wx.Frame):
|
|
57
63
|
sizer = wx.BoxSizer(orient)
|
58
64
|
sizer.AddMany((i, 1, wx.EXPAND|wx.ALL, 0) for i in items)
|
59
65
|
return sizer
|
60
|
-
|
66
|
+
|
61
67
|
@property
|
62
68
|
def command(self) -> str:
|
63
|
-
return self._disp.Value
|
64
|
-
|
69
|
+
return self._disp.Value
|
70
|
+
|
65
71
|
@command.setter
|
66
72
|
def command(self, value):
|
67
73
|
self._disp.Value = str(value)
|
@@ -70,16 +76,16 @@ class Calculator(wx.Frame):
|
|
70
76
|
@property
|
71
77
|
def comment(self) -> str:
|
72
78
|
return self._comment.Value
|
73
|
-
|
79
|
+
|
74
80
|
@comment.setter
|
75
81
|
def comment(self, value):
|
76
82
|
self._comment.Value = str(value)
|
77
83
|
|
78
84
|
def check_command(self) -> bool:
|
79
|
-
""" Check if the command is valid """
|
80
|
-
|
85
|
+
""" Check if the command is valid """
|
86
|
+
|
81
87
|
from ..PyDraw import draw_type
|
82
|
-
|
88
|
+
|
83
89
|
if '\n' in self.command:
|
84
90
|
self.evaluate_multilines()
|
85
91
|
return False
|
@@ -94,7 +100,7 @@ class Calculator(wx.Frame):
|
|
94
100
|
if self._mapviewer is not None:
|
95
101
|
id_arrays = self._mapviewer.get_list_keys(drawing_type=draw_type.ARRAYS,
|
96
102
|
checked_state=None)
|
97
|
-
|
103
|
+
|
98
104
|
for id_array in id_arrays:
|
99
105
|
self._memory[id_array] = self._mapviewer.get_obj_from_id(id_array, drawtype=draw_type.ARRAYS)
|
100
106
|
|
@@ -124,27 +130,27 @@ class Calculator(wx.Frame):
|
|
124
130
|
def evaluate(self, mem_last_command=True):
|
125
131
|
""" Evaluate the command """
|
126
132
|
from ..PyDraw import WolfArray, draw_type
|
127
|
-
|
133
|
+
|
128
134
|
if mem_last_command:
|
129
135
|
self._last_command = self.command
|
130
136
|
|
131
137
|
ret = self.check_command()
|
132
|
-
|
138
|
+
|
133
139
|
if ret:
|
134
140
|
args = {var:self._memory[var] for var in self._parsed_command.variables()}
|
135
141
|
res = self._parsed_command.evaluate(args)
|
136
142
|
|
137
143
|
if isinstance(res, dict):
|
138
|
-
|
144
|
+
|
139
145
|
comment = 'Storing\n'
|
140
|
-
|
146
|
+
|
141
147
|
for key, value in res.items():
|
142
148
|
self._memory[key] = value
|
143
149
|
comment += f'{key} = {value}\n'
|
144
|
-
|
150
|
+
|
145
151
|
self.comment = comment
|
146
152
|
self.command = ''
|
147
|
-
|
153
|
+
|
148
154
|
elif isinstance(res, str|int|float):
|
149
155
|
self.command = res
|
150
156
|
|
@@ -154,10 +160,10 @@ class Calculator(wx.Frame):
|
|
154
160
|
id = self.command
|
155
161
|
while id in ids:
|
156
162
|
id += '_'
|
157
|
-
|
163
|
+
|
158
164
|
self._mapviewer.add_object('array', newobj=res, id = id)
|
159
165
|
self.command = ''
|
160
|
-
|
166
|
+
|
161
167
|
return res
|
162
168
|
|
163
169
|
def char_press(self, e:wx.KeyEvent):
|
@@ -168,13 +174,13 @@ class Calculator(wx.Frame):
|
|
168
174
|
|
169
175
|
unicodekey = e.GetUnicodeKey()
|
170
176
|
key = e.GetKeyCode()
|
171
|
-
|
177
|
+
|
172
178
|
ctrl = e.ControlDown()
|
173
179
|
alt = e.AltDown()
|
174
180
|
shift= e.ShiftDown()
|
175
181
|
|
176
182
|
if unicodekey in egal_code:
|
177
|
-
if not shift :
|
183
|
+
if not shift :
|
178
184
|
self.evaluate()
|
179
185
|
return
|
180
186
|
|
@@ -186,4 +192,3 @@ class Calculator(wx.Frame):
|
|
186
192
|
elif key == '<': self.command =self._last_command
|
187
193
|
elif key == '=': self.evaluate()
|
188
194
|
else : self._disp.Value += key
|
189
|
-
|
wolfhece/pyviews.py
CHANGED
@@ -11,7 +11,8 @@ copying or distribution of this file, via any medium, is strictly prohibited.
|
|
11
11
|
import logging
|
12
12
|
|
13
13
|
from .drawing_obj import Element_To_Draw
|
14
|
-
from .wolf_array import WolfArray, WolfArrayMB, VERSION_RGB
|
14
|
+
from .wolf_array import WolfArray, WolfArrayMB, VERSION_RGB
|
15
|
+
from .PyPalette import wolfpalette
|
15
16
|
from .PyParams import Wolf_Param, key_Param, Type_Param
|
16
17
|
|
17
18
|
|
wolfhece/wolf_array.py
CHANGED
@@ -2503,6 +2503,8 @@ class Ops_Array(wx.Frame):
|
|
2503
2503
|
logging.warning(_('Please add points to vector or select another !'))
|
2504
2504
|
return
|
2505
2505
|
|
2506
|
+
logging.info(_('Select nodes inside the active polygon/vector...'))
|
2507
|
+
|
2506
2508
|
self._select_vector_inside_manager(self.active_vector)
|
2507
2509
|
self.refresh_array()
|
2508
2510
|
|
@@ -2528,9 +2530,11 @@ class Ops_Array(wx.Frame):
|
|
2528
2530
|
""" Select nodes along the active zone (manager) """
|
2529
2531
|
|
2530
2532
|
if self.active_zone is None:
|
2531
|
-
|
2533
|
+
logging.warning(_('Please activate a zone !'))
|
2532
2534
|
return
|
2533
2535
|
|
2536
|
+
logging.info(_('Select nodes along the active zone - all polylines...'))
|
2537
|
+
|
2534
2538
|
for curvec in self.active_zone.myvectors:
|
2535
2539
|
self._select_vector_under_manager(curvec)
|
2536
2540
|
|
@@ -2539,9 +2543,11 @@ class Ops_Array(wx.Frame):
|
|
2539
2543
|
def select_vector_under_manager(self):
|
2540
2544
|
""" Select nodes along the active vector (manager) """
|
2541
2545
|
if self.active_vector is None:
|
2542
|
-
|
2546
|
+
logging.warning(_('Please activate a vector !'))
|
2543
2547
|
return
|
2544
2548
|
|
2549
|
+
logging.info(_('Select nodes along the active polyline/vector...'))
|
2550
|
+
|
2545
2551
|
self._select_vector_under_manager(self.active_vector)
|
2546
2552
|
self.refresh_array()
|
2547
2553
|
|
@@ -2567,6 +2573,7 @@ class Ops_Array(wx.Frame):
|
|
2567
2573
|
""" Select nodes inside the temporary vector """
|
2568
2574
|
|
2569
2575
|
if self.mapviewer is not None:
|
2576
|
+
logging.info(_('Select nodes inside a temporary polygon/vector...'))
|
2570
2577
|
logging.info(_('Please add points to vector by clicks !'))
|
2571
2578
|
|
2572
2579
|
self.mapviewer.start_action('select by tmp vector inside', _('Please draw a polygon...'))
|
@@ -2581,9 +2588,9 @@ class Ops_Array(wx.Frame):
|
|
2581
2588
|
def select_vector_under_tmp(self):
|
2582
2589
|
""" Select nodes along the temporary vector """
|
2583
2590
|
if self.mapviewer is not None:
|
2591
|
+
logging.info(_('Select nodes along a temporary polygon/vector...'))
|
2584
2592
|
logging.info(_('Please add points to vector by clicks !'))
|
2585
2593
|
|
2586
|
-
|
2587
2594
|
self.mapviewer.start_action('select by tmp vector along', _('Please draw a polyline...'))
|
2588
2595
|
self.vectmp.reset()
|
2589
2596
|
self.Active_vector(self.vectmp)
|
@@ -3272,6 +3279,10 @@ class SelectionData():
|
|
3272
3279
|
myvect.find_minmax()
|
3273
3280
|
mypoints = self.parent.get_ij_under_polyline(myvect)
|
3274
3281
|
|
3282
|
+
if len(mypoints) == 0:
|
3283
|
+
logging.info(_('No nodes under the polyline'))
|
3284
|
+
return
|
3285
|
+
|
3275
3286
|
self._add_nodes_to_selectionij(mypoints, verif=nbini != 0)
|
3276
3287
|
|
3277
3288
|
if self.parent.myops is not None:
|
@@ -6784,6 +6795,9 @@ class WolfArray(Element_To_Draw, header_wolf):
|
|
6784
6795
|
|
6785
6796
|
allij = np.unique(allij, axis=0)
|
6786
6797
|
|
6798
|
+
# filter negative indexes
|
6799
|
+
allij = allij[np.where((allij[:, 0] >= 0) & (allij[:, 1] >= 0) & (allij[:, 0] < self.nbx) & (allij[:, 1] < self.nby))]
|
6800
|
+
|
6787
6801
|
if usemask:
|
6788
6802
|
mymask = np.logical_not(self.array.mask[allij[:, 0], allij[:, 1]])
|
6789
6803
|
allij = allij[np.where(mymask)]
|
@@ -4,10 +4,10 @@ wolfhece/GraphNotebook.py,sha256=2TR8qjEwpMtl34QWgYNVe_PgTnuwhUxT5f9Y2zrmN2U,282
|
|
4
4
|
wolfhece/GraphProfile.py,sha256=OCgJo0YFFBI6H1z-5egJsOOoWF_iziiza0-bbPejNMc,69656
|
5
5
|
wolfhece/Lidar2002.py,sha256=bX-nIzdpjD7rOfEgJpTeaW6rIdAXwDp_z4YTM9CgANY,6068
|
6
6
|
wolfhece/ManageParams.py,sha256=EeuUI5Vvh9ixCvYf8YShMC1s1Yacc7OxOCN7q81gqiQ,517
|
7
|
-
wolfhece/Model1D.py,sha256=
|
7
|
+
wolfhece/Model1D.py,sha256=iy9slhUvP5gXOhsAwjFhX83Rb9pMIDarkUAj9reNRCw,477027
|
8
8
|
wolfhece/PyConfig.py,sha256=FB8u0belXOXTb03Ln6RdVWvMgjzi3oGPCmw2dWa3lNg,8332
|
9
9
|
wolfhece/PyCrosssections.py,sha256=FnmM9DWY_SAF2EDH9Gu2PojXNtSTRF4-aYQuAAJXBh4,112771
|
10
|
-
wolfhece/PyDraw.py,sha256=
|
10
|
+
wolfhece/PyDraw.py,sha256=xn1yWjsNc5HOf9HAzLPlMG7YfB7xuO1dyIL7l0GePTE,411137
|
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
|
@@ -43,12 +43,12 @@ wolfhece/pydike.py,sha256=hPBQsmSTW4QAp1wcOzb-TL3L7eet2WT1sJx2q-WNQ-Q,2241
|
|
43
43
|
wolfhece/pylogging.py,sha256=4TI8hgBB65z-zpvU5Rfa2jkPXPhJaqXjHVPwbcdzTNc,4528
|
44
44
|
wolfhece/pypolygons_scen.py,sha256=x-tnYLNq3MPV51NbaU14trgRj8qyUyOrMdF1zDsUX3I,37444
|
45
45
|
wolfhece/pyshields.py,sha256=7k-qe2EJgr9fJE62jyPmlWQwRj8T0DK4iuMU844ZhYs,23281
|
46
|
-
wolfhece/pyviews.py,sha256=
|
46
|
+
wolfhece/pyviews.py,sha256=jFbjktYG-knwaqPzECuspZLesBcd40mptlaXqU_phfM,12585
|
47
47
|
wolfhece/pywalous.py,sha256=yRaWJjKckXef1d9D5devP0yFHC9uc6kRV4G5x9PNq9k,18972
|
48
48
|
wolfhece/rain_SPWMI.py,sha256=qCfcmF7LajloOaCwnTrrSMzyME03YyilmRUOqrPrv3U,13846
|
49
49
|
wolfhece/textpillow.py,sha256=map7HsGYML_o5NHRdFg2s_TVQed_lDnpYNDv27MM0Vw,14130
|
50
50
|
wolfhece/tools_mpl.py,sha256=gQ3Jg1iuZiecmMqa5Eli2ZLSkttu68VXL8YmMDBaEYU,564
|
51
|
-
wolfhece/wolf_array.py,sha256=
|
51
|
+
wolfhece/wolf_array.py,sha256=QmAcZNRMdGwqXRO3MsRMREYW_3ZdJ41i9gg4WMtAbLM,376746
|
52
52
|
wolfhece/wolf_hist.py,sha256=7jeVrgSkM3ErJO6SRMH_PGzfLjIdw8vTy87kesldggk,3582
|
53
53
|
wolfhece/wolf_texture.py,sha256=DS5eobLxrq9ljyebYfpMSQPn8shkUAZZVfqrOKN_QUU,16951
|
54
54
|
wolfhece/wolf_tiles.py,sha256=2Ho2I20rHRY81KXxjgLOYISdF4OkJ2d6omeY4shDoGI,10386
|
@@ -72,7 +72,7 @@ wolfhece/apps/check_install.py,sha256=Xoi_d8MzKzNAy2xqEpERdsqgRPu0hbBWukI0WkIYzD
|
|
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=
|
75
|
+
wolfhece/apps/version.py,sha256=9pKM_R-pqYp94pRjkkob738cc9PnIms77Dp-TKGaTB0,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
|
@@ -126,7 +126,7 @@ wolfhece/hydrology/read.py,sha256=itMat6MMn4Y14C3SMU_9JMBtpXFjG4mLNMfXXd5U6Ns,93
|
|
126
126
|
wolfhece/hydrology/slope_manager.py,sha256=vlek0z8qcqB61eleiksyOe3QR1vpbtwfeowy6ms7_Fg,5580
|
127
127
|
wolfhece/hydrology/wolfMap_treatment.py,sha256=eAxr24zJGwmDof1aZpcxewVvv_bWDvoO8t9Wwf99Mlo,10606
|
128
128
|
wolfhece/hydrometry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
129
|
-
wolfhece/hydrometry/kiwis.py,sha256=
|
129
|
+
wolfhece/hydrometry/kiwis.py,sha256=m3LGNxmB_ZY_ug-8BCM8jK_VqN6LtWRGpbPWtgRYFSE,46460
|
130
130
|
wolfhece/hydrometry/kiwis_gui.py,sha256=lApsSeBMJNAR1yocggdoHwz_xe6M_oaZ_E13CfHAlQA,23124
|
131
131
|
wolfhece/hydrometry/kiwis_wolfgui.py,sha256=GPa5YNp2V2ZlxYQjPiCXERgPuWB_zij4ec2yHpRvoFA,4027
|
132
132
|
wolfhece/hydrometry/kiwispie.py,sha256=akOaV46WwzISVlCcPz_phjsBrI_rDACUzdELtjx-xNg,13498
|
@@ -213,7 +213,7 @@ wolfhece/mar/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
213
213
|
wolfhece/mar/commontools.py,sha256=vCmoNI2sMOco6Y4KPpKb7WORq45qFU_lSxbKGV9oZ8A,53824
|
214
214
|
wolfhece/mar/interface_MAR_WOLF.py,sha256=MWeXaHLDT4Eo9jZOAvz013lmpgGYT1v9VUYGAgBgSRU,21454
|
215
215
|
wolfhece/math_parser/__init__.py,sha256=mrD_uFDDZzvyxQkY8ESqcy1bvM7e3__Gi2b_vijvoo8,27977
|
216
|
-
wolfhece/math_parser/calculator.py,sha256=
|
216
|
+
wolfhece/math_parser/calculator.py,sha256=VCXCT5zhyMSgkO5O8dwIhRht9NNBqA0h1QPliOD4N28,6046
|
217
217
|
wolfhece/mesh2d/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
218
218
|
wolfhece/mesh2d/bc_manager.py,sha256=QTGkb5TR8Y5xVnGUXPXzscGyTEQ6PA8CZPkVNwrlR1Y,53265
|
219
219
|
wolfhece/mesh2d/cell_tracker.py,sha256=mPmnD5lEf3gLPuLqtAIo-Gp-ipAwQdPxzjWOGt0b7jM,8958
|
@@ -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.
|
287
|
-
wolfhece-2.1.
|
288
|
-
wolfhece-2.1.
|
289
|
-
wolfhece-2.1.
|
290
|
-
wolfhece-2.1.
|
286
|
+
wolfhece-2.1.68.dist-info/METADATA,sha256=yFi2FGPJlzNBz_938XrVtCvrDzn2supoFh-NQY-fyLs,2570
|
287
|
+
wolfhece-2.1.68.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
288
|
+
wolfhece-2.1.68.dist-info/entry_points.txt,sha256=Q5JuIWV4odeIJI3qc6fV9MwRoz0ezqPVlFC1Ppm_vdQ,395
|
289
|
+
wolfhece-2.1.68.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
|
290
|
+
wolfhece-2.1.68.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|