Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Deprecate incorrect import locations#23565

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
oscargus wants to merge1 commit intomatplotlib:mainfromoscargus:importlocation

Conversation

oscargus
Copy link
Member

PR Summary

Related to#23554

TextPath has based on the comment been imported fromtext earlier.AxislineStyle does not have such a comment, but is related enough to guess that there may be code importing fromaxislines rather thanaxisline_style. So to be on the safe side.

(One should possibly add that toaxisartist/__init__.py and encouraging importing from there...)

PR Checklist

Tests and Styling

  • [N/A] Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • [N/A] New features are documented, with examples if plot related.
  • [N/A] New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).
  • [N/A] Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

These two classes have historically sometimes been imported from incorrect
locations. This is now deprecated and `.TextPath` should be imported from
Copy link
Member

@timhoffmtimhoffmAug 6, 2022
edited
Loading

Choose a reason for hiding this comment

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

I'm not sure we should do this. If we deprecate we break a lot of user code eventually.

https://github.com/search?q=%22from+matplotlib.textpath+import+TextPath%22&type=code
textpath -> 825 hits

https://github.com/search?q=%22from+matplotlib.text+import+TextPath%22&type=code
text -> 1783 hits

Could do a pending deprecation.

I also don't know which way I would deprecate. Sure, TextPath is in TextPath (alongside with TextToPath). But is it really necessary to have that many modules as API surface. I can see an argument that these are text-like enough to be accessed via thetext module. - Which would long-term mean makingtextpath private, or moving the contents to text directly.

There's also the alternative to just not bother if we have no clearly better solution.

Copy link
Contributor

@anntzeranntzerAug 6, 2022
edited
Loading

Choose a reason for hiding this comment

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

Agreed that if we really want to pick one module (which is not clear), I'd rather make text the "official" one.
Perhaps the same argument applies to axisline_style, in fact...

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

OK! But then maybe we should at least make sure thatTextPath is documented as being intext and not intextpath?https://matplotlib.org/devdocs/api/textpath_api.html

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

textpath was made its own module in 2009. Although it doesn't really mean that it was fullt used for its purposes.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

See#23576 for thetextpath module.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

As a preparation for the dev call:

textpath 25 hits (5 matplotlib, 8 Visualization book)
https://grep.app/search?q=from%20matplotlib.textpath%20import%20TextPath

text 13 hits (3 matplotlib, 3 matplotlib-cn, 4 Visualization book)
https://grep.app/search?q=from%20matplotlib.text%20import%20TextPath

@timhoffm
Copy link
Member

I have to think about this. Let's target 3.7.

@timhoffmtimhoffm added the status: needs comment/discussionneeds consensus on next step labelAug 19, 2022
@timhoffmtimhoffm added this to thev3.7.0 milestoneAug 19, 2022
@tacaswelltacaswell removed this from thev3.7.0 milestoneDec 16, 2022
@tacaswell
Copy link
Member

Closed in favor of#23576 which picksmatplotlib.text as the canonical "correct" import location .

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@anntzeranntzeranntzer left review comments

@timhoffmtimhoffmtimhoffm left review comments

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@oscargus@timhoffm@tacaswell@anntzer

[8]ページ先頭

©2009-2025 Movatter.jp