Skip to content

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

Merged
jklymak merged 1 commit into
matplotlib:masterfrom
anntzer:pie
Feb 7, 2019
Merged

jklymak merged 1 commit into
matplotlib:masterfrom
anntzer:pie

Conversation

@anntzer

@anntzer anntzer commented Feb 3, 2019

Copy link
Copy Markdown
Contributor

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
Comment thread lib/matplotlib/axes/_axes.py Outdated
Parameters
----------
x : array-like
x : 1D array-like

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.
@jklymak jklymak added the API: argument checking Validation of acceptable argument values label Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API: argument checking Validation of acceptable argument values

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: 'float' object has no attribute 'deg2rad'

3 participants