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 cc1c6a8

Browse filesBrowse files
QuLogicArchangeGabriel
authored andcommitted
Merge pull request #12294 from dstansby/tri-warnings
Fix expand_dims warnings in triinterpolate
1 parent 364f018 commit cc1c6a8
Copy full SHA for cc1c6a8

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
@@ -581,9 +581,9 @@ def _compute_tri_eccentricities(tris_pts):
581581
The so-called eccentricity parameters [1] needed for
582582
HCT triangular element.
583583
"""
584-
a = np.expand_dims(tris_pts[:, 2, :]-tris_pts[:, 1, :], axis=2)
585-
b = np.expand_dims(tris_pts[:, 0, :]-tris_pts[:, 2, :], axis=2)
586-
c = np.expand_dims(tris_pts[:, 1, :]-tris_pts[:, 0, :], axis=2)
584+
a = np.expand_dims(tris_pts[:, 2, :] - tris_pts[:, 1, :], axis=2)
585+
b = np.expand_dims(tris_pts[:, 0, :] - tris_pts[:, 2, :], axis=2)
586+
c = np.expand_dims(tris_pts[:, 1, :] - tris_pts[:, 0, :], axis=2)
587587
# Do not use np.squeeze, this is dangerous if only one triangle
588588
# in the triangulation...
589589
dot_a = _prod_vectorized(_transpose_vectorized(a), a)[:, 0, 0]
@@ -1071,9 +1071,9 @@ def get_dof_vec(tri_z, tri_dz, J):
10711071
J1 = _prod_vectorized(_ReducedHCT_Element.J0_to_J1, J)
10721072
J2 = _prod_vectorized(_ReducedHCT_Element.J0_to_J2, J)
10731073

1074-
col0 = _prod_vectorized(J, np.expand_dims(tri_dz[:, 0, :], axis=3))
1075-
col1 = _prod_vectorized(J1, np.expand_dims(tri_dz[:, 1, :], axis=3))
1076-
col2 = _prod_vectorized(J2, np.expand_dims(tri_dz[:, 2, :], axis=3))
1074+
col0 = _prod_vectorized(J, np.expand_dims(tri_dz[:, 0, :], axis=2))
1075+
col1 = _prod_vectorized(J1, np.expand_dims(tri_dz[:, 1, :], axis=2))
1076+
col2 = _prod_vectorized(J2, np.expand_dims(tri_dz[:, 2, :], axis=2))
10771077

10781078
dfdksi = _to_matrix_vectorized([
10791079
[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.