@@ -294,64 +294,64 @@ def as_view(obj, view_args):
294294
295295
296296@as_view .register (np .ndarray )
297- def as_view_array (array , view_args ):
297+ def as_view_array (array , view_args ) -> ArrayView :
298298 return ArrayView (array , view_args = view_args )
299299
300300
301301@as_view .register (DaskArray )
302- def as_view_dask_array (array , view_args ):
302+ def as_view_dask_array (array , view_args ) -> DaskArrayView :
303303 return DaskArrayView (array , view_args = view_args )
304304
305305
306306@as_view .register (pd .DataFrame )
307- def as_view_df (df , view_args ):
307+ def as_view_df (df , view_args ) -> DataFrameView :
308308 return DataFrameView (df , view_args = view_args )
309309
310310
311311@as_view .register (sparse .csr_matrix )
312- def as_view_csr_matrix (mtx , view_args ):
312+ def as_view_csr_matrix (mtx , view_args ) -> SparseCSRMatrixView :
313313 return SparseCSRMatrixView (mtx , view_args = view_args )
314314
315315
316316@as_view .register (sparse .csc_matrix )
317- def as_view_csc_matrix (mtx , view_args ):
317+ def as_view_csc_matrix (mtx , view_args ) -> SparseCSCMatrixView :
318318 return SparseCSCMatrixView (mtx , view_args = view_args )
319319
320320
321321@as_view .register (sparse .csr_array )
322- def as_view_csr_array (mtx , view_args ):
322+ def as_view_csr_array (mtx , view_args ) -> SparseCSRArrayView :
323323 return SparseCSRArrayView (mtx , view_args = view_args )
324324
325325
326326@as_view .register (sparse .csc_array )
327- def as_view_csc_array (mtx , view_args ):
327+ def as_view_csc_array (mtx , view_args ) -> SparseCSCArrayView :
328328 return SparseCSCArrayView (mtx , view_args = view_args )
329329
330330
331331@as_view .register (dict )
332- def as_view_dict (d , view_args ):
332+ def as_view_dict (d , view_args ) -> DictView :
333333 return DictView (d , view_args = view_args )
334334
335335
336336@as_view .register (ZappyArray )
337- def as_view_zappy (z , view_args ):
337+ def as_view_zappy (z , view_args ) -> ZappyArray :
338338 # Previous code says ZappyArray works as view,
339339 # but as far as I can tell they’re immutable.
340340 return z
341341
342342
343343@as_view .register (CupyArray )
344- def as_view_cupy (array , view_args ):
344+ def as_view_cupy (array , view_args ) -> CupyArrayView :
345345 return CupyArrayView (array , view_args = view_args )
346346
347347
348348@as_view .register (CupyCSRMatrix )
349- def as_view_cupy_csr (mtx , view_args ):
349+ def as_view_cupy_csr (mtx , view_args ) -> CupySparseCSRView :
350350 return CupySparseCSRView (mtx , view_args = view_args )
351351
352352
353353@as_view .register (CupyCSCMatrix )
354- def as_view_cupy_csc (mtx , view_args ):
354+ def as_view_cupy_csc (mtx , view_args ) -> CupySparseCSCView :
355355 return CupySparseCSCView (mtx , view_args = view_args )
356356
357357
@@ -373,7 +373,7 @@ def _view_args(self):
373373 to be attached as "behavior". These "behaviors" cannot take any additional parameters (as we do
374374 for other data types to store `_view_args`). Therefore, we need to store `_view_args` using awkward's
375375 parameter mechanism. These parameters need to be json-serializable, which is why we can't store
376- ElementRef directly, but need to replace the reference to the parent AnnDataView container with a weak
376+ ElementRef directly, but need to replace the reference to the parent AnnData container with a weak
377377 reference.
378378 """
379379 parent_key , attrname , keys = self .layout .parameter (_PARAM_NAME )
@@ -394,7 +394,7 @@ def __copy__(self) -> AwkArray:
394394 return array
395395
396396 @as_view .register (AwkArray )
397- def as_view_awkarray (array , view_args ):
397+ def as_view_awkarray (array , view_args ) -> AwkwardArrayView :
398398 parent , attrname , keys = view_args
399399 parent_key = f"target-{ id (parent )} "
400400 _registry [parent_key ] = parent
0 commit comments