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

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

< 8000 div class="position-relative HeaderMenu-link-wrap d-lg-inline-block">
Appearance settings

Commit 5c0e652

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

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('N') # Swap to native order.
755752
try:
756753
xm = np.ma.masked_invalid(x, copy=False)
757754
xm.shrink_mask()

0 commit comments

Comments
 (0)
0