It would seem that SceneCanvas.elements_at (naturally) throws a ZeroDivisionError, crashing python, when the contrast range is zero. This can happen when the dataset only contains a single value (example below). As this method is called from data interrogation (during hovering), this can cause unexpected crashes.
I'm not sure whether this is a vispy bug, or whether it's something we should handle here. I lean towards the former but would appreciate others' opinions.
Description
It would seem that
SceneCanvas.elements_at
(naturally) throws aZeroDivisionError
, crashing python, when the contrast range is zero. This can happen when the dataset only contains a single value (example below). As this method is called from data interrogation (during hovering), this can cause unexpected crashes.I'm not sure whether this is a vispy bug, or whether it's something we should handle here. I lean towards the former but would appreciate others' opinions.
What I Did
Here's the code for a minimal example:
Steps to reproduce the crash: