Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 600334c

Browse filesBrowse files
committed
Fix expand_dims warnings in triinterpolate
1 parent 50aebe6 commit 600334c
Copy full SHA for 600334c

File tree

Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed

‎lib/matplotlib/tri/triinterpolate.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tri/triinterpolate.py
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,9 @@ def _compute_tri_eccentricities(tris_pts):
574574
The so-called eccentricity parameters [1] needed for
575575
HCT triangular element.
576576
"""
577-
a = np.expand_dims(tris_pts[:, 2, :]-tris_pts[:, 1, :], axis=2)
578-
b = np.expand_dims(tris_pts[:, 0, :]-tris_pts[:, 2, :], axis=2)
579-
c = np.expand_dims(tris_pts[:, 1, :]-tris_pts[:, 0, :], axis=2)
577+
a = np.expand_dims(tris_pts[:, 2, :] - tris_pts[:, 1, :], axis=2)
578+
b = np.expand_dims(tris_pts[:, 0, :] - tris_pts[:, 2, :], axis=2)
579+
c = np.expand_dims(tris_pts[:, 1, :] - tris_pts[:, 0, :], axis=2)
580580
# Do not use np.squeeze, this is dangerous if only one triangle
581581
# in the triangulation...
582582
dot_a = _prod_vectorized(_transpose_vectorized(a), a)[:, 0, 0]
@@ -1064,9 +1064,9 @@ def get_dof_vec(tri_z, tri_dz, J):
10641064
J1 = _prod_vectorized(_ReducedHCT_Element.J0_to_J1, J)
10651065
J2 = _prod_vectorized(_ReducedHCT_Element.J0_to_J2, J)
10661066

1067-
col0 = _prod_vectorized(J, np.expand_dims(tri_dz[:, 0, :], axis=3))
1068-
col1 = _prod_vectorized(J1, np.expand_dims(tri_dz[:, 1, :], axis=3))
1069-
col2 = _prod_vectorized(J2, np.expand_dims(tri_dz[:, 2, :], axis=3))
1067+
col0 = _prod_vectorized(J, np.expand_dims(tri_dz[:, 0, :], axis=2))
1068+
col1 = _prod_vectorized(J1, np.expand_dims(tri_dz[:, 1, :], axis=2))
1069+
col2 = _prod_vectorized(J2, np.expand_dims(tri_dz[:, 2, :], axis=2))
10701070

10711071
dfdksi = _to_matrix_vectorized([
10721072
[col0[:, 0, 0], col1[:, 0, 0], col2[:, 0, 0]],

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.