8000 Fix LightSource.shade on fully unmasked array. by QuLogic · Pull Request #17481 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix LightSource.shade on fully unmasked array. #17481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2020

Conversation

QuLogic
Copy link
Member
@QuLogic QuLogic commented May 21, 2020

PR Summary

In previous versions of NumPy, np.clip would expand the mask, but it no longer does so. Use np.ma.is_masked to check for a mask instead of hasattr, as the former also checks whether any values are actually masked.

Fixes #17455.

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • [N/A] New features are documented, with examples if plot related
  • [N/A] Documentation is sphinx and numpydoc compliant
  • [N/A] Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • [N/A] Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

In previous versions of NumPy, `np.clip` would expand the mask, but it
no longer does so. Use `np.ma.is_masked` to check for a mask instead of
`hasattr`, as the former also checks whether any *values* are actually
masked.

Fixes matplotlib#17455.
@dstansby dstansby merged commit 56d509f into matplotlib:master May 22, 2020
@QuLogic QuLogic deleted the masked-shading branch May 22, 2020 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LightSource.shade fails on a masked array
3 participants
0