Warnings in Spectral Viewer
Using enmapboxplugin.3.10.20220119T091443.develop
As soon as I move the color bars, I get:
2022-01-20T09:09:52 WARNING warning:/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py:3668: DeprecationWarning:
an integer is required (got type float). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
traceback: File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py", line 3583, in onRendererLayerChanged
mBand.setBand(bandNo)
File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py", line 3668, in onRendererBandChanged
vmin, vmax = layer.dataProvider().cumulativeCut(
File "/usr/lib/python3.9/warnings.py", line 109, in _showwarnmsg
sw(msg.message, msg.category, msg.filename, msg.lineno,
2022-01-20T09:10:42 WARNING warning:/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py:3668: DeprecationWarning:
an integer is required (got type float). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
traceback: File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/widgets/GraphicsView.py", line 350, in mouseReleaseEvent
super().mouseReleaseEvent(ev)
File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/GraphicsScene/GraphicsScene.py", line 233, in mouseReleaseEvent
if self.sendDragEvent(ev, final=True):
File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/GraphicsScene/GraphicsScene.py", line 353, in sendDragEvent
self.dragItem.mouseDragEvent(event)
File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/graphicsItems/InfiniteLine.py", line 403, in mouseDragEvent
self.sigPositionChangeFinished.emit(self)
File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py", line 3620, in onRendererBarChanged
self.mRendererRedBand.setBand(bandNo)
File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py", line 3668, in onRendererBandChanged
vmin, vmax = layer.dataProvider().cumulativeCut(
File "/usr/lib/python3.9/warnings.py", line 109, in _showwarnmsg
sw(msg.message, msg.category, msg.filename, msg.lineno,
2022-01-20T09:14:02 WARNING warning:/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py:3707: DeprecationWarning:
an integer is required (got type float). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
traceback: File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/widgets/GraphicsView.py", line 350, in mouseReleaseEvent
super().mouseReleaseEvent(ev)
File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/GraphicsScene/GraphicsScene.py", line 233, in mouseReleaseEvent
if self.sendDragEvent(ev, final=True):
File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/GraphicsScene/GraphicsScene.py", line 353, in sendDragEvent
self.dragItem.mouseDragEvent(event)
File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/graphicsItems/InfiniteLine.py", line 403, in mouseDragEvent
self.sigPositionChangeFinished.emit(self)
File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py", line 3624, in onRendererBarChanged
self.mRendererBlueBand.setBand(bandNo)
File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py", line 3707, in onRendererBandChanged
vmin, vmax = layer.dataProvider().cumulativeCut(
File "/usr/lib/python3.9/warnings.py", line 109, in _showwarnmsg
sw(msg.message, msg.category, msg.filename, msg.lineno,
Comments (12)
-
-
reporter I get:
2022-01-20T10:37:04 WARNING warning:/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py:3668: DeprecationWarning:
an integer is required (got type float). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
traceback: File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py", line 3583, in onRendererLayerChanged
mBand.setBand(bandNo)
File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py", line 3668, in onRendererBandChanged
vmin, vmax = layer.dataProvider().cumulativeCut(
File "/usr/lib/python3.9/warnings.py", line 109, in _showwarnmsg
sw(msg.message, msg.category, msg.filename, msg.lineno, -
So nothing changed, right?
Please try to also cast the sampleSize: int(QgsRasterLayer.SAMPLE_SIZE) -
reporter Fixed!
-
-
- changed status to resolved
resolves
#932→ <<cset 12caa6b295ec>>
-
reporter Another one. This one might be related to the image displaying not being updated when moving the color bars:
2022-01-21T14:44:14 WARNING warning:/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/graphicsItems/ViewBox/ViewBoxMenu.py:120: DeprecationWarning:
an integer is required (got type float). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python. traceback: File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/widgets/GraphicsView.py", line 144, in paintEvent return super().paintEvent(ev) File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/graphicsItems/ViewBox/ViewBox.py", line 1611, in paint self.prepareForPaint() File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/graphicsItems/ViewBox/ViewBox.py", line 301, in prepareForPaint self.updateAutoRange() File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/graphicsItems/ViewBox/ViewBox.py", line 927, in updateAutoRange self.setRange(**args) File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/graphicsItems/ViewBox/ViewBox.py", line 631, in setRange self.sigStateChanged.emit(self) File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/graphicsItems/ViewBox/ViewBoxMenu.py", line 102, in viewStateChanged self.updateState() File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/graphicsItems/ViewBox/ViewBoxMenu.py", line 120, in updateState self.ctrl[i].autoPercentSpin.setValue(state['autoRange'][i]*100) File "/usr/lib/python3.9/warnings.py", line 109, in _showwarnmsg sw(msg.message, msg.category, msg.filename, msg.lineno,
-
- changed status to open
-
- changed milestone to 3.10 (Hotfix)
-
assigned issue to
-
- changed status to closed
Will close this here. For more warnings, open an issue in GitHub.
-
reporter I can’t remember how to get the 3 bars to define the raster composite from the spectrum…
-
This button:
- Log in to comment
I didn’t get those warnings on my Windows system.
Would be helpful, if you could manually edit the code. Replace the bandNo with an int(bandNo):
Does that work?