3131from weakref import ref , WeakKeyDictionary
3232
3333import numpy as np
34- import numpy .ma as ma
3534
3635
3736class MatplotlibDeprecationWarning (UserWarning ):
@@ -677,7 +676,7 @@ def is_string_like(obj):
677676 if isinstance (obj , six .string_types ):
678677 return True
679678 # numpy strings are subclass of str, ma strings are not
680- if ma . isMaskedArray (obj ):
679+ if isinstance (obj , np . ma . MaskedArray ):
681680 if obj .ndim == 0 and obj .dtype .kind in 'SU' :
682681 return True
683682 else :
@@ -1728,7 +1727,7 @@ def delete_masked_points(*args):
17281727 for i , x in enumerate (args ):
17291728 if (not is_string_like (x )) and iterable (x ) and len (x ) == nrecs :
17301729 seqlist [i ] = True
1731- if ma . isMA ( x ):
1730+ if isinstance ( x , np . ma . MaskedArray ):
17321731 if x .ndim > 1 :
17331732 raise ValueError ("Masked arrays must be 1-D" )
17341733 else :
@@ -1739,8 +1738,8 @@ def delete_masked_points(*args):
17391738 if seqlist [i ]:
17401739 if x .ndim > 1 :
17411740 continue # Don't try to get nan locations unless 1-D.
1742- if ma . isMA ( x ):
1743- masks .append (~ ma .getmaskarray (x )) # invert the mask
1741+ if isinstance ( x , np . ma . MaskedArray ):
1742+ masks .append (~ np . ma .getmaskarray (x )) # invert the mask
17441743 xd = x .data
17451744 else :
17461745 xd = x
@@ -1758,7 +1757,7 @@ def delete_masked_points(*args):
17581757 if seqlist [i ]:
17591758 margs [i ] = x .take (igood , axis = 0 )
17601759 for i , x in enumerate (margs ):
1761- if seqlist [i ] and ma . isMA ( x ):
1760+ if seqlist [i ] and isinstance ( x , np . ma . MaskedArray ):
17621761 margs [i ] = x .filled ()
17631762 return margs
17641763
@@ -2344,7 +2343,7 @@ def pts_to_poststep(x, *args):
23442343 # do normalization
23452344 vertices = _step_validation (x , * args )
23462345 # create the output array
2347- steps = ma .zeros ((vertices .shape [0 ], 2 * len (x ) - 1 ), np .float )
2346+ steps = np .zeros ((vertices .shape [0 ], 2 * len (x ) - 1 ), np .float )
23482347 # do the to step conversion logic
23492348 steps [0 , ::2 ], steps [0 , 1 :- 1 :2 ] = vertices [0 , :], vertices [0 , 1 :]
23502349 steps [1 :, 0 ::2 ], steps [1 :, 1 ::2 ] = vertices [1 :, :], vertices [1 :, :- 1 ]
@@ -2385,7 +2384,7 @@ def pts_to_midstep(x, *args):
23852384 # do normalization
23862385 vertices = _step_validation (x , * args )
23872386 # create the output array
2388- steps = ma .zeros ((vertices .shape [0 ], 2 * len (x )), np .float )
2387+ steps = np .zeros ((vertices .shape [0 ], 2 * len (x )), np .float )
23892388 steps [0 , 1 :- 1 :2 ] = 0.5 * (vertices [0 , :- 1 ] + vertices [0 , 1 :])
23902389 steps [0 , 2 ::2 ] = 0.5 * (vertices [0 , :- 1 ] + vertices [0 , 1 :])
23912390 steps [0 , 0 ] = vertices [0 , 0 ]
0 commit comments