Skip to content
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

Use of np.asscalar in Matplotlib v2.2.3 #13192

Closed
1313e opened this issue Jan 16, 2019 · 1 comment
Closed

Use of np.asscalar in Matplotlib v2.2.3 #13192

1313e opened this issue Jan 16, 2019 · 1 comment
Milestone

Comments

@1313e
Copy link
Contributor

1313e commented Jan 16, 2019

Bug report

Bug summary
With NumPy v1.16.0, the use of np.asscalar() is deprecated and will probably be removed later on.
Currently, in Matplotlib v2.2.3, there are still three instances of this function being used.
Given that Matplotlib v3.0.0+ no longer supports Python 2.7, I assume that the use of this function should be removed at some point (for v2.2.4?).

Code for reproduction
Installing Matplotlib v2.2.3 (in any Python version), going to the installation directory and executing (I do not know if this also works on anything besides Linux) grep -H -n np.asscalar *.py will return

colors.py:101:        ret = np.asscalar(ex)
image.py:425:                a_min = np.asscalar(a_min.astype(scaled_dtype))
image.py:426:                a_max = np.asscalar(a_max.astype(scaled_dtype))

If allowed, I can easily go and replace those instances with a.item() or equivalent (if necessary) and make a PR.

@jklymak
Copy link
Member

jklymak commented Jan 16, 2019

Thanks for noting this. In #12478 removed np.asscalar from our code and was backported to v2.2.4, so I'll close this as already done.

@jklymak jklymak closed this as completed Jan 16, 2019
@tacaswell tacaswell added this to the v2.2.4 milestone Jan 16, 2019
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

No branches or pull requests

3 participants