wolfhece 2.1.57__py3-none-any.whl → 2.1.59__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
@@ -586,6 +586,7 @@ class WolfMapViewer(wx.Frame):
586
586
  self.helpmenu = wx.Menu()
587
587
  self.helpmenu.Append(wx.ID_ANY, _('Shortcuts'), _('Shortcuts'))
588
588
  self.helpmenu.Append(wx.ID_ANY, _('About'), _('About'))
589
+ self.helpmenu.Append(wx.ID_ANY, _('Check for updates'), _('Update?'))
589
590
 
590
591
  self.menubar.Append(self.helpmenu, _('&Help'))
591
592
 
@@ -652,9 +653,11 @@ class WolfMapViewer(wx.Frame):
652
653
  # self.treelist.SetPosition((0,0))
653
654
 
654
655
  # fenêtre ToolTip
655
- self.mytooltip = Wolf_Param(self, "Values", to_read=False, withbuttons=False)
656
+ self.mytooltip = Wolf_Param(self, _("Data/Results"), to_read=False, withbuttons=False, toolbar=False)
656
657
  self.mytooltip.SetSize(300, 400)
658
+ self.mytooltip.prop.SetDescBoxHeight(20) # Hauteur de la zone de description
657
659
  self.mytooltip.Show(False)
660
+ self._oldpos_tooltip = None
658
661
 
659
662
  #Notebooks
660
663
  self.notebookcs = None
@@ -4410,6 +4413,11 @@ class WolfMapViewer(wx.Frame):
4410
4413
  #print About Frame
4411
4414
  self.print_About()
4412
4415
 
4416
+ elif itemlabel == _('Check for updates'):
4417
+ # check for new version
4418
+
4419
+ self.check_for_updates()
4420
+
4413
4421
  elif itemlabel == _("Integrate Q along active vector..."):
4414
4422
  """ Integrate Q along active vector """
4415
4423
 
@@ -7808,24 +7816,25 @@ class WolfMapViewer(wx.Frame):
7808
7816
 
7809
7817
  self.mytooltip.myparams.clear()
7810
7818
 
7819
+
7811
7820
  curgroup = 'Position'
7812
7821
  self.mytooltip.myparams[curgroup] = {}
7813
7822
 
7814
- curpar = 'Pixel'
7823
+ curpar = _('Pixel (col,row)')
7815
7824
  self.mytooltip.add_param(groupname = curgroup,
7816
7825
  name = curpar,
7817
7826
  value = '(' + str(pos[0]) + ' ; ' + str(pos[1]) + ')',
7818
7827
  type = Type_Param.String,
7819
7828
  comment = '')
7820
7829
 
7821
- curpar = 'Coordinate X'
7830
+ curpar = _('Coordinate X [m]')
7822
7831
  self.mytooltip.add_param(groupname = curgroup,
7823
7832
  name = curpar,
7824
7833
  value = '{:3f}'.format(x),
7825
7834
  type = Type_Param.String,
7826
7835
  comment = '')
7827
7836
 
