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

An error has occurred while executing Python code - GQF #566

Open
biglimp opened this issue Oct 30, 2023 Discussed in #565 · 2 comments
Open

An error has occurred while executing Python code - GQF #566

biglimp opened this issue Oct 30, 2023 Discussed in #565 · 2 comments
Assignees

Comments

@biglimp
Copy link
Contributor

biglimp commented Oct 30, 2023

Discussed in #565

Originally posted by 030Skript October 30, 2023
Hello all,

I wanted to use the GQF module for my master thesis. While trying to start the tutorial, I encountered the following problem on 2 different computers (Windows 10). After installing UMEP (4.0.2) for QGIS (3.34) and downloading the following packages, I prepared the data sources and clicked on "Prepare input data via data sources" and after a few seconds I got:

An error has occurred while executing Python code

IndexError: list index out of range 
Traceback (most recent call last):
  File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\GreaterQF\greater_qf.py", line 192, in disaggregate
    processed = self.model.processInputData()
  File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\GreaterQF\PythonQF2\GreaterQF.py", line 105, in processInputData
    processedPath = disaggregate(
  File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\GreaterQF\PythonQF2\Disaggregate.py", line 72, in disaggregate
    bldgEnergy.setIndustrialElec(ie['shapefile'],
  File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\GreaterQF\PythonQF2\EnergyUseData.py", line 76, in setIndustrialElec
    return self.indElec.addInput(input, startTime, attributeToUse, inputFieldId, weight_by=weight_by, epsgCode=epsgCode)
  File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\GreaterQF\PythonQF2\DataManagement\SpatialTemporalResampler.py", line 448, in addInput
    return self.dealWithVectorLayer(input, epsgCode, startTime, attributeToUse, weight_by, inputFieldId)
  File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\GreaterQF\PythonQF2\DataManagement\SpatialTemporalResampler.py", line 168, in dealWithVectorLayer
    resampled = self.resampleLayer(vectorLayer, attributeToUse, weight_by, inputIdField)
  File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\GreaterQF\PythonQF2\DataManagement\SpatialTemporalResampler.py", line 325, in resampleLayer
    if sameFeatures(inputLayer, self.outputLayer):
  File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\GreaterQF\PythonQF2\DataManagement\spatialHelpers.py", line 913, in sameFeatures
    infeat = layer1.selectedFeatures()[0]
IndexError: list index out of range

version info:

Python-Version: 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] 
QGIS-Version: 3.34.0-Prizren Prizren, ffbdd67881 

Python-Pfad:
C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\SUEWSPrepare/Modules
C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep
C:/OSGeo4W/apps/qgis/./python
C:/Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/OSGeo4W/apps/qgis/./python/plugins
C:\OSGeo4W\apps\grass\grass83\etc\python
C:\Users\User\Documents
C:\OSGeo4W\bin\python39.zip
C:\OSGeo4W\apps\Python39\DLLs
C:\OSGeo4W\apps\Python39\lib
C:\OSGeo4W\bin
C:\Users\User\AppData\Roaming\Python\Python39\site-packages
C:\OSGeo4W\apps\Python39
C:\OSGeo4W\apps\Python39\lib\site-packages
C:\OSGeo4W\apps\Python39\lib\site-packages\win32
C:\OSGeo4W\apps\Python39\lib\site-packages\win32\lib
C:\OSGeo4W\apps\Python39\lib\site-packages\Pythonwin
C:/Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python

So, now that I've tried it on my PC and have the same problem, I hope you guys have a solution to this issue? After pressing the button once, I can no longer use it and have to restart QGIS.

@biglimp
Copy link
Contributor Author

biglimp commented Oct 30, 2023

Hi,
I transferred this to the issue section as this most likely is a bug. The last known time the GQF tool was working was QGIS version 3.2. Since then, QGIS has been updated multiple times and this is probably the reason of your issue. Since we do not have any one person working with GQF within our development team, I am not sure we can help you to fix this issue in the near future.

@030Skript
Copy link

Hey, thanks for the reply. That's pretty unfortunate for me. Does no one else have any suggestions?

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

4 participants