-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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 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
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ae83f2c
Deprecate functions in art3d.py
rth 8147734
More deprecations in proj3d
rth e4a983f
Add API change entry
rth 4bc0e4a
List all deprecated fuctions
rth a55a4ea
Fix missing uses of deprecated functions
rth 661deec
Suggest vendoring in the deprecation notice
rth 9f11f64
Merge branch 'master' into private-funcs-mplot3d
rth f406cc1
Lint
rth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Deprecations | ||
```````````` | ||
|
||
Multiple internal functions that were exposed as part of the public API | ||
of ``mpl_toolkits.mplot3d`` are deprecated, | ||
|
||
**mpl_toolkits.mplot3d.art3d** | ||
|
||
- :func:`mpl_toolkits.mplot3d.art3d.norm_angle` | ||
- :func:`mpl_toolkits.mplot3d.art3d.norm_text_angle` | ||
- :func:`mpl_toolkits.mplot3d.art3d.path_to_3d_segment` | ||
- :func:`mpl_toolkits.mplot3d.art3d.paths_to_3d_segments` | ||
- :func:`mpl_toolkits.mplot3d.art3d.path_to_3d_segment_with_codes` | ||
- :func:`mpl_toolkits.mplot3d.art3d.paths_to_3d_segments_with_codes` | ||
- :func:`mpl_toolkits.mplot3d.art3d.get_patch_verts` | ||
- :func:`mpl_toolkits.mplot3d.art3d.get_colors` | ||
- :func:`mpl_toolkits.mplot3d.art3d.zalpha` | ||
|
||
**mpl_toolkits.mplot3d.proj3d** | ||
|
||
- :func:`mpl_toolkits.mplot3d.proj3d.line2d` | ||
- :func:`mpl_toolkits.mplot3d.proj3d.line2d_dist` | ||
- :func:`mpl_toolkits.mplot3d.proj3d.line2d_seg_dist` | ||
- :func:`mpl_toolkits.mplot3d.proj3d.mod` | ||
- :func:`mpl_toolkits.mplot3d.proj3d.proj_transform_vec` | ||
- :func:`mpl_toolkits.mplot3d.proj3d.proj_transform_vec_clip` | ||
- :func:`mpl_toolkits.mplot3d.proj3d.vec_pad_ones` | ||
- :func:`mpl_toolkits.mplot3d.proj3d.proj_trans_clip_points` | ||
|
||
If your project relies on these functions, consider vendoring them. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1027,7 +1027,7 @@ def get_proj(self): | |
|
||
self.eye = E | ||
self.vvec = R - E | ||
self.vvec = self.vvec / proj3d.mod(self.vvec) | ||
self.vvec = self.vvec / proj3d._mod(self.vvec) | ||
|
||
if abs(relev) > np.pi/2: | ||
# upside down | ||
|
@@ -1162,7 +1162,7 @@ def format_coord(self, xd, yd): | |
|
||
# nearest edge | ||
p0, p1 = min(self.tunit_edges(), | ||
key=lambda edge: proj3d.line2d_seg_dist( | ||
key=lambda edge: proj3d._line2d_seg_dist( | ||
edge[0], edge[1], (xd, yd))) | ||
|
||
# scale the z value to match | ||
|
@@ -1209,8 +1209,8 @@ def _on_move(self, event): | |
# get the x and y pixel coords | ||
if dx == 0 and dy == 0: | ||
return | ||
self.elev = art3d.norm_angle(self.elev - (dy/h)*180) | ||
self.azim = art3d.norm_angle(self.azim - (dx/w)*180) | ||
self.elev = art3d._norm_angle(self.elev - (dy/h)*180) | ||
self.azim = art3d._norm_angle(self.azim - (dx/w)*180) | ||
self.get_proj() | ||
self.stale = True | ||
self.figure.canvas.draw_idle() | ||
|
@@ -1762,8 +1762,8 @@ def _shade_colors(self, color, normals, lightsource=None): | |
# chosen for backwards-compatibility | ||
lightsource = LightSource(azdeg=225, altdeg=19.4712) | ||
|
||
shade = np.array([np.dot(n / proj3d.mod(n), lightsource.direction) | ||
if proj3d.mod(n) else np.nan | ||
shade = np.array([np.dot(n / proj3d._mod(n), lightsource.direction) | ||
if proj3d._mod(n) else np.nan | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Going to conflict with #13020 |
||
for n in normals]) | ||
mask = ~np.isnan(shade) | ||
|
||
|
@@ -2029,8 +2029,8 @@ def _3d_extend_contour(self, cset, stride=5): | |
paths = linec.get_paths() | ||
if not paths: | ||
continue | ||
topverts = art3d.paths_to_3d_segments(paths, z - dz) | ||
botverts = art3d.paths_to_3d_segments(paths, z + dz) | ||
topverts = art3d._paths_to_3d_segments(paths, z - dz) | ||
botverts = art3d._paths_to_3d_segments(paths, z + dz) | ||
|
||
color = linec.get_color()[0] | ||
|
||
|
@@ -2394,7 +2394,7 @@ def bar(self, left, height, zs=0, zdir='z', *args, **kwargs): | |
verts = [] | ||
verts_zs = [] | ||
for p, z in zip(patches, zs): | ||
vs = art3d.get_patch_verts(p) | ||
vs = art3d._get_patch_verts(p) | ||
verts += vs.tolist() | ||
verts_zs += [z] * len(vs) | ||
art3d.patch_2d_to_3d(p, z, zdir) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.