Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

error when importing weather station into SWAT+ editor

29 views
Skip to first unread message

Ilham Mrabt

unread,
Jan 6, 2025, 11:26:57 AMJan 6
to SWAT+ Editor

Hello everyone,

I’m getting an error while trying to import data into SWAT+. I have a total of 14 stations in my dataset. Could anyone please advise me on how to resolve this issue? Thank you in advance for your help

error :
Traceback (most recent call last):
  File "peewee.py", line 7253, in get
  File "peewee.py", line 4553, in __getitem__
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "actions\import_weather.py", line 327, in add_weather_files_type
  File "peewee.py", line 6805, in get
  File "peewee.py", line 7256, in get
database.project.climate.Weather_fileDoesNotExist: <Model: Weather_file> instance matching query does not exist:
SQL: SELECT "t1"."id", "t1"."filename", "t1"."type", "t1"."lat", "t1"."lon" FROM "weather_file" AS "t1" WHERE (("t1"."filename" = ?) AND ("t1"."type" = ?)) LIMIT ? OFFSET ?
Params: ['SUB1.pcp', 'pcp', 1, 0]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "swatplus_api.py", line 107, in <module>
  File "actions\import_weather.py", line 124, in import_data
  File "actions\import_weather.py", line 256, in add_weather_files
  File "actions\import_weather.py", line 338, in add_weather_files_type
ValueError: could not convert string to float: '\x00'
[11236] Failed to execute script 'swatplus_api' due to unhandled exception!

Jaclyn Tech

unread,
Jan 6, 2025, 12:10:46 PMJan 6
to SWAT+ Editor
Double check your files, make sure there are no extraneous characters and that they are saved in UTF-8 encoding.

This error indicates there is an issue with extra characters somewhere: " ValueError: could not convert string to float: '\x00'"

Then the first error is saying that your have a  SUB1.pcp file, but that it doesn't exist in your directory. But this could be occurring due to the other error.
Reply all
Reply to author
Forward
0 new messages