@@ -2252,14 +2252,8 @@ class PolyQuadMesh(_MeshData, PolyCollection):
2252
2252
"""
2253
2253
2254
2254
def __init__ (self , coordinates , ** kwargs ):
2255
- # We need to keep track of whether we are using deprecated compression
2256
- # Update it after the initializers
2257
- self ._deprecated_compression = False
2258
2255
super ().__init__ (coordinates = coordinates )
2259
2256
PolyCollection .__init__ (self , verts = [], ** kwargs )
2260
- # Store this during the compression deprecation period
2261
- self ._original_mask = ~ self ._get_unmasked_polys ()
2262
- self ._deprecated_compression = np .any (self ._original_mask )
2263
2257
# Setting the verts updates the paths of the PolyCollection
2264
2258
# This is called after the initializers to make sure the kwargs
2265
2259
# have all been processed and available for the masking calculations
@@ -2272,14 +2266,7 @@ def _get_unmasked_polys(self):
2272
2266
2273
2267
# We want the shape of the polygon, which is the corner of each X/Y array
2274
2268
mask = (mask [0 :- 1 , 0 :- 1 ] | mask [1 :, 1 :] | mask [0 :- 1 , 1 :] | mask [1 :, 0 :- 1 ])
2275
-
2276
- if (getattr (self , "_deprecated_compression" , False ) and
2277
- np .any (self ._original_mask )):
2278
- return ~ (mask | self ._original_mask )
2279
- # Take account of the array data too, temporarily avoiding
2280
- # the compression warning and resetting the variable after the call
2281
- with cbook ._setattr_cm (self , _deprecated_compression = False ):
2282
- arr = self .get_array ()
2269
+ arr = self .get_array ()
2283
2270
if arr is not None :
2284
2271
arr = np .ma .getmaskarray (arr )
2285
2272
if arr .ndim == 3 :
@@ -2335,42 +2322,8 @@ def get_facecolor(self):
2335
2322
def set_array (self , A ):
2336
2323
# docstring inherited
2337
2324
prev_unmask = self ._get_unmasked_polys ()
2338
- # MPL <3.8 compressed the mask, so we need to handle flattened 1d input
2339
- # until the deprecation expires, also only warning when there are masked
2340
- # elements and thus compression occurring.
2341
- if self ._deprecated_compression and np .ndim (A ) == 1 :
2342
- _api .warn_deprecated ("3.8" , message = "Setting a PolyQuadMesh array using "
2343
- "the compressed values is deprecated. "
2344
- "Pass the full 2D shape of the original array "
2345
- f"{ prev_unmask .shape } including the masked elements." )
2346
- Afull = np .empty (self ._original_mask .shape )
2347
- Afull [~ self ._original_mask ] = A
2348
- # We also want to update the mask with any potential
2349
- # new masked elements that came in. But, we don't want
2350
- # to update any of the compression from the original
2351
- mask = self ._original_mask .copy ()
2352
- mask [~ self ._original_mask ] |= np .ma .getmask (A )
2353
- A = np .ma .array (Afull , mask = mask )
2354
- return super ().set_array (A )
2355
- self ._deprecated_compression = False
2356
2325
super ().set_array (A )
2357
2326
# If the mask has changed at all we need to update
2358
2327
# the set of Polys that we are drawing
2359
2328
if not np .array_equal (prev_unmask , self ._get_unmasked_polys ()):
2360
2329
self ._set_unmasked_verts ()
2361
-
2362
- def get_array (self ):
2363
- # docstring inherited
2364
- # Can remove this entire function once the deprecation period ends
2365
- A = super ().get_array ()
2366
- if A is None :
2367
- return
2368
- if self ._deprecated_compression and np .any (np .ma .getmask (A )):
2369
- _api .warn_deprecated ("3.8" , message = (
2370
- "Getting the array from a PolyQuadMesh will return the full "
2371
- "array in the future (uncompressed). To get this behavior now "
2372
- "set the PolyQuadMesh with a 2D array .set_array(data2d)." ))
2373
- # Setting an array of a polycollection required
2374
- # compressing the array
2375
- return np .ma .compressed (A )
2376
- return A
0 commit comments