Prevent element-wise string comparison
Issue #835 shows that comparing `bins`, which may be a numpy array, with a string `'auto'` leads to element-wise comparison, because the `==` operator for numpy arrays is used. With this commit, potential array and string are switched, so the `==` operator for strings is used, which does no element-wise comparison.
This commit is contained in:
parent
7b47337eaf
commit
4a592ef10e
@ -488,7 +488,7 @@ class ImageItem(GraphicsObject):
|
||||
step = (step, step)
|
||||
stepData = self.image[::step[0], ::step[1]]
|
||||
|
||||
if bins == 'auto':
|
||||
if 'auto' == bins:
|
||||
mn = np.nanmin(stepData)
|
||||
mx = np.nanmax(stepData)
|
||||
if mx == mn:
|
||||
|
Loading…
Reference in New Issue
Block a user