1717
1818 from anndata import AnnData
1919
20- C = TypeVar ("C" , bound = Callable )
20+ C = TypeVar ("C" , bound = Callable ) # type: ignore[type-arg]
2121
2222 class ParamSkipper (Protocol ):
23- def __call__ (self , ** skipped : AbstractSet ) -> Callable [[C ], C ]: ...
23+ def __call__ (self , ** skipped : AbstractSet ) -> Callable [[C ], C ]: ... # type: ignore[type-arg]
2424
2525 Dataset = Literal ["imc" ]
2626 KeyX = Literal [None , "off-axis" ]
2727
2828
2929@cache
3030def _imc () -> AnnData :
31- adata = sq .datasets .imc ()
31+ adata = sq .datasets .imc () # type: ignore[attr-defined]
3232 assert isinstance (adata .X , np .ndarray )
3333 assert not np .isfortran (adata .X )
3434
@@ -39,7 +39,7 @@ def imc() -> AnnData:
3939 return _imc ().copy ()
4040
4141
42- def to_off_axis (x : np .ndarray | csr_matrix | csc_matrix ) -> np .ndarray | csc_matrix :
42+ def to_off_axis (x : np .ndarray | csr_matrix | csc_matrix ) -> np .ndarray | csc_matrix : # type: ignore[type-arg]
4343 if isinstance (x , csr_matrix ):
4444 return x .tocsc ()
4545 if isinstance (x , np .ndarray ):
@@ -87,13 +87,13 @@ def param_skipper(param_names: Sequence[str], params: tuple[Sequence[object], ..
8787
8888 """
8989
90- def skip (** skipped : AbstractSet ) -> Callable [[C ], C ]:
90+ def skip (** skipped : AbstractSet ) -> Callable [[C ], C ]: # type: ignore[type-arg]
9191 skipped_combs = [
9292 tuple (record .values ())
9393 for record in (dict (zip (param_names , vals , strict = True )) for vals in itertools .product (* params ))
9494 if any (v in skipped .get (n , set ()) for n , v in record .items ())
9595 ]
9696 # print(skipped_combs, file=sys.stderr)
97- return skip_for_params (skipped_combs )
97+ return skip_for_params (skipped_combs ) # type: ignore[no-any-return]
9898
9999 return skip
0 commit comments