Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Deprecate internal functions exposed in the public API of mplot3d#13030
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| ```````````` | ||
| Multiple internal functions that were exposed as part of the public API | ||
| of ``mpl_toolkits.mplot3d`` are deprecated. |
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.
Please list them all.
timhoffm left a comment
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.
Looks, good. Approved conditionally; as@QuLogic mentioned, all deprecated functions must be listed explicitly in the deprecation note.
tacaswell left a comment
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 am only requesting changes to make sure@WeatherGod has a chance to review this.
@WeatherGod should dismiss this review.
| return_proj_transform_vec(vec,M) | ||
| def_proj_transform_vec_clip(vec,M): |
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.
These deprecations might be a bit problematic. IIRC, some of these functions in proj3d.py are used elsewhere in 3rd party tools like mplcursors.
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.
particularly, the thing I am thinking of is any code that tries to infer the 3d coordinates from a 2D location, so that coordinates can be displayed in the interactive text display in the lower right-hand corner of the figure window.
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.
yeah,line2d_seg_dist() is what is used.
WeatherGod commentedJan 7, 2019
This PR's summary should have the list of deprecated functions updated, and the list needs to be included in the api changes notes. While I am fairly certain that most of these functions were never used, some were used. Deprecating these without providing a path forward for users is a bit jarring to me. |
anntzer commentedJan 7, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
mplcursors is definitely not using any of these. |
WeatherGod commentedJan 7, 2019
rth commentedJan 7, 2019
Thanks for the reviews! Will update the docs for API changes.
Well, the alternative is to keep them public, but then it would be difficult to change anything in mplot3d as currently, everything is public and different functions are tightly coupled. For instance, regarding
Which of the functions deprecated here should be kept public then? |
anntzer commentedJan 7, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
If@WeatherGod doesn't want any of these to be deprecated, I'd suggest walling off these functions to their own corner, duplicate them to private (underscore-prefixed) versions, modify the private versions accordingly, and make mplot3d internally use the internal version of all these functions. |
WeatherGod commentedJan 7, 2019
I am not against deprecating these functions, I just want to make sure there is a path forward documented, particularly for the few functions that are known to be used in-the-wild. |
anntzer commentedJan 7, 2019
The path forward documented is to copy-paste the old implementation... |
WeatherGod commentedJan 7, 2019
Where is that documented? And, for some of these deprecated functions, doing so would be wrong because they will call other internal functions. |
anntzer commentedJan 7, 2019
"... that will be documented..." |
tacaswell commentedJan 7, 2019
I am 👍 on this modulo listing the function in the deprecation warning and adding a sentence that if you rely on these functions to vendor them. |
WeatherGod commentedJan 7, 2019
In addition, this PR is still incomplete because not all uses of the deprecated functions have been found and handled. Relying on pytest to find these for you is misleading because matplotlib's test coverage isn't the best. The one that I noticed off the bat is the use of |
WeatherGod left a comment
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.
Need to find the remaining uses of the deprecated functions.
NelleV commentedJan 18, 2019
@rth Do you think you could finish up the work that needs to be done on this PR? It should not be a lot of work. |
rth commentedJan 22, 2019
Thanks for all the feedback.
Re-run
Added the list of all deprecated functions to the release notes and added a sentence suggesting vendoring. Please let me know if I need to do anything else. |
jklymak commentedJan 28, 2019
ping@WeatherGod We are hoping to tag 3.1 soonish and this should be in there... |
| self.eye=E | ||
| self.vvec=R-E | ||
| self.vvec=self.vvec/proj3d.mod(self.vvec) | ||
| self.vvec=self.vvec/proj3d._mod(self.vvec) |
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.
This is going to conflict with#13020.
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'll rebase#13020 on top of this after this is merged.
| shade=np.array([np.dot(n/proj3d.mod(n),lightsource.direction) | ||
| ifproj3d.mod(n)elsenp.nan | ||
| shade=np.array([np.dot(n/proj3d._mod(n),lightsource.direction) | ||
| ifproj3d._mod(n)elsenp.nan |
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.
Going to conflict with#13020
| @cbook.deprecated("3.1") | ||
| defmod(v): | ||
| """3d vector length""" | ||
| return_mod(v) |
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.
All of thesemod related things should be superceded by#13020, because it is straight-forward to just usenp.linalg.norm().
efiring commentedFeb 12, 2019
@WeatherGod, if I understand correctly, all of your present reservations relate to the interaction with#13020, which@anntzer will rebase as needed. Is there anything that still needs to be fixed in this PR, apart from a rebase? |
WeatherGod commentedFeb 12, 2019
Yes, sorry if I wasn't clear. Is the Travis failure unrelated to the PR? |
jklymak commentedFeb 12, 2019
flake8 needs to pass! |
rth commentedFeb 12, 2019
Sorry, merging master introduced the flake8 issue. Should be fixed now. |
anntzer commentedFeb 12, 2019
thanks! |
Uh oh!
There was an error while loading.Please reload this page.
mplot3dcurrently exposes most (if not all) internal functions as part of the public API, making changes very difficult. This deprecates some of these internal functions, which is a pre-requisite for#11577Following functions were deprecated,
In#11577, the following functions would also change of output type,
I'm not sure if I should deprecate these too, of it they should remain as part of the public API in the long term.
Note: also checked that no deprecated functions are used with,