Skip to content

Conversation

flying-sheep
Copy link
Member

Backports #3782

@flying-sheep flying-sheep enabled auto-merge (squash) September 2, 2025 08:49
Copy link

codecov bot commented Sep 2, 2025

❌ 82 Tests Failed:

Tests completed Failed Passed Skipped
2001 82 1919 106
View the top 3 failed test(s) by shortest run time
tests/test_pca.py::test_mask_defaults[dask_array_sparse-float64]
Stack Traces | 0.007s run time
func = functools.partial(<function mean_agg at 0x7f8d66b699e0>, dtype=dtype('float64'), axis=(0,), keepdims=False)
x = dask.array<mean_chunk, shape=(2, 5), dtype=float64, chunksize=(1, 5), chunktype=scipy.csr_array>
split_every = {0: 4}, keepdims = False, dtype = dtype('float64')
name = 'mean_agg-aggregate-3bb746b1a4218ffd0bbfa3632aa3315a'
reduced_meta = <Compressed Sparse Row sparse array of dtype 'float64'
	with 0 stored elements and shape (0, 0)>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mpartial_reduce#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        func, x, split_every, keepdims=#x1B[94mFalse#x1B[39;49;00m, dtype=#x1B[94mNone#x1B[39;49;00m, name=#x1B[94mNone#x1B[39;49;00m, reduced_meta=#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Partial reduction across multiple axes.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Parameters#x1B[39;49;00m
    #x1B[33m    ----------#x1B[39;49;00m
    #x1B[33m    func : function#x1B[39;49;00m
    #x1B[33m    x : Array#x1B[39;49;00m
    #x1B[33m    split_every : dict#x1B[39;49;00m
    #x1B[33m        Maximum reduction block sizes in each dimension.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Examples#x1B[39;49;00m
    #x1B[33m    --------#x1B[39;49;00m
    #x1B[33m    Reduce across axis 0 and 2, merging a maximum of 1 block in the 0th#x1B[39;49;00m
    #x1B[33m    dimension, and 3 blocks in the 2nd dimension:#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    >>> partial_reduce(np.min, x, {0: 1, 2: 3})    # doctest: +SKIP#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        name = (#x1B[90m#x1B[39;49;00m
            (name #x1B[95mor#x1B[39;49;00m funcname(func)) + #x1B[33m"#x1B[39;49;00m#x1B[33m-#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m + tokenize(func, x, split_every, keepdims, dtype)#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
        parts = [#x1B[90m#x1B[39;49;00m
            #x1B[96mlist#x1B[39;49;00m(partition_all(split_every.get(i, #x1B[94m1#x1B[39;49;00m), #x1B[96mrange#x1B[39;49;00m(n)))#x1B[90m#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m (i, n) #x1B[95min#x1B[39;49;00m #x1B[96menumerate#x1B[39;49;00m(x.numblocks)#x1B[90m#x1B[39;49;00m
        ]#x1B[90m#x1B[39;49;00m
        keys = product(*#x1B[96mmap#x1B[39;49;00m(#x1B[96mrange#x1B[39;49;00m, #x1B[96mmap#x1B[39;49;00m(#x1B[96mlen#x1B[39;49;00m, parts)))#x1B[90m#x1B[39;49;00m
        out_chunks = [#x1B[90m#x1B[39;49;00m
            #x1B[96mtuple#x1B[39;49;00m(#x1B[94m1#x1B[39;49;00m #x1B[94mfor#x1B[39;49;00m p #x1B[95min#x1B[39;49;00m partition_all(split_every[i], c)) #x1B[94mif#x1B[39;49;00m i #x1B[95min#x1B[39;49;00m split_every #x1B[94melse#x1B[39;49;00m c#x1B[90m#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m (i, c) #x1B[95min#x1B[39;49;00m #x1B[96menumerate#x1B[39;49;00m(x.chunks)#x1B[90m#x1B[39;49;00m
        ]#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m keepdims:#x1B[90m#x1B[39;49;00m
            out_axis = [i #x1B[94mfor#x1B[39;49;00m i #x1B[95min#x1B[39;49;00m #x1B[96mrange#x1B[39;49;00m(x.ndim) #x1B[94mif#x1B[39;49;00m i #x1B[95mnot#x1B[39;49;00m #x1B[95min#x1B[39;49;00m split_every]#x1B[90m#x1B[39;49;00m
            getter = #x1B[94mlambda#x1B[39;49;00m k: get(out_axis, k)#x1B[90m#x1B[39;49;00m
            keys = #x1B[96mmap#x1B[39;49;00m(getter, keys)#x1B[90m#x1B[39;49;00m
            out_chunks = #x1B[96mlist#x1B[39;49;00m(getter(out_chunks))#x1B[90m#x1B[39;49;00m
        dsk = {}#x1B[90m#x1B[39;49;00m
        #x1B[94mfor#x1B[39;49;00m k, p #x1B[95min#x1B[39;49;00m #x1B[96mzip#x1B[39;49;00m(keys, product(*parts)):#x1B[90m#x1B[39;49;00m
            free = {#x1B[90m#x1B[39;49;00m
                i: j[#x1B[94m0#x1B[39;49;00m] #x1B[94mfor#x1B[39;49;00m (i, j) #x1B[95min#x1B[39;49;00m #x1B[96menumerate#x1B[39;49;00m(p) #x1B[94mif#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(j) == #x1B[94m1#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m i #x1B[95mnot#x1B[39;49;00m #x1B[95min#x1B[39;49;00m split_every#x1B[90m#x1B[39;49;00m
            }#x1B[90m#x1B[39;49;00m
            dummy = #x1B[96mdict#x1B[39;49;00m(i #x1B[94mfor#x1B[39;49;00m i #x1B[95min#x1B[39;49;00m #x1B[96menumerate#x1B[39;49;00m(p) #x1B[94mif#x1B[39;49;00m i[#x1B[94m0#x1B[39;49;00m] #x1B[95min#x1B[39;49;00m split_every)#x1B[90m#x1B[39;49;00m
            g = lol_tuples((x.name,), #x1B[96mrange#x1B[39;49;00m(x.ndim), free, dummy)#x1B[90m#x1B[39;49;00m
            dsk[(name,) + k] = (func, g)#x1B[90m#x1B[39;49;00m
        graph = HighLevelGraph.from_collections(name, dsk, dependencies=[x])#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        meta = x._meta#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m reduced_meta #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>               meta = func(reduced_meta, computing_meta=#x1B[94mTrue#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/reductions.py#x1B[0m:365: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/reductions.py#x1B[0m:701: in mean_agg
    #x1B[0mn = np.sum(n, axis=axis, dtype=dtype, **kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../numpy/_core/fromnumeric.py#x1B[0m:2466: in sum
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m _wrapreduction(#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

obj = <Compressed Sparse Row sparse array of dtype 'float64'
	with 0 stored elements and shape (0, 0)>
ufunc = <ufunc 'add'>, method = 'sum', axis = (0,), dtype = dtype('float64')
out = None
kwargs = {'initial': <no value>, 'keepdims': False, 'where': <no value>}
passkwargs = {'keepdims': False}
reduction = <bound method _cs_matrix.sum of <Compressed Sparse Row sparse array of dtype 'float64'
	with 0 stored elements and shape (0, 0)>>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m_wrapreduction#x1B[39;49;00m(obj, ufunc, method, axis, dtype, out, **kwargs):#x1B[90m#x1B[39;49;00m
        passkwargs = {k: v #x1B[94mfor#x1B[39;49;00m k, v #x1B[95min#x1B[39;49;00m kwargs.items()#x1B[90m#x1B[39;49;00m
                      #x1B[94mif#x1B[39;49;00m v #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m np._NoValue}#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[96mtype#x1B[39;49;00m(obj) #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m mu.ndarray:#x1B[90m#x1B[39;49;00m
            #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                reduction = #x1B[96mgetattr#x1B[39;49;00m(obj, method)#x1B[90m#x1B[39;49;00m
            #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                #x1B[94mpass#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                #x1B[90m# This branch is needed for reductions like any which don't#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[90m# support a dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[94mif#x1B[39;49;00m dtype #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>                   #x1B[94mreturn#x1B[39;49;00m reduction(axis=axis, dtype=dtype, out=out, **passkwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE                   TypeError: _cs_matrix.sum() got an unexpected keyword argument 'keepdims'#x1B[0m

#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../numpy/_core/fromnumeric.py#x1B[0m:82: TypeError

#x1B[33mDuring handling of the above exception, another exception occurred:#x1B[0m

array_type = <function as_sparse_dask_array at 0x7f8d5bea9ee0>
float_dtype = <class 'numpy.float64'>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_mask_defaults#x1B[39;49;00m(array_type, float_dtype):#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Test if PCA behavior in relation to highly variable genes.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    1. That it’s equal withwithout and with – but mask is None#x1B[39;49;00m
    #x1B[33m    2. If pca takes highly variable as mask as default#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        A = array_type(A_list).astype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat64#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = AnnData(A)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       without_var = sc.pp.pca(adata, copy=#x1B[94mTrue#x1B[39;49;00m, dtype=float_dtype)#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_pca.py#x1B[0m:525: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../preprocessing/_pca/__init__.py#x1B[0m:350: in pca
    #x1B[0mX_pca = pca_.fit_transform(X)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../sklearn/utils/_set_output.py#x1B[0m:316: in wrapped
    #x1B[0mdata_to_wrap = f(#x1B[96mself#x1B[39;49;00m, X, *args, **kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask_ml/decomposition/pca.py#x1B[0m:402: in fit_transform
    #x1B[0mU, S, V = #x1B[96mself#x1B[39;49;00m._fit(X)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask_ml/decomposition/pca.py#x1B[0m:269: in _fit
    #x1B[0m#x1B[96mself#x1B[39;49;00m.mean_ = X.mean(#x1B[94m0#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/core.py#x1B[0m:2634: in mean
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m mean(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/reductions.py#x1B[0m:721: in mean
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m reduction(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/reductions.py#x1B[0m:237: in reduction
    #x1B[0mresult = _tree_reduce(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/reductions.py#x1B[0m:305: in _tree_reduce
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m partial_reduce(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/reductions.py#x1B[0m:369: in partial_reduce
    #x1B[0mmeta = func(reduced_meta)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/reductions.py#x1B[0m:699: in mean_agg
    #x1B[0mns = deepmap(#x1B[94mlambda#x1B[39;49;00m pair: pair[#x1B[33m"#x1B[39;49;00m#x1B[33mn#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m], pairs) #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m computing_meta #x1B[94melse#x1B[39;49;00m pairs#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../site-packages/dask/utils.py#x1B[0m:285: in deepmap
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*seqs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/reductions.py#x1B[0m:699: in <lambda>
    #x1B[0mns = deepmap(#x1B[94mlambda#x1B[39;49;00m pair: pair[#x1B[33m"#x1B[39;49;00m#x1B[33mn#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m], pairs) #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m computing_meta #x1B[94melse#x1B[39;49;00m pairs#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../scipy/sparse/_index.py#x1B[0m:30: in __getitem__
    #x1B[0mindex, new_shape = #x1B[96mself#x1B[39;49;00m._validate_indices(key)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../scipy/sparse/_index.py#x1B[0m:288: in _validate_indices
    #x1B[0midx = #x1B[96mself#x1B[39;49;00m._asindices(idx, N)#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Compressed Sparse Row sparse array of dtype 'float64'
	with 0 stored elements and shape (0, 0)>
idx = array('n', dtype='<U1'), length = 0

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m_asindices#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, idx, length):#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Convert `idx` to a valid index for an axis with a given length.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Subclasses that need special validation can override this method.#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            x = np.asarray(idx)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m (#x1B[96mValueError#x1B[39;49;00m, #x1B[96mTypeError#x1B[39;49;00m, #x1B[96mMemoryError#x1B[39;49;00m) #x1B[94mas#x1B[39;49;00m e:#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mIndexError#x1B[39;49;00m(#x1B[33m'#x1B[39;49;00m#x1B[33minvalid index#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96me#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m x.ndim #x1B[95mnot#x1B[39;49;00m #x1B[95min#x1B[39;49;00m (#x1B[94m1#x1B[39;49;00m, #x1B[94m2#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mIndexError#x1B[39;49;00m(#x1B[33m'#x1B[39;49;00m#x1B[33mIndex dimension must be 1 or 2#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           IndexError: Index dimension must be 1 or 2#x1B[0m

#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../scipy/sparse/_index.py#x1B[0m:324: IndexError
tests/test_pca.py::test_pca_warnings[dask_array_sparse-zero_center-auto-Ignoring svd_solver]
Stack Traces | 0.007s run time
func = functools.partial(<function mean_agg at 0x7f8d66b699e0>, dtype=dtype('float32'), axis=(0,), keepdims=False)
x = dask.array<mean_chunk, shape=(2, 5), dtype=float32, chunksize=(1, 5), chunktype=scipy.csr_array>
split_every = {0: 4}, keepdims = False, dtype = dtype('float32')
name = 'mean_agg-aggregate-372ebe290348d04a9bb61bd37aec643b'
reduced_meta = <Compressed Sparse Row sparse array of dtype 'float32'
	with 0 stored elements and shape (0, 0)>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mpartial_reduce#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        func, x, split_every, keepdims=#x1B[94mFalse#x1B[39;49;00m, dtype=#x1B[94mNone#x1B[39;49;00m, name=#x1B[94mNone#x1B[39;49;00m, reduced_meta=#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Partial reduction across multiple axes.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Parameters#x1B[39;49;00m
    #x1B[33m    ----------#x1B[39;49;00m
    #x1B[33m    func : function#x1B[39;49;00m
    #x1B[33m    x : Array#x1B[39;49;00m
    #x1B[33m    split_every : dict#x1B[39;49;00m
    #x1B[33m        Maximum reduction block sizes in each dimension.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Examples#x1B[39;49;00m
    #x1B[33m    --------#x1B[39;49;00m
    #x1B[33m    Reduce across axis 0 and 2, merging a maximum of 1 block in the 0th#x1B[39;49;00m
    #x1B[33m    dimension, and 3 blocks in the 2nd dimension:#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    >>> partial_reduce(np.min, x, {0: 1, 2: 3})    # doctest: +SKIP#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        name = (#x1B[90m#x1B[39;49;00m
            (name #x1B[95mor#x1B[39;49;00m funcname(func)) + #x1B[33m"#x1B[39;49;00m#x1B[33m-#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m + tokenize(func, x, split_every, keepdims, dtype)#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
        parts = [#x1B[90m#x1B[39;49;00m
            #x1B[96mlist#x1B[39;49;00m(partition_all(split_every.get(i, #x1B[94m1#x1B[39;49;00m), #x1B[96mrange#x1B[39;49;00m(n)))#x1B[90m#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m (i, n) #x1B[95min#x1B[39;49;00m #x1B[96menumerate#x1B[39;49;00m(x.numblocks)#x1B[90m#x1B[39;49;00m
        ]#x1B[90m#x1B[39;49;00m
        keys = product(*#x1B[96mmap#x1B[39;49;00m(#x1B[96mrange#x1B[39;49;00m, #x1B[96mmap#x1B[39;49;00m(#x1B[96mlen#x1B[39;49;00m, parts)))#x1B[90m#x1B[39;49;00m
        out_chunks = [#x1B[90m#x1B[39;49;00m
            #x1B[96mtuple#x1B[39;49;00m(#x1B[94m1#x1B[39;49;00m #x1B[94mfor#x1B[39;49;00m p #x1B[95min#x1B[39;49;00m partition_all(split_every[i], c)) #x1B[94mif#x1B[39;49;00m i #x1B[95min#x1B[39;49;00m split_every #x1B[94melse#x1B[39;49;00m c#x1B[90m#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m (i, c) #x1B[95min#x1B[39;49;00m #x1B[96menumerate#x1B[39;49;00m(x.chunks)#x1B[90m#x1B[39;49;00m
        ]#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m keepdims:#x1B[90m#x1B[39;49;00m
            out_axis = [i #x1B[94mfor#x1B[39;49;00m i #x1B[95min#x1B[39;49;00m #x1B[96mrange#x1B[39;49;00m(x.ndim) #x1B[94mif#x1B[39;49;00m i #x1B[95mnot#x1B[39;49;00m #x1B[95min#x1B[39;49;00m split_every]#x1B[90m#x1B[39;49;00m
            getter = #x1B[94mlambda#x1B[39;49;00m k: get(out_axis, k)#x1B[90m#x1B[39;49;00m
            keys = #x1B[96mmap#x1B[39;49;00m(getter, keys)#x1B[90m#x1B[39;49;00m
            out_chunks = #x1B[96mlist#x1B[39;49;00m(getter(out_chunks))#x1B[90m#x1B[39;49;00m
        dsk = {}#x1B[90m#x1B[39;49;00m
        #x1B[94mfor#x1B[39;49;00m k, p #x1B[95min#x1B[39;49;00m #x1B[96mzip#x1B[39;49;00m(keys, product(*parts)):#x1B[90m#x1B[39;49;00m
            free = {#x1B[90m#x1B[39;49;00m
                i: j[#x1B[94m0#x1B[39;49;00m] #x1B[94mfor#x1B[39;49;00m (i, j) #x1B[95min#x1B[39;49;00m #x1B[96menumerate#x1B[39;49;00m(p) #x1B[94mif#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(j) == #x1B[94m1#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m i #x1B[95mnot#x1B[39;49;00m #x1B[95min#x1B[39;49;00m split_every#x1B[90m#x1B[39;49;00m
            }#x1B[90m#x1B[39;49;00m
            dummy = #x1B[96mdict#x1B[39;49;00m(i #x1B[94mfor#x1B[39;49;00m i #x1B[95min#x1B[39;49;00m #x1B[96menumerate#x1B[39;49;00m(p) #x1B[94mif#x1B[39;49;00m i[#x1B[94m0#x1B[39;49;00m] #x1B[95min#x1B[39;49;00m split_every)#x1B[90m#x1B[39;49;00m
            g = lol_tuples((x.name,), #x1B[96mrange#x1B[39;49;00m(x.ndim), free, dummy)#x1B[90m#x1B[39;49;00m
            dsk[(name,) + k] = (func, g)#x1B[90m#x1B[39;49;00m
        graph = HighLevelGraph.from_collections(name, dsk, dependencies=[x])#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        meta = x._meta#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m reduced_meta #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>               meta = func(reduced_meta, computing_meta=#x1B[94mTrue#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/reductions.py#x1B[0m:365: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/reductions.py#x1B[0m:701: in mean_agg
    #x1B[0mn = np.sum(n, axis=axis, dtype=dtype, **kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../numpy/_core/fromnumeric.py#x1B[0m:2466: in sum
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m _wrapreduction(#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

obj = <Compressed Sparse Row sparse array of dtype 'float32'
	with 0 stored elements and shape (0, 0)>
ufunc = <ufunc 'add'>, method = 'sum', axis = (0,), dtype = dtype('float32')
out = None
kwargs = {'initial': <no value>, 'keepdims': False, 'where': <no value>}
passkwargs = {'keepdims': False}
reduction = <bound method _cs_matrix.sum of <Compressed Sparse Row sparse array of dtype 'float32'
	with 0 stored elements and shape (0, 0)>>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m_wrapreduction#x1B[39;49;00m(obj, ufunc, method, axis, dtype, out, **kwargs):#x1B[90m#x1B[39;49;00m
        passkwargs = {k: v #x1B[94mfor#x1B[39;49;00m k, v #x1B[95min#x1B[39;49;00m kwargs.items()#x1B[90m#x1B[39;49;00m
                      #x1B[94mif#x1B[39;49;00m v #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m np._NoValue}#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[96mtype#x1B[39;49;00m(obj) #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m mu.ndarray:#x1B[90m#x1B[39;49;00m
            #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                reduction = #x1B[96mgetattr#x1B[39;49;00m(obj, method)#x1B[90m#x1B[39;49;00m
            #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                #x1B[94mpass#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                #x1B[90m# This branch is needed for reductions like any which don't#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[90m# support a dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[94mif#x1B[39;49;00m dtype #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>                   #x1B[94mreturn#x1B[39;49;00m reduction(axis=axis, dtype=dtype, out=out, **passkwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE                   TypeError: _cs_matrix.sum() got an unexpected keyword argument 'keepdims'#x1B[0m

#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../numpy/_core/fromnumeric.py#x1B[0m:82: TypeError

#x1B[33mDuring handling of the above exception, another exception occurred:#x1B[0m

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33marray_type#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mzero_center#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33msvd_solver#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mwarn_pat_expected#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                array_type.values[#x1B[94m0#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
                zero_center,#x1B[90m#x1B[39;49;00m
                svd_solver,#x1B[90m#x1B[39;49;00m
                warn_pat_expected,#x1B[90m#x1B[39;49;00m
                marks=(#x1B[90m#x1B[39;49;00m
                    array_type.marks#x1B[90m#x1B[39;49;00m
                    #x1B[94mif#x1B[39;49;00m xfail_reason #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                    #x1B[94melse#x1B[39;49;00m [pytest.mark.xfail(reason=xfail_reason)]#x1B[90m#x1B[39;49;00m
                ),#x1B[90m#x1B[39;49;00m
                #x1B[96mid#x1B[39;49;00m=(#x1B[90m#x1B[39;49;00m
                    #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m{#x1B[39;49;00marray_type.id#x1B[33m}#x1B[39;49;00m#x1B[33m-#x1B[39;49;00m#x1B[33m{#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mzero_center#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mif#x1B[39;49;00m#x1B[90m #x1B[39;49;00mzero_center#x1B[90m #x1B[39;49;00m#x1B[94melse#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mno_zero_center#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m}#x1B[39;49;00m#x1B[33m-#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                    #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m{#x1B[39;49;00msvd_solver#x1B[90m #x1B[39;49;00m#x1B[95mor#x1B[39;49;00m#x1B[90m #x1B[39;49;00msvd_solver_type#x1B[33m}#x1B[39;49;00m#x1B[33m-#x1B[39;49;00m#x1B[33m{#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mxfail#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mif#x1B[39;49;00m#x1B[90m #x1B[39;49;00mxfail_reason#x1B[90m #x1B[39;49;00m#x1B[94melse#x1B[39;49;00m#x1B[90m #x1B[39;49;00mwarn_pat_expected#x1B[33m}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                ),#x1B[90m#x1B[39;49;00m
            )#x1B[90m#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m array_type #x1B[95min#x1B[39;49;00m ARRAY_TYPES#x1B[90m#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m zero_center #x1B[95min#x1B[39;49;00m [#x1B[94mTrue#x1B[39;49;00m, #x1B[94mFalse#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m svd_solver_type #x1B[95min#x1B[39;49;00m [#x1B[94mNone#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvalid#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33minvalid#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m svd_solver, warn_pat_expected, xfail_reason #x1B[95min#x1B[39;49;00m gen_pca_params(#x1B[90m#x1B[39;49;00m
                array_type=array_type.values[#x1B[94m0#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
                zero_center=zero_center,#x1B[90m#x1B[39;49;00m
                svd_solver_type=svd_solver_type,#x1B[90m#x1B[39;49;00m
            )#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_pca_warnings#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        *,#x1B[90m#x1B[39;49;00m
        array_type: ArrayType,#x1B[90m#x1B[39;49;00m
        zero_center: #x1B[96mbool#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        svd_solver: SVDSolver,#x1B[90m#x1B[39;49;00m
        warn_pat_expected: #x1B[96mstr#x1B[39;49;00m | #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        A = array_type(A_list).astype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat32#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = AnnData(A)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m warn_pat_expected #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mwith#x1B[39;49;00m pytest.warns((#x1B[96mUserWarning#x1B[39;49;00m, #x1B[96mFutureWarning#x1B[39;49;00m), match=warn_pat_expected):  #x1B[90m# noqa: PT031#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                warnings.filterwarnings(#x1B[90m#x1B[39;49;00m
                    #x1B[33m"#x1B[39;49;00m#x1B[33mignore#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33mr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m.*Using a dense eigensolver instead of LOBPCG#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[96mUserWarning#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                )#x1B[90m#x1B[39;49;00m
>               sc.pp.pca(adata, svd_solver=svd_solver, zero_center=zero_center)#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_pca.py#x1B[0m:245: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../preprocessing/_pca/__init__.py#x1B[0m:350: in pca
    #x1B[0mX_pca = pca_.fit_transform(X)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../sklearn/utils/_set_output.py#x1B[0m:316: in wrapped
    #x1B[0mdata_to_wrap = f(#x1B[96mself#x1B[39;49;00m, X, *args, **kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask_ml/decomposition/pca.py#x1B[0m:402: in fit_transform
    #x1B[0mU, S, V = #x1B[96mself#x1B[39;49;00m._fit(X)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask_ml/decomposition/pca.py#x1B[0m:269: in _fit
    #x1B[0m#x1B[96mself#x1B[39;49;00m.mean_ = X.mean(#x1B[94m0#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/core.py#x1B[0m:2634: in mean
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m mean(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/reductions.py#x1B[0m:721: in mean
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m reduction(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/reductions.py#x1B[0m:237: in reduction
    #x1B[0mresult = _tree_reduce(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/reductions.py#x1B[0m:305: in _tree_reduce
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m partial_reduce(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/reductions.py#x1B[0m:369: in partial_reduce
    #x1B[0mmeta = func(reduced_meta)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/reductions.py#x1B[0m:699: in mean_agg
    #x1B[0mns = deepmap(#x1B[94mlambda#x1B[39;49;00m pair: pair[#x1B[33m"#x1B[39;49;00m#x1B[33mn#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m], pairs) #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m computing_meta #x1B[94melse#x1B[39;49;00m pairs#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../site-packages/dask/utils.py#x1B[0m:285: in deepmap
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*seqs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/reductions.py#x1B[0m:699: in <lambda>
    #x1B[0mns = deepmap(#x1B[94mlambda#x1B[39;49;00m pair: pair[#x1B[33m"#x1B[39;49;00m#x1B[33mn#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m], pairs) #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m computing_meta #x1B[94melse#x1B[39;49;00m pairs#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../scipy/sparse/_index.py#x1B[0m:30: in __getitem__
    #x1B[0mindex, new_shape = #x1B[96mself#x1B[39;49;00m._validate_indices(key)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../scipy/sparse/_index.py#x1B[0m:288: in _validate_indices
    #x1B[0midx = #x1B[96mself#x1B[39;49;00m._asindices(idx, N)#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Compressed Sparse Row sparse array of dtype 'float32'
	with 0 stored elements and shape (0, 0)>
idx = array('n', dtype='<U1'), length = 0

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m_asindices#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, idx, length):#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Convert `idx` to a valid index for an axis with a given length.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Subclasses that need special validation can override this method.#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            x = np.asarray(idx)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m (#x1B[96mValueError#x1B[39;49;00m, #x1B[96mTypeError#x1B[39;49;00m, #x1B[96mMemoryError#x1B[39;49;00m) #x1B[94mas#x1B[39;49;00m e:#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mIndexError#x1B[39;49;00m(#x1B[33m'#x1B[39;49;00m#x1B[33minvalid index#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96me#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m x.ndim #x1B[95mnot#x1B[39;49;00m #x1B[95min#x1B[39;49;00m (#x1B[94m1#x1B[39;49;00m, #x1B[94m2#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mIndexError#x1B[39;49;00m(#x1B[33m'#x1B[39;49;00m#x1B[33mIndex dimension must be 1 or 2#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           IndexError: Index dimension must be 1 or 2#x1B[0m

#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../scipy/sparse/_index.py#x1B[0m:324: IndexError

#x1B[33mDuring handling of the above exception, another exception occurred:#x1B[0m

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33marray_type#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mzero_center#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33msvd_solver#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mwarn_pat_expected#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                array_type.values[#x1B[94m0#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
                zero_center,#x1B[90m#x1B[39;49;00m
                svd_solver,#x1B[90m#x1B[39;49;00m
                warn_pat_expected,#x1B[90m#x1B[39;49;00m
                marks=(#x1B[90m#x1B[39;49;00m
                    array_type.marks#x1B[90m#x1B[39;49;00m
                    #x1B[94mif#x1B[39;49;00m xfail_reason #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                    #x1B[94melse#x1B[39;49;00m [pytest.mark.xfail(reason=xfail_reason)]#x1B[90m#x1B[39;49;00m
                ),#x1B[90m#x1B[39;49;00m
                #x1B[96mid#x1B[39;49;00m=(#x1B[90m#x1B[39;49;00m
                    #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m{#x1B[39;49;00marray_type.id#x1B[33m}#x1B[39;49;00m#x1B[33m-#x1B[39;49;00m#x1B[33m{#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mzero_center#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mif#x1B[39;49;00m#x1B[90m #x1B[39;49;00mzero_center#x1B[90m #x1B[39;49;00m#x1B[94melse#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mno_zero_center#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m}#x1B[39;49;00m#x1B[33m-#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                    #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m{#x1B[39;49;00msvd_solver#x1B[90m #x1B[39;49;00m#x1B[95mor#x1B[39;49;00m#x1B[90m #x1B[39;49;00msvd_solver_type#x1B[33m}#x1B[39;49;00m#x1B[33m-#x1B[39;49;00m#x1B[33m{#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mxfail#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mif#x1B[39;49;00m#x1B[90m #x1B[39;49;00mxfail_reason#x1B[90m #x1B[39;49;00m#x1B[94melse#x1B[39;49;00m#x1B[90m #x1B[39;49;00mwarn_pat_expected#x1B[33m}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                ),#x1B[90m#x1B[39;49;00m
            )#x1B[90m#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m array_type #x1B[95min#x1B[39;49;00m ARRAY_TYPES#x1B[90m#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m zero_center #x1B[95min#x1B[39;49;00m [#x1B[94mTrue#x1B[39;49;00m, #x1B[94mFalse#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m svd_solver_type #x1B[95min#x1B[39;49;00m [#x1B[94mNone#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvalid#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33minvalid#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m svd_solver, warn_pat_expected, xfail_reason #x1B[95min#x1B[39;49;00m gen_pca_params(#x1B[90m#x1B[39;49;00m
                array_type=array_type.values[#x1B[94m0#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
                zero_center=zero_center,#x1B[90m#x1B[39;49;00m
                svd_solver_type=svd_solver_type,#x1B[90m#x1B[39;49;00m
            )#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_pca_warnings#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        *,#x1B[90m#x1B[39;49;00m
        array_type: ArrayType,#x1B[90m#x1B[39;49;00m
        zero_center: #x1B[96mbool#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        svd_solver: SVDSolver,#x1B[90m#x1B[39;49;00m
        warn_pat_expected: #x1B[96mstr#x1B[39;49;00m | #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        A = array_type(A_list).astype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat32#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = AnnData(A)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m warn_pat_expected #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           #x1B[94mwith#x1B[39;49;00m pytest.warns((#x1B[96mUserWarning#x1B[39;49;00m, #x1B[96mFutureWarning#x1B[39;49;00m), match=warn_pat_expected):  #x1B[90m# noqa: PT031#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>, <class 'FutureWarning'>) were emitted.#x1B[0m
#x1B[1m#x1B[31mE            Emitted warnings: [].#x1B[0m

#x1B[1m#x1B[31mtests/test_pca.py#x1B[0m:241: Failed
tests/test_utils.py::test_axis_sum[dask_array_sparse]
Stack Traces | 0.007s run time
array_type = <function as_sparse_dask_array at 0x7f78cb6f2980>

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        #x1B[33m"#x1B[39;49;00m#x1B[33marray_type#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [*ARRAY_TYPES, pytest.param(sparse.coo_matrix, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mscipy_coo#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)]#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_axis_sum#x1B[39;49;00m(array_type):#x1B[90m#x1B[39;49;00m
        m1 = array_type(asarray([[#x1B[94m0#x1B[39;49;00m, #x1B[94m1#x1B[39;49;00m, #x1B[94m1#x1B[39;49;00m], [#x1B[94m1#x1B[39;49;00m, #x1B[94m0#x1B[39;49;00m, #x1B[94m1#x1B[39;49;00m]]))#x1B[90m#x1B[39;49;00m
        expd_0 = np.array([#x1B[94m1#x1B[39;49;00m, #x1B[94m1#x1B[39;49;00m, #x1B[94m2#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
        expd_1 = np.array([#x1B[94m2#x1B[39;49;00m, #x1B[94m2#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
>       res_0 = asarray(axis_sum(m1, axis=#x1B[94m0#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_utils.py#x1B[0m:169: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../usr/lib/python3.12/functools.py#x1B[0m:909: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../scanpy/_utils/__init__.py#x1B[0m:804: in _
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m da.reduction(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/reductions.py#x1B[0m:216: in reduction
    #x1B[0mtmp = blockwise(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/blockwise.py#x1B[0m:289: in blockwise
    #x1B[0mmeta = compute_meta(func, dtype, *args[::#x1B[94m2#x1B[39;49;00m], **kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../dask/array/utils.py#x1B[0m:141: in compute_meta
    #x1B[0mmeta = func(*args_meta, **kwargs_meta)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../scanpy/_utils/__init__.py#x1B[0m:799: in sum_drop_keepdims
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m np.array(np.sum(*args, dtype=dtype, **kwargs))#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../numpy/_core/fromnumeric.py#x1B[0m:2466: in sum
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m _wrapreduction(#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

obj = <Compressed Sparse Row sparse array of dtype 'int64'
	with 0 stored elements and shape (0, 0)>
ufunc = <ufunc 'add'>, method = 'sum', axis = (0,), dtype = dtype('int64')
out = None
kwargs = {'initial': <no value>, 'keepdims': True, 'where': <no value>}
passkwargs = {'keepdims': True}
reduction = <bound method _cs_matrix.sum of <Compressed Sparse Row sparse array of dtype 'int64'
	with 0 stored elements and shape (0, 0)>>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m_wrapreduction#x1B[39;49;00m(obj, ufunc, method, axis, dtype, out, **kwargs):#x1B[90m#x1B[39;49;00m
        passkwargs = {k: v #x1B[94mfor#x1B[39;49;00m k, v #x1B[95min#x1B[39;49;00m kwargs.items()#x1B[90m#x1B[39;49;00m
                      #x1B[94mif#x1B[39;49;00m v #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m np._NoValue}#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[96mtype#x1B[39;49;00m(obj) #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m mu.ndarray:#x1B[90m#x1B[39;49;00m
            #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                reduction = #x1B[96mgetattr#x1B[39;49;00m(obj, method)#x1B[90m#x1B[39;49;00m
            #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                #x1B[94mpass#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                #x1B[90m# This branch is needed for reductions like any which don't#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[90m# support a dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[94mif#x1B[39;49;00m dtype #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>                   #x1B[94mreturn#x1B[39;49;00m reduction(axis=axis, dtype=dtype, out=out, **passkwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE                   TypeError: _cs_matrix.sum() got an unexpected keyword argument 'keepdims'#x1B[0m

#x1B[1m#x1B[31m../../../..../scanpy/B9PcT7QG/hatch-test.pre/lib/python3.12.../numpy/_core/fromnumeric.py#x1B[0m:82: TypeError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@flying-sheep flying-sheep merged commit 8105212 into 1.11.x Sep 2, 2025
6 of 9 checks passed
@flying-sheep flying-sheep deleted the auto-backport-of-pr-3782-on-1.11.x branch September 2, 2025 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant