Skip to content

Commit

Permalink
Revert back usage of full_like to support older numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanv committed Jan 31, 2016
1 parent 31b6adb commit 6d103b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions skimage/draw/draw.py
Expand Up @@ -179,8 +179,10 @@ def set_color(img, coords, color, alpha=1):
img.shape[-1]))

if np.isscalar(alpha):
alpha = np.full_like(rr, alpha, dtype=float)

# Can be replaced by ``full_like`` when numpy 1.8 becomes
# minimum dependency
alpha = np.ones_like(rr) * alpha

rr, cc, alpha = _coords_inside_image(rr, cc, img.shape, val=alpha)

alpha = alpha[..., np.newaxis]
Expand Down

0 comments on commit 6d103b5

Please sign in to comment.