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

Conversation

dstansby
Copy link
Member
@dstansby dstansby commented Sep 26, 2018

np.expand_dims is meant to take the axis after which a new dimension is to be inserted, so the 3 just needed changed to 2 for the bottom block. (see the note at https://docs.scipy.org/doc/numpy/reference/generated/numpy.expand_dims.html)

This was causing lots of test warnings like

/Users/dstansby/github/matplotlib/lib/matplotlib/tri/triinterpolate.py:1069: DeprecationWarning: Both axis > a.ndim and axis < -a.ndim - 1 are deprecated and will raise an AxisError in the future.
  col2 = _prod_vectorized(J2, np.expand_dims(tri_dz[:, 2, :], axis=3))

@ImportanceOfBeingErnest ImportanceOfBeingErnest added this to the v3.0.x milestone Sep 26, 2018
Copy link
Member
@ImportanceOfBeingErnest ImportanceOfBeingErnest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Judging from the numpy documentation as well as the fact that there is no difference in output of the CubicTriInterpolator, this is the correct thing to do.

@QuLogic QuLogic merged commit b2c8991 into matplotlib:master Sep 26, 2018
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Sep 26, 2018
QuLogic added a commit that referenced this pull request Sep 27, 2018
…294-on-v3.0.x

Backport PR #12294 on branch v3.0.x (Fix expand_dims warnings in triinterpolate)
@dstansby dstansby deleted the tri-warnings branch September 27, 2018 08:23
QuLogic added a commit that referenced this pull request Jan 22, 2019
…154-on-v2.2.x

Backport PRs #12154, #12294, #12297, #12316, #13159 & #13205 to fix multiple tests issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0