File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -1442,6 +1442,21 @@ async def get_orthogonal_selection(
1442
1442
indexer = indexer , out = out , fields = fields , prototype = prototype
1443
1443
)
1444
1444
1445
+ async def get_mask_selection (
1446
+ self ,
1447
+ mask : MaskSelection ,
1448
+ * ,
1449
+ out : NDBuffer | None = None ,
1450
+ fields : Fields | None = None ,
1451
+ prototype : BufferPrototype | None = None ,
1452
+ ) -> NDArrayLikeOrScalar :
1453
+ if prototype is None :
1454
+ prototype = default_buffer_prototype ()
1455
+ indexer = MaskIndexer (mask , self .shape , self .metadata .chunk_grid )
1456
+ return await self ._get_selection (
1457
+ indexer = indexer , out = out , fields = fields , prototype = prototype
1458
+ )
1459
+
1445
1460
async def get_coordinate_selection (
1446
1461
self ,
1447
1462
selection : CoordinateSelection ,
Original file line number Diff line number Diff line change @@ -1309,7 +1309,7 @@ async def getitem(
1309
1309
if is_coordinate_selection (new_selection , self .array .shape ):
1310
1310
return await self .array .get_coordinate_selection (new_selection , fields = fields )
1311
1311
elif is_mask_selection (new_selection , self .array .shape ):
1312
- return self .array .get_mask_selection (new_selection , fields = fields )
1312
+ return await self .array .get_mask_selection (new_selection , fields = fields )
1313
1313
else :
1314
1314
raise VindexInvalidSelectionError (new_selection )
1315
1315
You can’t perform that action at this time.
0 commit comments