FLO-2DSoftware / qgis-flo-2d-plugin

A plugin for pre-processing/post-processing FLO-2D models
5 stars 7 forks source link

Plugin deprecation Warnings #1351

Closed FLO-2DKaren closed 1 month ago

FLO-2DKaren commented 1 month ago

As of QGIS 3.36.3, these are the deprecation warnings.

2024-05-24T15:46:08 WARNING warning:C:\Users\Karen\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\flo2d\deps\pyqtgraph-0.13.3-py3-none-any.whl\pyqtgraph\graphicsItems\DateAxisItem.py:22: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC). _epoch = datetime.utcfromtimestamp(0)

         traceback: File "", line 1, in 
          File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 446, in startPlugin
          if not _startPlugin(packageName):
          File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 426, in _startPlugin
          plugins[packageName] = package.classFactory(iface)
          File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\__init__.py", line 19, in classFactory
          from .flo2d import Flo2D
          File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 923, in _import
          mod = _builtin_import(name, globals, locals, fromlist, level)
          File "", line 1360, in _find_and_load
          File "", line 1331, in _find_and_load_unlocked
          File "", line 935, in _load_unlocked
          File "", line 995, in exec_module
          File "", line 488, in _call_with_frames_removed
          File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\flo2d.py", line 99, in 
          from .gui import dlg_settings, f2d_main_widget
          File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 923, in _import
          mod = _builtin_import(name, globals, locals, fromlist, level)
          File "", line 1415, in _handle_fromlist
          File "", line 488, in _call_with_frames_removed
          File "", line 1360, in _find_and_load
          File "", line 1331, in _find_and_load_unlocked
          File "", line 935, in _load_unlocked
          File "", line 995, in exec_module
          File "", line 488, in _call_with_frames_removed
          File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\gui\f2d_main_widget.py", line 23, in 
          from .profile_tool import ProfileTool
          File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 923, in _import
          mod = _builtin_import(name, globals, locals, fromlist, level)
          File "", line 1360, in _find_and_load
          File "", line 1331, in _find_and_load_unlocked
          File "", line 935, in _load_unlocked
          File "", line 995, in exec_module
          File "", line 488, in _call_with_frames_removed
          File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\gui\profile_tool.py", line 25, in 
          from .xs_editor_widget import XsecEditorWidget
          File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 923, in _import
          mod = _builtin_import(name, globals, locals, fromlist, level)
          File "", line 1360, in _find_and_load
          File "", line 1331, in _find_and_load_unlocked
          File "", line 935, in _load_unlocked
          File "", line 995, in exec_module
          File "", line 488, in _call_with_frames_removed
          File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\gui\xs_editor_widget.py", line 66, in 
          from .plot_widget import PlotWidget
          File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 923, in _import
          mod = _builtin_import(name, globals, locals, fromlist, level)
          File "", line 1360, in _find_and_load
          File "", line 1331, in _find_and_load_unlocked
          File "", line 935, in _load_unlocked
          File "", line 995, in exec_module
          File "", line 488, in _call_with_frames_removed
          File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\gui\plot_widget.py", line 17, in 
          from ..deps import safe_pyqtgraph as pg
          File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 923, in _import
          mod = _builtin_import(name, globals, locals, fromlist, level)
          File "", line 1415, in _handle_fromlist
          File "", line 488, in _call_with_frames_removed
          File "", line 1360, in _find_and_load
          File "", line 1331, in _find_and_load_unlocked
          File "", line 935, in _load_unlocked
          File "", line 995, in exec_module
          File "", line 488, in _call_with_frames_removed
          File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\deps\safe_pyqtgraph.py", line 9, in 
          from pyqtgraph import *
          File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 923, in _import
          mod = _builtin_import(name, globals, locals, fromlist, level)
          File "", line 1360, in _find_and_load
          File "", line 1331, in _find_and_load_unlocked
          File "", line 935, in _load_unlocked
          File "", line 995, in exec_module
          File "", line 488, in _call_with_frames_removed
          File "C:\Users\Karen\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\flo2d\deps\pyqtgraph-0.13.3-py3-none-any.whl\pyqtgraph\__init__.py", line 210, in 
          from .graphicsItems.DateAxisItem import *
          File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 923, in _import
          mod = _builtin_import(name, globals, locals, fromlist, level)
          File "", line 1360, in _find_and_load
          File "", line 1331, in _find_and_load_unlocked
          File "", line 935, in _load_unlocked
          File "", line 995, in exec_module
          File "", line 488, in _call_with_frames_removed
          File "C:\Users\Karen\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\flo2d\deps\pyqtgraph-0.13.3-py3-none-any.whl\pyqtgraph\graphicsItems\DateAxisItem.py", line 22, in 
          _epoch = datetime.utcfromtimestamp(0)
rpachaly commented 1 month ago

This deprecation issue is related to the version of pyqtgraph we currently use (13.3). I've changed it to the latest version (13.7) and these warnings are not showing up anymore.

However, the plotting grids are a little different between these two version. I added some opacity to make them look better. See:

13.3 (current version) image

13.7 (updated version) image

I did some testing and all looks good. The pull request is https://github.com/FLO-2DSoftware/qgis-flo-2d-plugin/pull/1355.

FLO-2DKaren commented 1 month ago

No problems here