7828
- curpar = 'Coordinate Y'
7837
+ curpar = _('Coordinate Y [m]')
7829
7838
  self.mytooltip.add_param(groupname = curgroup,
7830
7839
  name = curpar,
7831
7840
  value = '{:3f}'.format(y),
@@ -8130,21 +8139,48 @@ class WolfMapViewer(wx.Frame):
8130
8139
  self._update_mytooltip()
8131
8140
 
8132
8141
  if e.ControlDown():
8133
- self.mytooltip.SetWindowStyle(wx.STAY_ON_TOP)
8142
+ if self._oldpos_tooltip is None:
8143
+ # Store the position of the tooltip
8144
+ # Useful to restore it after CTRL is released
8145
+ self._oldpos_tooltip = self.mytooltip.GetPosition()
8146
+
8147
+ self.mytooltip.SetWindowStyle(wx.STAY_ON_TOP) # Just on top, without Title bar
8134
8148
  ttsize = self.mytooltip.GetSize()
8135
8149
  self.mytooltip.position(pos + posframe + (ttsize[0] / 2. + 15, 15))
8136
8150
  else:
8137
8151
 
8138
- self.mytooltip.SetWindowStyle(wx.DEFAULT_FRAME_STYLE)
8139
8152
  width, height = self.GetSize()
8140
8153
 
8141
- if self.IsFullScreen():
8142
- posframe[0] += width - self.mytooltip.GetSize()[0] - 10
8154
+ if self.IsMaximized():
8155
+ # Frame is maximized -> tooltip must be on the Screen
8156
+ self.mytooltip.SetWindowStyle(wx.STAY_ON_TOP)
8143
8157
  else:
8144
- if shiftdown:
8158
+
8159
+ if self._oldpos_tooltip is None:
8160
+ # No old position stored -> tooltip does not move
8161
+ pos_tooltip = self.mytooltip.GetPosition()
8162
+ else:
8163
+ # Restore the position of the tooltip
8164
+ pos_tooltip = self._oldpos_tooltip
8165
+
8166
+ # Reset the old position, so when CTRL is pressed again, the memory will be updated
8167
+ self._oldpos_tooltip = None
8168
+
8169
+ if shiftdown or (pos_tooltip[0] == 0 and pos_tooltip[1] == 0):
8170
+ # SHIFT is pressed or tooltip is at the top right corner of the Frame
8171
+ # or it is the first time the tooltip is displayed
8145
8172
  posframe[0] += width
8146
8173
  posframe[1] -= 50
8147
8174
  self.mytooltip.position(posframe)
8175
+ w, h = self.mytooltip.GetSize()
8176
+ self.mytooltip.SetSize((w, height))
8177
+
8178
+ else:
8179
+ # Force the position
8180
+ self.mytooltip.SetPosition(pos_tooltip)
8181
+
8182
+ self.mytooltip.SetIcon(self.GetIcon()) # update icon
8183
+ self.mytooltip.SetWindowStyle(wx.DEFAULT_FRAME_STYLE | wx.STAY_ON_TOP) # on top, with Title bar
8148
8184
 
8149
8185
  self.mytooltip.Show(True)
8150
8186
 
@@ -8358,6 +8394,27 @@ class WolfMapViewer(wx.Frame):
8358
8394
  dlg.ShowModal()
8359
8395
  dlg.Destroy()
8360
8396
 
8397
+ def check_for_updates(self):
8398
+ """ Check for updates """
8399
+ from .apps.version import WolfVersion
8400
+ import requests
8401
+
8402
+ current_version = str(WolfVersion())
8403
+ package_name = "wolfhece"
8404
+
8405
+ try:
8406
+ available_version = requests.get(f"https://pypi.org/pypi/{package_name}/json").json()["info"]["version"]
8407
+
8408
+ if available_version > current_version:
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:
8410
+ dlg.ShowModal()
8411
+ else:
8412
+ with wx.MessageDialog(None, _("You have the latest version."), _("Upgrade"), wx.OK | wx.ICON_INFORMATION) as dlg:
8413
+ dlg.ShowModal()
8414
+
8415
+ except Exception as e:
8416
+ logging.error("Package not found on PyPI. -- {}".format(e))
8417
+
8361
8418
  def print_shortcuts(self, inframe:bool = None):
8362
8419
  """ Print the list of shortcuts into logging """
8363
8420
 
wolfhece/PyParams.py CHANGED
@@ -282,7 +282,8 @@ class Wolf_Param(wx.Frame):
282
282
  DestroyAtClosing:bool = True,
283
283
  toShow:bool = True,
284
284
  init_GUI:bool = True,
285
- force_even_if_same_default:bool = False):
285
+ force_even_if_same_default:bool = False,
286
+ toolbar:bool = True):
286
287
  """
287
288
  Initialisation
288
289
 
@@ -325,7 +326,13 @@ class Wolf_Param(wx.Frame):
325
326
  self.sizer = None
326
327
 
327
328
  if self.wx_exists and init_GUI:
328
- self._set_gui(parent,title,w,h,ontop,to_read,withbuttons,DestroyAtClosing,toShow)
329
+ self._set_gui(parent,
330
+ title, w, h,
331
+ ontop, to_read,
332
+ withbuttons,
333
+ DestroyAtClosing,
334
+ toShow,
335
+ toolbar=toolbar)
329
336
 
330
337
  @property
331
338
  def has_prop(self) -> bool:
@@ -512,7 +519,8 @@ class Wolf_Param(wx.Frame):
512
519
  withbuttons:bool = True,
513
520
  DestroyAtClosing:bool = True,
514
521
  toShow:bool = True,
515
- full_style = False):
522
+ full_style = False,
523
+ toolbar:bool = True):
516
524
  """
517
525
  Set the GUI if wxPython is running
518
526
 
