8000 Properly deprecate non-1D inputs to pie(). by anntzer · Pull Request #13354 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Properly deprecate non-1D inputs to pie(). #13354

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
Feb 7, 2019
Merged

Conversation

anntzer
Copy link
Contributor
@anntzer anntzer commented Feb 3, 2019

This PR also restores (... for the duration of the deprecation) the
support for non-1D inputs that can be squeezed to a 1D array that was
broken with numpy 1.16.

Closes #13286, although someone may want to additionally backport the fix (without the deprecations) to 3.0.x.

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

@anntzer anntzer added this to the v3.1 milestone Feb 3, 2019
@anntzer anntzer force-pushed the pie branch 2 times, most recently from 5f1b774 to 2a02d73 Compare February 3, 2019 23:44
@anntzer anntzer changed the title Properly deprecate non-1D or string inputs to pie(). Properly deprecate non-1D inputs to pie(). Feb 3, 2019
@@ -2725,7 +2725,7 @@ def pie(self, x, explode=None, labels=None, colors=None,

Parameters
----------
x : array-like
x : 1D array-like
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily needed. We generally assume array-like to be 1D if the parameter is semantically only 1D.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

edited back

x = np.array(x, np.float32)
# The use of float32 is "historical", but can't be changed without
# regenerating the test baselines.
x = np.asarray(x, np.float32)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be changed to float64, and only patched back in some way to float32 for the tests. But that's beyond this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems not worth the effort, frankly

This PR also restores (... for the duration of the deprecation) the
support for non-1D inputs that can be squeezed to a 1D array that was
broken with numpy 1.16.
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.

AttributeError: 'float' object has no attribute 'deg2rad'
3 participants
0