Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Deprecate TextWithDash. #13548

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
Mar 1, 2019
Merged

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Feb 28, 2019

TextWithDash appears to be an ancestral version of Annotation that was
added over two commits in 2005 (6a4d343, fe80816), revised once in 2006
and another time in 2008, and never touched since then.

While it "works", its implementation is 400 lines long, it is only
mentioned by a single example (dashpointlabel.py), somewhat complicates
Axes.text() (#12215), and is likely rarely used and replaceable by Annotation for
most use cases.

Hence, deprecate it, keeping open the option to undeprecate if this
turns out to be too disruptive. (I suggest to get the deprecation in 3.1
to give longer notice to users; I don't mind a longer deprecation period
(in numbers of minor releases) here.)

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.0 milestone Feb 28, 2019
Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me.

Copy link
Member

@dstansby dstansby left a comment

Choose a reason for hiding this comment

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

Test failures look real.

@anntzer
Copy link
Contributor Author

anntzer commented Feb 28, 2019

good catch, should be fixed now (it was due to an awkward interaction between delete_parameter and the pyplot wrapper for text()).

@dstansby dstansby dismissed their stale review February 28, 2019 21:19

Tests fixed

@ImportanceOfBeingErnest
Copy link
Member

What do you intend to do with the example that uses this functionality? Rewrite in terms of annotate? Remove completely? Just sgskip-it for now? Let someone else deal with the warnings in the doc-build?

TextWithDash appears to be an ancestral version of Annotation that was
added over two commits in 2005 (6a4d343, fe80816), revised once in 2006
and another time in 2008, and never touched since then.

While it "works", its implementation is 400 lines long, it is only
mentioned by a single example (dashpointlabel.py), somewhat complicates
Axes.text(), and is likely rarely used and replaceable by Annotation for
most use cases.

Hence, deprecate it, keeping open the option to undeprecate if this
turns out to be too disruptive.
@anntzer
Copy link
Contributor Author

anntzer commented Mar 1, 2019

I added a filter to hide the warning from the example output, but have it in the generated plot instead. I'd just delete the example once withdash goes away; there's more than enough annotate() examples lying around.

@ImportanceOfBeingErnest ImportanceOfBeingErnest merged commit e0d3129 into matplotlib:master Mar 1, 2019
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Mar 1, 2019
@anntzer anntzer deleted the dashless branch March 1, 2019 11:36
dstansby added a commit that referenced this pull request Mar 1, 2019
…548-on-v3.1.x

Backport PR #13548 on branch v3.1.x (Deprecate TextWithDash.)
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.

4 participants