Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fde35d4

Browse files
authored
Merge pull request #24758 from oscargus/masked
MNT: Simplify code related to masked arrays
2 parents a668754 + 8cd356a commit fde35d4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/matplotlib/ticker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ def set_powerlimits(self, lims):
623623

624624
def format_data_short(self, value):
625625
# docstring inherited
626-
if isinstance(value, np.ma.MaskedArray) and value.mask:
626+
if value is np.ma.masked:
627627
return ""
628628
if isinstance(value, Integral):
629629
fmt = "%d"

lib/matplotlib/transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1854,7 +1854,7 @@ def transform_affine(self, points):
18541854
# The major speed trap here is just converting to the
18551855
# points to an array in the first place. If we can use
18561856
# more arrays upstream, that should help here.
1857-
if not isinstance(points, (np.ma.MaskedArray, np.ndarray)):
1857+
if not isinstance(points, np.ndarray):
18581858
_api.warn_external(
18591859
f'A non-numpy array of type {type(points)} was passed in '
18601860
f'for transformation, which results in poor performance.')

0 commit comments

Comments
 (0)