Skip to content

Commit

Permalink
Add proj3d deprecations to mark progress
Browse files Browse the repository at this point in the history
  • Loading branch information
AnsonTran committed May 14, 2024
1 parent 1c1eb22 commit 5daa70b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/mpl_toolkits/mplot3d/proj3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from matplotlib import _api


@_api.deprecate("3.10")

Check failure on line 9 in lib/mpl_toolkits/mplot3d/proj3d.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 E302 expected 2 blank lines, found 1 Raw Output: ./lib/mpl_toolkits/mplot3d/proj3d.py:9:1: E302 expected 2 blank lines, found 1
def world_transformation(xmin, xmax,
ymin, ymax,
zmin, zmax, pb_aspect=None):
Expand Down Expand Up @@ -37,6 +37,7 @@ def rotation_about_vector(v, angle):
return _rotation_about_vector(v, angle)


@_api.deprecate("3.10")

Check warning on line 40 in lib/mpl_toolkits/mplot3d/proj3d.py

View check run for this annotation

Codecov / codecov/patch

lib/mpl_toolkits/mplot3d/proj3d.py#L40

Added line #L40 was not covered by tests
def _rotation_about_vector(v, angle):
"""
Produce a rotation matrix for an angle in radians about a vector.
Expand Down Expand Up @@ -93,6 +94,7 @@ def _view_axes(E, R, V, roll):
return u, v, w


@_api.deprecate("3.10")

Check warning on line 97 in lib/mpl_toolkits/mplot3d/proj3d.py

View check run for this annotation

Codecov / codecov/patch

lib/mpl_toolkits/mplot3d/proj3d.py#L97

Added line #L97 was not covered by tests
def _view_transformation_uvw(u, v, w, E):
"""
Return the view transformation matrix.
Expand Down Expand Up @@ -142,6 +144,7 @@ def persp_transformation(zfront, zback, focal_length):
return _persp_transformation(zfront, zback, focal_length)


@_api.deprecate("3.10")

Check warning on line 147 in lib/mpl_toolkits/mplot3d/proj3d.py

View check run for this annotation

Codecov / codecov/patch

lib/mpl_toolkits/mplot3d/proj3d.py#L147

Added line #L147 was not covered by tests
def _persp_transformation(zfront, zback, focal_length):
e = focal_length
a = 1 # aspect ratio
Expand All @@ -159,6 +162,7 @@ def ortho_transformation(zfront, zback):
return _ortho_transformation(zfront, zback)


@_api.deprecate("3.10")

Check warning on line 165 in lib/mpl_toolkits/mplot3d/proj3d.py

View check run for this annotation

Codecov / codecov/patch

lib/mpl_toolkits/mplot3d/proj3d.py#L165

Added line #L165 was not covered by tests
def _ortho_transformation(zfront, zback):
# note: w component in the resulting vector will be (zback-zfront), not 1
a = -(zfront + zback)
Expand All @@ -170,6 +174,7 @@ def _ortho_transformation(zfront, zback):
return proj_matrix


@_api.deprecate("3.10")

Check warning on line 177 in lib/mpl_toolkits/mplot3d/proj3d.py

View check run for this annotation

Codecov / codecov/patch

lib/mpl_toolkits/mplot3d/proj3d.py#L177

Added line #L177 was not covered by tests
def _proj_transform_vec(vec, M):
vecw = np.dot(M, vec)
w = vecw[3]
Expand All @@ -178,6 +183,7 @@ def _proj_transform_vec(vec, M):
return txs, tys, tzs


@_api.deprecate("3.10")

Check warning on line 186 in lib/mpl_toolkits/mplot3d/proj3d.py

View check run for this annotation

Codecov / codecov/patch

lib/mpl_toolkits/mplot3d/proj3d.py#L186

Added line #L186 was not covered by tests
def _proj_transform_vec_clip(vec, M):
vecw = np.dot(M, vec)
w = vecw[3]
Expand All @@ -189,6 +195,7 @@ def _proj_transform_vec_clip(vec, M):
return txs, tys, tzs, tis


@_api.deprecate("3.10")

Check warning on line 198 in lib/mpl_toolkits/mplot3d/proj3d.py

View check run for this annotation

Codecov / codecov/patch

lib/mpl_toolkits/mplot3d/proj3d.py#L198

Added line #L198 was not covered by tests
def inv_transform(xs, ys, zs, invM):
"""
Transform the points by the inverse of the projection matrix, *invM*.
Expand All @@ -203,10 +210,12 @@ def inv_transform(xs, ys, zs, invM):
return vecr[0], vecr[1], vecr[2]


@_api.deprecate("3.10")

Check warning on line 213 in lib/mpl_toolkits/mplot3d/proj3d.py

View check run for this annotation

Codecov / codecov/patch

lib/mpl_toolkits/mplot3d/proj3d.py#L213

Added line #L213 was not covered by tests
def _vec_pad_ones(xs, ys, zs):
return np.array([xs, ys, zs, np.ones_like(xs)])


@_api.deprecate("3.10")

Check warning on line 218 in lib/mpl_toolkits/mplot3d/proj3d.py

View check run for this annotation

Codecov / codecov/patch

lib/mpl_toolkits/mplot3d/proj3d.py#L218

Added line #L218 was not covered by tests
def proj_transform(xs, ys, zs, M):
"""
Transform the points by the projection matrix *M*.
Expand All @@ -220,6 +229,7 @@ def proj_transform(xs, ys, zs, M):
alternative="proj_transform")(proj_transform)


@_api.deprecate("3.10")

Check warning on line 232 in lib/mpl_toolkits/mplot3d/proj3d.py

View check run for this annotation

Codecov / codecov/patch

lib/mpl_toolkits/mplot3d/proj3d.py#L232

Added line #L232 was not covered by tests
def proj_transform_clip(xs, ys, zs, M):
"""
Transform the points by the projection matrix
Expand All @@ -235,6 +245,7 @@ def proj_points(points, M):
return _proj_points(points, M)


@_api.deprecate("3.10")

Check warning on line 248 in lib/mpl_toolkits/mplot3d/proj3d.py

View check run for this annotation

Codecov / codecov/patch

lib/mpl_toolkits/mplot3d/proj3d.py#L248

Added line #L248 was not covered by tests
def _proj_points(points, M):
return np.column_stack(_proj_trans_points(points, M))

Expand All @@ -244,6 +255,7 @@ def proj_trans_points(points, M):
return _proj_trans_points(points, M)


@_api.deprecate("3.10")

Check warning on line 258 in lib/mpl_toolkits/mplot3d/proj3d.py

View check run for this annotation

Codecov / codecov/patch

lib/mpl_toolkits/mplot3d/proj3d.py#L258

Added line #L258 was not covered by tests
def _proj_trans_points(points, M):
xs, ys, zs = zip(*points)
return proj_transform(xs, ys, zs, M)
Expand Down

0 comments on commit 5daa70b

Please sign in to comment.