8000 Avoid some uses of np.isscalar. by anntzer · Pull Request #12070 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Avoid some uses of np.isscalar. #12070

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
Sep 9, 2018
Merged

Conversation

anntzer
Copy link
Contributor
@anntzer anntzer commented Sep 8, 2018

The numpy docs suggest that checking ndim > 0 is usually better. In the
cases here, though, we can just broadcast directly.

(https://www.numpy.org/devdocs/reference/generated/numpy.isscalar.html)

PR Summary

PR Checklist

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

The numpy docs suggest that checking ndim > 0 is usually better.  In the
cases here, though, we can just broadcast directly.
@WeatherGod
Copy link
Member

probably could make codecov happy by putting in some quick tests to make sure that bad inputs still raise ValueError. Otherwise, this is good.

@anntzer
Copy link
Contributor Author
anntzer commented Sep 9, 2018

Nah, I'll pass on that.

@QuLogic QuLogic added this to the v3.1 milestone Sep 9, 2018
@QuLogic QuLogic merged commit 805370b into matplotlib:master Sep 9, 2018
@anntzer anntzer deleted the isscalar branch September 9, 2018 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0