TUFLOW-Support / QGIS-TUFLOW-Plugin

TUFLOW related QGIS Plugins
9 stars 7 forks source link

Error when trying to do Time-series plot with Points Layer #16

Closed ZedeN1 closed 4 years ago

ZedeN1 commented 4 years ago

Time series plot works fine with From Map and From Map Multi. When switching to Layer Selection and then pressing Plot Time Series From Map Output button I get the following error:

An error has occurred while executing Python code: 

TypeError: list indices must be integers or slices, not float 
Traceback (most recent call last):
  File "/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tuflow/tuflowqgis_tuviewer/tuflowqgis_tuplottoolbar.py", line 141, in 
    self.plotTSMenu.menuAction().triggered.connect(lambda: self.mapOutputPlottingButtonClicked(0))
  File "/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tuflow/tuflowqgis_tuviewer/tuflowqgis_tuplottoolbar.py", line 241, in mapOutputPlottingButtonClicked
    self.tuPlot.tuPlotSelection.useSelection(plotNo)
  File "/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tuflow/tuflowqgis_tuviewer/tuflowqgis_tuplotselection.py", line 157, in useSelection
    plot = self.plotTimeSeries(layer)
  File "/home/pavel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tuflow/tuflowqgis_tuviewer/tuflowqgis_tuplotselection.py", line 32, in plotTimeSeries
    featName = f.attributes()[iFeatName]
TypeError: list indices must be integers or slices, not float

Python version: 3.7.5rc1 (default, Oct  8 2019, 16:47:45) [GCC 9.2.1 20191008] 
QGIS version: 3.10.0-A Coruña A Coruña, 6c816b4204 

QGIS About:


QGIS version | 3.10.0-A Coruña | QGIS code revision | 6c816b4204
-- | -- | -- | --
Compiled against Qt | 5.12.4 | Running against Qt | 5.12.4
Compiled against GDAL/OGR | 2.4.2 | Running against GDAL/OGR | 2.4.2
Compiled against GEOS | 3.7.2-CAPI-1.11.2 | Running against GEOS | 3.7.2-CAPI-1.11.2 b55d2125
Compiled against SQLite | 3.29.0 | Running against SQLite | 3.29.0
PostgreSQL Client Version | 11.5 (Ubuntu 11.5-1) | SpatiaLite Version | 4.3.0a
QWT Version | 6.1.4 | QScintilla2 Version | 2.10.4
Compiled against PROJ | 5.2.0 | Running against PROJ | Rel. 5.2.0, September 15th, 2018
OS Version | Ubuntu 19.10
TUFLOW-Support commented 4 years ago

Thanks for the detailed comment. I wasn't able to replicate the issue but from the error message I think I found the offending line of code and I've made a change that will hopefully stop this error from happening. Can you please test it out and let me know if it's been fixed? - if so I will upload to the plugin repository.

You can install the latest version manually by downloading from github and replacing the files in the following location on Ubuntu: /home/USER/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tuflow

Thanks

ZedeN1 commented 4 years ago

All works now, thanks!