Skip to content

Conversation

@flying-sheep
Copy link
Member

@codecov
Copy link

codecov bot commented Oct 31, 2025

❌ 6 Tests Failed:

Tests completed Failed Passed Skipped
2411 6 2405 137
View the full list of 6 ❄️ flaky test(s)
tests/test_clustering.py::test_leiden_random_state[igraph]

Flake rate in main: 100.00% (Passed 0 times, Failed 1 times)

Stack Traces | 0.064s run time
adata_neighbors = AnnData object with n_obs × n_vars = 700 × 765
    obs: 'bulk_labels', 'n_genes', 'percent_mito', 'n_counts', 'S_score...ghbors', 'pca', 'rank_genes_groups'
    obsm: 'X_pca', 'X_umap'
    varm: 'PCs'
    obsp: 'distances', 'connectivities'
flavor = 'igraph'

    #x1B[0m#x1B[37m@needs#x1B[39;49;00m.leidenalg#x1B[90m#x1B[39;49;00m
    #x1B[37m@needs#x1B[39;49;00m.igraph#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mflavor#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, FLAVORS)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_leiden_random_state#x1B[39;49;00m(adata_neighbors, flavor):#x1B[90m#x1B[39;49;00m
        is_leiden_alg = flavor == #x1B[33m"#x1B[39;49;00m#x1B[33mleidenalg#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        n_iterations = #x1B[94m2#x1B[39;49;00m #x1B[94mif#x1B[39;49;00m is_leiden_alg #x1B[94melse#x1B[39;49;00m -#x1B[94m1#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        adata_1 = sc.tl.leiden(#x1B[90m#x1B[39;49;00m
            adata_neighbors,#x1B[90m#x1B[39;49;00m
            flavor=flavor,#x1B[90m#x1B[39;49;00m
            random_state=#x1B[94m1#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            copy=#x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            directed=is_leiden_alg,#x1B[90m#x1B[39;49;00m
            n_iterations=n_iterations,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
        adata_1_again = sc.tl.leiden(#x1B[90m#x1B[39;49;00m
            adata_neighbors,#x1B[90m#x1B[39;49;00m
            flavor=flavor,#x1B[90m#x1B[39;49;00m
            random_state=#x1B[94m1#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            copy=#x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            directed=is_leiden_alg,#x1B[90m#x1B[39;49;00m
            n_iterations=n_iterations,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
        adata_2 = sc.tl.leiden(#x1B[90m#x1B[39;49;00m
            adata_neighbors,#x1B[90m#x1B[39;49;00m
            flavor=flavor,#x1B[90m#x1B[39;49;00m
            random_state=#x1B[94m2#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            copy=#x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            directed=is_leiden_alg,#x1B[90m#x1B[39;49;00m
            n_iterations=n_iterations,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
        pd.testing.assert_series_equal(adata_1.obs[#x1B[33m"#x1B[39;49;00m#x1B[33mleiden#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m], adata_1_again.obs[#x1B[33m"#x1B[39;49;00m#x1B[33mleiden#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
>       #x1B[94massert#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m adata_2.obs[#x1B[33m"#x1B[39;49;00m#x1B[33mleiden#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m].equals(adata_1_again.obs[#x1B[33m"#x1B[39;49;00m#x1B[33mleiden#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       AssertionError: assert not True#x1B[0m
#x1B[1m#x1B[31mE        +  where True = equals(index\nAAAGCCTGGCTAAC-1    0\nAAATTCGATGCACA-1    0\nAACACGTGGTCTTT-1    1\nAAGTGCACGTGCTA-1    2\nACACGAACGGAGTG-1    3\n                   ..\nTGGCACCTCCAACA-8    3\nTGTGAGTGCTTTAC-8    0\nTGTTACTGGCGATT-8    6\nTTCAGTACCGGGAA-8    7\nTTGAGGTGGAGAGC-8    3\nName: leiden, Length: 700, dtype: category\nCategories (12, object): ['0', '1', '2', '3', ..., '8', '9', '10', '11'])#x1B[0m
#x1B[1m#x1B[31mE        +    where equals = index\nAAAGCCTGGCTAAC-1    0\nAAATTCGATGCACA-1    0\nAACACGTGGTCTTT-1    1\nAAGTGCACGTGCTA-1    2\nACACGAACGGAGTG-1    3\n                   ..\nTGGCACCTCCAACA-8    3\nTGTGAGTGCTTTAC-8    0\nTGTTACTGGCGATT-8    6\nTTCAGTACCGGGAA-8    7\nTTGAGGTGGAGAGC-8    3\nName: leiden, Length: 700, dtype: category\nCategories (12, object): ['0', '1', '2', '3', ..., '8', '9', '10', '11'].equals#x1B[0m

#x1B[1m#x1B[31mtests/test_clustering.py#x1B[0m:76: AssertionError
tests/test_paga.py::test_paga_pie

Flake rate in main: 100.00% (Passed 0 times, Failed 1 times)

Stack Traces | 0.1s run time
image_comparer = <function image_comparer.<locals>.save_and_compare at 0x7fb48745d6c0>
pbmc = AnnData object with n_obs × n_vars = 700 × 765
    obs: 'bulk_labels', 'n_genes', 'percent_mito', 'n_counts', 'S_score...roups', 'paga', 'bulk_labels_sizes'
    obsm: 'X_pca', 'X_umap'
    varm: 'PCs'
    obsp: 'distances', 'connectivities'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_paga_pie#x1B[39;49;00m(image_comparer, pbmc) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        save_and_compare_images = partial(image_comparer, ROOT, tol=#x1B[94m30#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        colors = {#x1B[90m#x1B[39;49;00m
            c: {cm.Set1(_): #x1B[94m0.33#x1B[39;49;00m #x1B[94mfor#x1B[39;49;00m _ #x1B[95min#x1B[39;49;00m #x1B[96mrange#x1B[39;49;00m(#x1B[94m3#x1B[39;49;00m)}#x1B[90m#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m c #x1B[95min#x1B[39;49;00m pbmc.obs[#x1B[33m"#x1B[39;49;00m#x1B[33mbulk_labels#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m].cat.categories#x1B[90m#x1B[39;49;00m
        }#x1B[90m#x1B[39;49;00m
        colors[#x1B[33m"#x1B[39;49;00m#x1B[33mDendritic#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = {cm.Set2(_): #x1B[94m0.25#x1B[39;49;00m #x1B[94mfor#x1B[39;49;00m _ #x1B[95min#x1B[39;49;00m #x1B[96mrange#x1B[39;49;00m(#x1B[94m4#x1B[39;49;00m)}#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        sc.pl.paga(pbmc, color=colors, colorbar=#x1B[94mFalse#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
>       save_and_compare_images(#x1B[33m"#x1B[39;49;00m#x1B[33mpaga_pie#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       AssertionError: Image files did not match.#x1B[0m
#x1B[1m#x1B[31mE       RMS Value:  71.40438286136829#x1B[0m
#x1B[1m#x1B[31mE       Expected:   file:.../_images/paga_pie/expected.png#x1B[0m
#x1B[1m#x1B[31mE       Actual:     file:.../_images/paga_pie/actual.png#x1B[0m
#x1B[1m#x1B[31mE       Difference: file:.../_images/paga_pie/actual-failed-diff.png#x1B[0m
#x1B[1m#x1B[31mE       Tolerance:  30#x1B[0m

#x1B[1m#x1B[31mtests/test_paga.py#x1B[0m:73: AssertionError
tests/test_paga.py::test_paga_plots[-paga]

Flake rate in main: 100.00% (Passed 0 times, Failed 1 times)

Stack Traces | 0.044s run time
image_comparer = <function image_comparer.<locals>.save_and_compare at 0x7fb437adc680>
pbmc = AnnData object with n_obs × n_vars = 700 × 765
    obs: 'bulk_labels', 'n_genes', 'percent_mito', 'n_counts', 'S_score...roups', 'paga', 'bulk_labels_sizes'
    obsm: 'X_pca', 'X_umap'
    varm: 'PCs'
    obsp: 'distances', 'connectivities'
test_id = '', func = <function paga at 0x7fb489d42de0>

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mtest_id#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mfunc#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, sc.pl.paga),#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33mcontinuous#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, partial(sc.pl.paga, color=#x1B[33m"#x1B[39;49;00m#x1B[33mCST3#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)),#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33mcontinuous_obs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, partial(sc.pl.paga, color=#x1B[33m"#x1B[39;49;00m#x1B[33mcool_feature#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)),#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33mcontinuous_multiple#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, partial(sc.pl.paga, color=[#x1B[33m"#x1B[39;49;00m#x1B[33mCST3#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mGATA2#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])),#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33mcompare#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, partial(sc.pl.paga_compare, legend_fontoutline=#x1B[94m2#x1B[39;49;00m)),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mcompare_continuous#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                partial(sc.pl.paga_compare, color=#x1B[33m"#x1B[39;49;00m#x1B[33mCST3#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, legend_fontsize=#x1B[94m5#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
                marks=pytest.mark.xfail(reason=#x1B[33m"#x1B[39;49;00m#x1B[33mexpects .uns[#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mpaga#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m][#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mpos#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[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mcompare_pca#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                partial(sc.pl.paga_compare, basis=#x1B[33m"#x1B[39;49;00m#x1B[33mX_pca#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, legend_fontweight=#x1B[33m"#x1B[39;49;00m#x1B[33mnormal#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[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_paga_plots#x1B[39;49;00m(image_comparer, pbmc, test_id, func):#x1B[90m#x1B[39;49;00m
        save_and_compare_images = partial(image_comparer, ROOT, tol=#x1B[94m30#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        common = #x1B[96mdict#x1B[39;49;00m(threshold=#x1B[94m0.5#x1B[39;49;00m, max_edge_width=#x1B[94m1.0#x1B[39;49;00m, random_state=#x1B[94m0#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        func(pbmc, **common)#x1B[90m#x1B[39;49;00m
>       save_and_compare_images(#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mpaga_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mtest_id#x1B[33m}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[94mif#x1B[39;49;00m test_id #x1B[94melse#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mpaga#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       AssertionError: Image files did not match.#x1B[0m
#x1B[1m#x1B[31mE       RMS Value:  41.64525185902755#x1B[0m
#x1B[1m#x1B[31mE       Expected:   file:.../_images/paga/expected.png#x1B[0m
#x1B[1m#x1B[31mE       Actual:     file:.../_images/paga/actual.png#x1B[0m
#x1B[1m#x1B[31mE       Difference: file:.../_images/paga/actual-failed-diff.png#x1B[0m
#x1B[1m#x1B[31mE       Tolerance:  30#x1B[0m

#x1B[1m#x1B[31mtests/test_paga.py#x1B[0m:60: AssertionError
tests/test_paga.py::test_paga_plots[continuous-func1]

Flake rate in main: 100.00% (Passed 0 times, Failed 1 times)

Stack Traces | 0.085s run time
image_comparer = <function image_comparer.<locals>.save_and_compare at 0x7fb437b13240>
pbmc = AnnData object with n_obs × n_vars = 700 × 765
    obs: 'bulk_labels', 'n_genes', 'percent_mito', 'n_counts', 'S_score...roups', 'paga', 'bulk_labels_sizes'
    obsm: 'X_pca', 'X_umap'
    varm: 'PCs'
    obsp: 'distances', 'connectivities'
test_id = 'continuous'
func = functools.partial(<function paga at 0x7fb489d42de0>, color='CST3')

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mtest_id#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mfunc#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, sc.pl.paga),#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33mcontinuous#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, partial(sc.pl.paga, color=#x1B[33m"#x1B[39;49;00m#x1B[33mCST3#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)),#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33mcontinuous_obs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, partial(sc.pl.paga, color=#x1B[33m"#x1B[39;49;00m#x1B[33mcool_feature#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)),#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33mcontinuous_multiple#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, partial(sc.pl.paga, color=[#x1B[33m"#x1B[39;49;00m#x1B[33mCST3#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mGATA2#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])),#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33mcompare#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, partial(sc.pl.paga_compare, legend_fontoutline=#x1B[94m2#x1B[39;49;00m)),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mcompare_continuous#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                partial(sc.pl.paga_compare, color=#x1B[33m"#x1B[39;49;00m#x1B[33mCST3#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, legend_fontsize=#x1B[94m5#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
                marks=pytest.mark.xfail(reason=#x1B[33m"#x1B[39;49;00m#x1B[33mexpects .uns[#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mpaga#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m][#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mpos#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[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mcompare_pca#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                partial(sc.pl.paga_compare, basis=#x1B[33m"#x1B[39;49;00m#x1B[33mX_pca#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, legend_fontweight=#x1B[33m"#x1B[39;49;00m#x1B[33mnormal#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[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_paga_plots#x1B[39;49;00m(image_comparer, pbmc, test_id, func):#x1B[90m#x1B[39;49;00m
        save_and_compare_images = partial(image_comparer, ROOT, tol=#x1B[94m30#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        common = #x1B[96mdict#x1B[39;49;00m(threshold=#x1B[94m0.5#x1B[39;49;00m, max_edge_width=#x1B[94m1.0#x1B[39;49;00m, random_state=#x1B[94m0#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        func(pbmc, **common)#x1B[90m#x1B[39;49;00m
>       save_and_compare_images(#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mpaga_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mtest_id#x1B[33m}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[94mif#x1B[39;49;00m test_id #x1B[94melse#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mpaga#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       AssertionError: Image files did not match.#x1B[0m
#x1B[1m#x1B[31mE       RMS Value:  40.145452243003106#x1B[0m
#x1B[1m#x1B[31mE       Expected:   file:.../_images/paga_continuous/expected.png#x1B[0m
#x1B[1m#x1B[31mE       Actual:     file:.../_images/paga_continuous/actual.png#x1B[0m
#x1B[1m#x1B[31mE       Difference: file:.../_images/paga_continuous/actual-failed-diff.png#x1B[0m
#x1B[1m#x1B[31mE       Tolerance:  30#x1B[0m

#x1B[1m#x1B[31mtests/test_paga.py#x1B[0m:60: AssertionError
tests/test_paga.py::test_paga_plots[continuous_multiple-func3]

Flake rate in main: 100.00% (Passed 0 times, Failed 1 times)

Stack Traces | 0.157s run time
image_comparer = <function image_comparer.<locals>.save_and_compare at 0x7fb43d5b9f80>
pbmc = AnnData object with n_obs × n_vars = 700 × 765
    obs: 'bulk_labels', 'n_genes', 'percent_mito', 'n_counts', 'S_score...roups', 'paga', 'bulk_labels_sizes'
    obsm: 'X_pca', 'X_umap'
    varm: 'PCs'
    obsp: 'distances', 'connectivities'
test_id = 'continuous_multiple'
func = functools.partial(<function paga at 0x7fb489d42de0>, color=['CST3', 'GATA2'])

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mtest_id#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mfunc#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, sc.pl.paga),#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33mcontinuous#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, partial(sc.pl.paga, color=#x1B[33m"#x1B[39;49;00m#x1B[33mCST3#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)),#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33mcontinuous_obs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, partial(sc.pl.paga, color=#x1B[33m"#x1B[39;49;00m#x1B[33mcool_feature#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)),#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33mcontinuous_multiple#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, partial(sc.pl.paga, color=[#x1B[33m"#x1B[39;49;00m#x1B[33mCST3#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mGATA2#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])),#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33mcompare#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, partial(sc.pl.paga_compare, legend_fontoutline=#x1B[94m2#x1B[39;49;00m)),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mcompare_continuous#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                partial(sc.pl.paga_compare, color=#x1B[33m"#x1B[39;49;00m#x1B[33mCST3#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, legend_fontsize=#x1B[94m5#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
                marks=pytest.mark.xfail(reason=#x1B[33m"#x1B[39;49;00m#x1B[33mexpects .uns[#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mpaga#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m][#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mpos#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[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mcompare_pca#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                partial(sc.pl.paga_compare, basis=#x1B[33m"#x1B[39;49;00m#x1B[33mX_pca#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, legend_fontweight=#x1B[33m"#x1B[39;49;00m#x1B[33mnormal#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[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_paga_plots#x1B[39;49;00m(image_comparer, pbmc, test_id, func):#x1B[90m#x1B[39;49;00m
        save_and_compare_images = partial(image_comparer, ROOT, tol=#x1B[94m30#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        common = #x1B[96mdict#x1B[39;49;00m(threshold=#x1B[94m0.5#x1B[39;49;00m, max_edge_width=#x1B[94m1.0#x1B[39;49;00m, random_state=#x1B[94m0#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        func(pbmc, **common)#x1B[90m#x1B[39;49;00m
>       save_and_compare_images(#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mpaga_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mtest_id#x1B[33m}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[94mif#x1B[39;49;00m test_id #x1B[94melse#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mpaga#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       AssertionError: Image files did not match.#x1B[0m
#x1B[1m#x1B[31mE       RMS Value:  40.872406680222774#x1B[0m
#x1B[1m#x1B[31mE       Expected:   file:.../_images/paga_continuous_multiple/expected.png#x1B[0m
#x1B[1m#x1B[31mE       Actual:     file:.../_images/paga_continuous_multiple/actual.png#x1B[0m
#x1B[1m#x1B[31mE       Difference: file:.../_images/paga_continuous_multiple/actual-failed-diff.png#x1B[0m
#x1B[1m#x1B[31mE       Tolerance:  30#x1B[0m

#x1B[1m#x1B[31mtests/test_paga.py#x1B[0m:60: AssertionError
tests/test_paga.py::test_paga_plots[continuous_obs-func2]

Flake rate in main: 100.00% (Passed 0 times, Failed 1 times)

Stack Traces | 0.074s run time
image_comparer = <function image_comparer.<locals>.save_and_compare at 0x7fb43e940fe0>
pbmc = AnnData object with n_obs × n_vars = 700 × 765
    obs: 'bulk_labels', 'n_genes', 'percent_mito', 'n_counts', 'S_score...roups', 'paga', 'bulk_labels_sizes'
    obsm: 'X_pca', 'X_umap'
    varm: 'PCs'
    obsp: 'distances', 'connectivities'
test_id = 'continuous_obs'
func = functools.partial(<function paga at 0x7fb489d42de0>, color='cool_feature')

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mtest_id#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mfunc#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, sc.pl.paga),#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33mcontinuous#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, partial(sc.pl.paga, color=#x1B[33m"#x1B[39;49;00m#x1B[33mCST3#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)),#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33mcontinuous_obs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, partial(sc.pl.paga, color=#x1B[33m"#x1B[39;49;00m#x1B[33mcool_feature#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)),#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33mcontinuous_multiple#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, partial(sc.pl.paga, color=[#x1B[33m"#x1B[39;49;00m#x1B[33mCST3#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mGATA2#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])),#x1B[90m#x1B[39;49;00m
            (#x1B[33m"#x1B[39;49;00m#x1B[33mcompare#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, partial(sc.pl.paga_compare, legend_fontoutline=#x1B[94m2#x1B[39;49;00m)),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mcompare_continuous#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                partial(sc.pl.paga_compare, color=#x1B[33m"#x1B[39;49;00m#x1B[33mCST3#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, legend_fontsize=#x1B[94m5#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
                marks=pytest.mark.xfail(reason=#x1B[33m"#x1B[39;49;00m#x1B[33mexpects .uns[#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mpaga#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m][#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mpos#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[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mcompare_pca#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                partial(sc.pl.paga_compare, basis=#x1B[33m"#x1B[39;49;00m#x1B[33mX_pca#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, legend_fontweight=#x1B[33m"#x1B[39;49;00m#x1B[33mnormal#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[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_paga_plots#x1B[39;49;00m(image_comparer, pbmc, test_id, func):#x1B[90m#x1B[39;49;00m
        save_and_compare_images = partial(image_comparer, ROOT, tol=#x1B[94m30#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        common = #x1B[96mdict#x1B[39;49;00m(threshold=#x1B[94m0.5#x1B[39;49;00m, max_edge_width=#x1B[94m1.0#x1B[39;49;00m, random_state=#x1B[94m0#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        func(pbmc, **common)#x1B[90m#x1B[39;49;00m
>       save_and_compare_images(#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mpaga_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mtest_id#x1B[33m}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[94mif#x1B[39;49;00m test_id #x1B[94melse#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mpaga#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       AssertionError: Image files did not match.#x1B[0m
#x1B[1m#x1B[31mE       RMS Value:  40.49617290527572#x1B[0m
#x1B[1m#x1B[31mE       Expected:   file:.../_images/paga_continuous_obs/expected.png#x1B[0m
#x1B[1m#x1B[31mE       Actual:     file:.../_images/paga_continuous_obs/actual.png#x1B[0m
#x1B[1m#x1B[31mE       Difference: file:.../_images/paga_continuous_obs/actual-failed-diff.png#x1B[0m
#x1B[1m#x1B[31mE       Tolerance:  30#x1B[0m

#x1B[1m#x1B[31mtests/test_paga.py#x1B[0m:60: AssertionError

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 added this to the 1.11.6 milestone Oct 31, 2025
@flying-sheep flying-sheep changed the title Fix dpt_groups_pseudotime fix: various DPT plot fixes Oct 31, 2025
Copy link
Contributor

@ilan-gold ilan-gold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we testing whatever could have triggered the need for islice(cycle(...? It seems like we could add a test for that, at least that things dont crash. No? I guess it's tied to X.shape but just want to be sure we are checking the overflow case i.e., X.shape forcing the cycle to be used

@flying-sheep
Copy link
Member Author

Whenever the number of subsets is larger than the palette, the old code would crash with an IndexError. (Using zip without strict=True would cause the iteration to end after the shortest iterable runs out)

@flying-sheep
Copy link
Member Author

test failures are #3865

Copy link
Contributor

@ilan-gold ilan-gold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! Just wanted to be sure

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.

unexpected error in sc.pl.dpt_timeseries and dpt_groups_pseudotime

3 participants