From 600334c4de76be15c92f5fd640aef5440118b229 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Wed, 26 Sep 2018 10:38:27 +0100 Subject: [PATCH] Fix expand_dims warnings in triinterpolate --- lib/matplotlib/tri/triinterpolate.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/tri/triinterpolate.py b/lib/matplotlib/tri/triinterpolate.py index 48d9d5c82681..5163304a9305 100644 --- a/lib/matplotlib/tri/triinterpolate.py +++ b/lib/matplotlib/tri/triinterpolate.py @@ -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] @@ -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]],