Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 740b2a0

Browse files
committed
MNT: assert -> ValueError
1 parent 0d1dde7 commit 740b2a0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/mpl_toolkits/axes_grid1/axes_rgb.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,12 @@ def imshow_rgb(self, r, g, b, **kwargs):
203203
b : matplotlib.image.AxesImage
204204
"""
205205
ny, nx = r.shape
206-
assert((nx, ny) == g.shape == b.shape)
206+
if not ((nx, ny) == g.shape == b.shape):
207+
raise ValueError('Input shapes do not match.''
208+
'\nr.shape = {}'
209+
'\ng.shape = {}'
210+
'\nb.shape = {}'
211+
''.format(r.shape, g.shape, b.shape))
207212

208213
R = np.zeros([ny, nx, 3], dtype="d")
209214
R[:,:,0] = r

0 commit comments

Comments
 (0)