-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a950ea5
to
9fced56
Compare
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
These two classes have historically sometimes been imported from incorrect | ||
locations. This is now deprecated and `.TextPath` should be imported from |
There was a problem hiding this comment.
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 the text
module. - Which would long-term mean making textpath
private, or moving the contents to text directly.
There's also the alternative to just not bother if we have no clearly better solution.
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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 that TextPath
is documented as being in text
and not in textpath
? https://matplotlib.org/devdocs/api/textpath_api.html
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #23576 for the textpath
module.
There was a problem hiding this comment.
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
I have to think about this. Let's target 3.7. |
Closed in favor of #23576 which picks |
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 to
axisartist/__init__.py
and encouraging importing from there...)PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).