8000 Fix expand_dims warnings in triinterpolate by dstansby · Pull Request #12294 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix expand_dims warnings in triinterpolate #12294

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 1 commit into from
Sep 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/matplotlib/tri/triinterpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,9 +574,9 @@ def _compute_tri_eccentricities(tris_pts):
The so-called eccentricity parameters [1] needed for
HCT triangular element.
"""
a = np.expand_dims(tris_pts[:, 2, :]-tris_pts[:, 1, :], axis=2)
b = np.expand_dims(tris_pts[:, 0, :]-tris_pts[:, 2, :], axis=2)
c = np.expand_dims(tris_pts[:, 1, :]-tris_pts[:, 0, :], axis=2)
a = np.expand_dims(tris_pts[:, 2, :] - tris_pts[:, 1, :], axis=2)
b = np.expand_dims(tris_pts[:, 0, :] - tris_pts[:, 2, :], axis=2)
c = np.expand_dims(tris_pts[:, 1, :] - tris_pts[:, 0, :], axis=2)
# Do not use np.squeeze, this is dangerous if only one triangle
# in the triangulation...
dot_a = _prod_vectorized(_transpose_vectorized(a), a)[:, 0, 0]
Expand Down Expand Up @@ -1064,9 +1064,9 @@ def get_dof_vec(tri_z, tri_dz, J):
J1 = _prod_vectorized(_ReducedHCT_Element.J0_to_J1, J)
J2 = _prod_vectorized(_ReducedHCT_Element.J0_to_J2, J)

col0 = _prod_vectorized(J, np.expand_dims(tri_dz[:, 0, :], axis=3))
col1 = _prod_vectorized(J1, np.expand_dims(tri_dz[:, 1, :], axis=3))
col2 = _prod_vectorized(J2, np.expand_dims(tri_dz[:, 2, :], axis=3))
col0 = _prod_vectorized(J, np.expand_dims(tri_dz[:, 0, :], axis=2))
col1 = _prod_vectorized(J1, np.expand_dims(tri_dz[:, 1, :], axis=2))
col2 = _prod_vectorized(J2, np.expand_dims(tri_dz[:, 2, :], axis=2))

dfdksi = _to_matrix_vectorized([
[col0[:, 0, 0], col1[:, 0, 0], col2[:, 0, 0]],
Expand Down
0