Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LINUX: Error when run model builder #37

Open
lhba87 opened this issue Feb 22, 2024 · 1 comment
Open

LINUX: Error when run model builder #37

lhba87 opened this issue Feb 22, 2024 · 1 comment

Comments

@lhba87
Copy link

lhba87 commented Feb 22, 2024

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
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants