8000 Slightly clarify the implementation of safe_masked_invalid. · matplotlib/matplotlib@d3992c1 · GitHub
[go: up one dir, main page]

Skip to content

Commit d3992c1

Browse files
committed
Slightly clarify the implementation of safe_masked_invalid.
1 parent 907efd0 commit d3992c1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/matplotlib/cbook/__init__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -746,12 +746,9 @@ def safezip(*args):
746746
def safe_masked_invalid(x, copy=False):
747747
x = np.array(x, subok=True, copy=copy)
748748
if not x.dtype.isnative:
749-
# Note that the argument to `byteswap` is 'inplace',
750-
# thus if we have already made a copy, do the byteswap in
751-
# place, else make a copy with the byte order swapped.
752-
# Be explicit that we are swapping the byte order of the dtype
753-
x = x.byteswap(copy).newbyteorder('S')
754-
749+
# If we have already made a copy, do the byteswap in place, else make a
750+
# copy with the byte order swapped.
751+
x = x.byteswap(inplace=copy).newbyteorder('native')
755752
try:
756753
xm = np.ma.masked_invalid(x, copy=False)
757754
xm.shrink_mask()

0 commit comments

Comments
 (0)
0