Skip to content
Snippets Groups Projects
Commit 1232d2fc authored by Martyn Gigg's avatar Martyn Gigg
Browse files

Also catch IndexError for numpy array access with bool

v1.12 of numpy raises an IndexError of a scalar boolean is
given to access an array but this was reverted in later
versions. The behaviour should be essentially the same
as there is no mask so we add it to the existing exception
list.
Refs #27994
parent fb6803f1
No related branches found
No related tags found
No related merge requests found
......@@ -195,7 +195,7 @@ class ColorbarWidget(QWidget):
try:
self.cmin_value = data[~data.mask].min()
self.cmax_value = data[~data.mask].max()
except AttributeError:
except (AttributeError, IndexError):
self.cmin_value = np.nanmin(data)
self.cmax_value = np.nanmax(data)
except (ValueError, RuntimeWarning):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment