TUFLOW-Support / QGIS-TUFLOW-Plugin

TUFLOW related QGIS Plugins
9 stars 7 forks source link

LINUX: Error when run model builder #37

Open lhba87 opened 4 months ago

lhba87 commented 4 months ago

Good afternoon. I am trying to create the initial conditions for swan model using the TUFLOW plugin. But I am getting an error in python-datetime.

An error has occurred while executing Python code:

TypeError: unsupported operand type(s) for -: 'int' and 'datetime.datetime' Traceback (most recent call last):using File "/home/alves/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tuflow/swangis/swangis/ui.py", line 1435, in buildRun builder.buildRun(timeStart, timeEnd) File "/home/alves/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tuflow/swangis/swangis/swan.py", line 970, in buildRun writer(self.windSource, model.windFile, model) File "/home/alves/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tuflow/swangis/swangis/swan.py", line 1110, in >writeWindGridBc t = t * 3600 + datenum((1900, 1, 1)) ^^^^^^^^^^^^^^^^^^^^^ File "/home/alves/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tuflow/swangis/swangis/mdatetime.py", line 143, in datenum delta = in_array[ii] - epoch


TypeError: unsupported operand type(s) for -: 'int' and 'datetime.datetime'

Python version: 3.11.6 (main, Nov 14 2023, 09:36:21) [GCC 13.2.1 20230801] 
QGIS version: 3.34.3-Prizren Prizren, exported 
Mitch3007 commented 3 months ago

Hi lhba87 and @TUFLOW-Support,

I’ve made some recent fixes to enforce the date format entered on the Swan Model Builder dialogue but I haven't yet pushed these across to GitHub. It may not fix your specific issue, but could you please try the following for me:

  1. Close QGIS
  2. Download https://downloads.tuflow.com/Private_Download/swangis.zip
  3. Extract the swangis folder and copy over the contents of the folder "/home/alves/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tuflow/
  4. Open QGIS back up and try to build you SWAN model.

In the next few weeks we’ll roll these changes into the official TUFLOW Plugin download, so you won’t need to do this manual fix.

Please let me know if it works, or otherwise, and I’ll aim to get you back up and running.