@@ -14,11 +14,12 @@ def _extract(
1414 layer : str | None = None ,
1515 raw : bool = False ,
1616) -> tuple [np .ndarray , np .ndarray , np .ndarray ]:
17- assert isinstance (data , list | pd .DataFrame | AnnData ), \
18- 'mat must be a list of [matrix, samples, features], pd.DataFrame (samples x features)\n \
19- or an AnnData instance'
20- assert layer is None or isinstance (layer , str ), 'layer must be str or None'
21- assert isinstance (raw , bool ), 'raw must be bool'
17+ assert isinstance (data , list | pd .DataFrame | AnnData ), (
18+ "mat must be a list of [matrix, samples, features], pd.DataFrame (samples x features)\n \
19+ or an AnnData instance"
20+ )
21+ assert layer is None or isinstance (layer , str ), "layer must be str or None"
22+ assert isinstance (raw , bool ), "raw must be bool"
2223 if isinstance (data , list ):
2324 mat , row , col = data
2425 mat = np .array (mat )
@@ -44,13 +45,9 @@ def _extract(
4445
4546
4647def _validate_mat (
47- mat : np .ndarray ,
48- row : np .ndarray ,
49- col : np .ndarray ,
50- empty : bool = True ,
51- verbose : bool = False
48+ mat : np .ndarray , row : np .ndarray , col : np .ndarray , empty : bool = True , verbose : bool = False
5249) -> tuple [np .ndarray , np .ndarray , np .ndarray ]:
53- assert isinstance (empty , bool ), ' empty must be bool'
50+ assert isinstance (empty , bool ), " empty must be bool"
5451 # Accept any sparse format but transform to csr
5552 if sps .issparse (mat ) and not isinstance (mat , sps .csr_matrix ):
5653 mat = sps .csr_matrix (mat )
0 commit comments