@@ -573,7 +581,7 @@ class Wolf_Param(wx.Frame):
573
581
  self.prop = pg.PropertyGridManager(self,
574
582
  style = pg.PG_BOLD_MODIFIED|pg.PG_SPLITTER_AUTO_CENTER|
575
583
  # Include toolbar.
576
- pg.PG_TOOLBAR |
584
+ pg.PG_TOOLBAR if toolbar else 0 |
577
585
  # Include description box.
578
586
  pg.PG_DESCRIPTION |
579
587
  pg.PG_TOOLTIPS |
@@ -591,7 +599,7 @@ class Wolf_Param(wx.Frame):
591
599
  self.prop = pg.PropertyGridManager(self,
592
600
  style = pg.PG_BOLD_MODIFIED|pg.PG_SPLITTER_AUTO_CENTER|
593
601
  # Include toolbar.
594
- pg.PG_TOOLBAR |
602
+ pg.PG_TOOLBAR if toolbar else 0 |
595
603
  # Include description box.
596
604
  pg.PG_DESCRIPTION |
597
605
  pg.PG_TOOLTIPS |
@@ -624,6 +632,11 @@ class Wolf_Param(wx.Frame):
624
632
  #affichage de la page
625
633
  self.Show(toShow)
626
634
 
635
+ def mask_toolbar(self):
636
+ """ Mask the toolbar """
637
+
638
+ self.prop.SetSt
639
+
627
640
  def _set_only_prop(self, wxparent):
628
641
  """ Set only the property grid """
629
642
 
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 = 57
8
+ self.patch = 59
9
9
 
10
10
  def __str__(self):
11
11
 
@@ -1238,7 +1238,7 @@ class UI_Manager_2D_GPU():
1238
1238
  """
1239
1239
 
1240
1240
  # frame creation
1241
- self._frame = wx.Frame(None, wx.ID_ANY, _('Scenario WOLF2D_GPU'), size=(800,800))
1241
+ self._frame = wx.Frame(self._parent.get_mapviewer(), wx.ID_ANY, _('Scenario WOLF2D_GPU'), size=(800,800))
1242
1242
 
1243
1243
  # sizers creation -- frame's structure
1244
1244
  sizer_updown = wx.BoxSizer(wx.VERTICAL)
@@ -1378,6 +1378,9 @@ class UI_Manager_2D_GPU():
1378
1378
  # link sizer to frame
1379
1379
  self._frame.SetSizer(sizer_updown)
1380
1380
 
1381
+ if self._parent.get_mapviewer() is not None:
1382
+ self._frame.SetIcon(self._parent.get_mapviewer().GetIcon())
1383
+
1381
1384
  # Layout
1382
1385
  self._frame.Layout()
1383
1386
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wolfhece
3
- Version: 2.1.57
3
+ Version: 2.1.59
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,12 +7,12 @@ 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=42kZbude0BSlpMfLPtcsUeYeCqzMj8AXVb5VuCHTK68,404422
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
14
14
  wolfhece/PyPalette.py,sha256=3ehK6H2PvqSe0zICR1HyNs6KQokR1DmnAh4LwYnLIcU,28009
15
- wolfhece/PyParams.py,sha256=wwgmP-_7wiiPLTcyX8a5jR6FyC1D2c4oBPc1VWQqtSA,97383
15
+ wolfhece/PyParams.py,sha256=Zxf3baM4TFNapcDqgrtM4IZ4vwCGVd3penwgwWUtG40,97775
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=MtZVjIWIi62QX_oqNosb56xPgjhOGVeGz-XsD82tsNg,40614
@@ -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=_LHTN6KB7_RiP0O4AhyTlsUdSaJH41BhhjQ7nNU0TWs,388
75
+ wolfhece/apps/version.py,sha256=tA7_i72bDZYG6L4Qv9KPr0XBBqbTMSvzbw-dQqInFCQ,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
@@ -260,7 +260,7 @@ wolfhece/report/reporting.py,sha256=JUEXovx_S4jpYkJEBU0AC-1Qw2OkkWyV3VAp6iOfSHc,
260
260
  wolfhece/report/wolf_report.png,sha256=NoSV58LSwb-oxCcZScRiJno-kxDwRdm_bK-fiMsKJdA,592485
261
261
  wolfhece/scenario/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
262
262
  wolfhece/scenario/check_scenario.py,sha256=w7_SST4n_uec-MUBK36gbJzz2KC8qT_bVJ_VNyp7cMo,4917
263
- wolfhece/scenario/config_manager.py,sha256=UzInaAtxmTLqUaXAHg17iLcUZRGTrPPLsj2D9kBs6wI,85468
263
+ wolfhece/scenario/config_manager.py,sha256=aZLfOdKCGva2lXVDAVQrn4nd9ONXHQ_ZNDcUcEIbkCo,85621
264
264
  wolfhece/scenario/imposebc_void.py,sha256=PqA_99hKcaqK5zsK6IRIc5Exgg3WVpgWU8xpwNL49zQ,5571
265
265
  wolfhece/scenario/update_void.py,sha256=ay8C_FxfXN627Hx46waaAO6F3ovYmOCTxseUumKAY7c,7474
266
266
  wolfhece/shaders/fragment_shader_texture.glsl,sha256=w6h8d5mJqFaGbao0LGmjRcFFdcEQ3ICIl9JpuT71K5k,177
@@ -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.57.dist-info/METADATA,sha256=DslVY-yNMyENi7ZMy3_8ZLIWIFU2Eua2Jdw4Z9eGEjg,2541
287
- wolfhece-2.1.57.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
288
- wolfhece-2.1.57.dist-info/entry_points.txt,sha256=Q5JuIWV4odeIJI3qc6fV9MwRoz0ezqPVlFC1Ppm_vdQ,395
289
- wolfhece-2.1.57.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
290
- wolfhece-2.1.57.dist-info/RECORD,,
286
+ wolfhece-2.1.59.dist-info/METADATA,sha256=X3RjuihrCfVi71hIMjsOGCQl-cBhMsT6SlqZORsFSyk,2541
287
+ wolfhece-2.1.59.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
288
+ wolfhece-2.1.59.dist-info/entry_points.txt,sha256=Q5JuIWV4odeIJI3qc6fV9MwRoz0ezqPVlFC1Ppm_vdQ,395
289
+ wolfhece-2.1.59.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
290
+ wolfhece-2.1.59.dist-info/RECORD,,