FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

MAINT: numpy deprecates asscalar in 1.16 by ksunden · Pull Request #12478 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion lib/matplotlib/colors.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _sanitize_extrema(ex):
if ex is None:
return ex
try:
ret = np.asscalar(ex)
ret = ex.item()
except AttributeError:
ret = float(ex)
return ret
Expand Down
6 changes: 3 additions & 3 deletions lib/matplotlib/image.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,9 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,

A_scaled -= a_min
# a_min and a_max might be ndarray subclasses so use
# asscalar to avoid errors
a_min = np.asscalar(a_min.astype(scaled_dtype))
a_max = np.asscalar(a_max.astype(scaled_dtype))
# item to avoid errors
a_min = a_min.astype(scaled_dtype).item()
a_max = a_max.astype(scaled_dtype).item()

if a_min != a_max:
A_scaled /= ((a_max - a_min) / 0.8)
Expand Down

Back | FazBrowse Home | New Git URL