Skip to content

Conversation

@patcon
Copy link

@patcon patcon commented Dec 15, 2025

I'm orienting in this tool, and couldn't make sense of this. Then I realized it's not even a column that's created when the command is run. I think it's a copy-paste issue from the observation-level doc section.

Fwiw, n_cells is the only column not mentions, and so perhaps this was supposed to be that? Not sure, so I'll leave that part to someone else.

Thanks! Sorry if I'm doing this wrong -- it's my first PR, and nothing in the template seemed relevant to a docs typo fix 🙏

@codecov
Copy link

codecov bot commented Dec 15, 2025

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
2336 2 2334 348
View the top 2 failed test(s) by shortest run time
tests/test_rank_genes_groups.py::test_wilcoxon_tie_correction[True]
Stack Traces | 0.061s run time
reference = True

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mreference#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[94mTrue#x1B[39;49;00m, #x1B[94mFalse#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_wilcoxon_tie_correction#x1B[39;49;00m(reference):#x1B[90m#x1B[39;49;00m
        pbmc = pbmc68k_reduced()#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        groups = [#x1B[33m"#x1B[39;49;00m#x1B[33mCD14+ Monocyte#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mDendritic#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        groupby = #x1B[33m"#x1B[39;49;00m#x1B[33mbulk_labels#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _, groups_masks = select_groups(pbmc, groups, groupby)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        x = pbmc.raw.X[groups_masks[#x1B[94m0#x1B[39;49;00m]].toarray()#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        mask_rest = groups_masks[#x1B[94m1#x1B[39;49;00m] #x1B[94mif#x1B[39;49;00m reference #x1B[94melse#x1B[39;49;00m ~groups_masks[#x1B[94m0#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        y = pbmc.raw.X[mask_rest].toarray()#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        pvals = mannwhitneyu(x, y, use_continuity=#x1B[94mFalse#x1B[39;49;00m, alternative=#x1B[33m"#x1B[39;49;00m#x1B[33mtwo-sided#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m).pvalue#x1B[90m#x1B[39;49;00m
        pvals[np.isnan(pvals)] = #x1B[94m1.0#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m reference:#x1B[90m#x1B[39;49;00m
            ref = groups[#x1B[94m1#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            ref = #x1B[33m"#x1B[39;49;00m#x1B[33mrest#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            groups = groups[:#x1B[94m1#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        test_obj = _RankGenes(pbmc, groups, groupby, reference=ref)#x1B[90m#x1B[39;49;00m
        #x1B[94mwith#x1B[39;49;00m (#x1B[90m#x1B[39;49;00m
            pytest.warns(#x1B[96mRuntimeWarning#x1B[39;49;00m, match=#x1B[33mr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33minvalid value encountered#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m reference#x1B[90m#x1B[39;49;00m
            #x1B[94melse#x1B[39;49;00m nullcontext()#x1B[90m#x1B[39;49;00m
        ):#x1B[90m#x1B[39;49;00m
            test_obj.compute_statistics(#x1B[33m"#x1B[39;49;00m#x1B[33mwilcoxon#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, tie_correct=#x1B[94mTrue#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       np.testing.assert_allclose(test_obj.stats[groups[#x1B[94m0#x1B[39;49;00m]][#x1B[33m"#x1B[39;49;00m#x1B[33mpvals#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m], pvals)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       AssertionError: #x1B[0m
#x1B[1m#x1B[31mE       Not equal to tolerance rtol=1e-07, atol=0#x1B[0m
#x1B[1m#x1B[31mE       #x1B[0m
#x1B[1m#x1B[31mE       Mismatched elements: 383 / 765 (50.1%)#x1B[0m
#x1B[1m#x1B[31mE       Max absolute difference among violations: 2.47035744e-07#x1B[0m
#x1B[1m#x1B[31mE       Max relative difference among violations: 4.47902954e-05#x1B[0m
#x1B[1m#x1B[31mE        ACTUAL: array([2.029091e-18, 6.430380e-01, 6.164863e-01, 7.551346e-02,#x1B[0m
#x1B[1m#x1B[31mE              1.590458e-08, 1.884037e-03, 5.290635e-01, 1.314833e-05,#x1B[0m
#x1B[1m#x1B[31mE              5.756106e-08, 2.646892e-01, 2.670054e-02, 4.151307e-01,...#x1B[0m
#x1B[1m#x1B[31mE        DESIRED: array([2.029090e-18, 6.430379e-01, 6.164863e-01, 7.551347e-02,#x1B[0m
#x1B[1m#x1B[31mE              1.590460e-08, 1.884038e-03, 5.290635e-01, 1.314831e-05,#x1B[0m
#x1B[1m#x1B[31mE              5.756110e-08, 2.646892e-01, 2.670054e-02, 4.151307e-01,...#x1B[0m

#x1B[1m#x1B[31mtests/test_rank_genes_groups.py#x1B[0m:301: AssertionError
tests/test_rank_genes_groups.py::test_wilcoxon_tie_correction[False]
Stack Traces | 8.88s run time
reference = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mreference#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[94mTrue#x1B[39;49;00m, #x1B[94mFalse#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_wilcoxon_tie_correction#x1B[39;49;00m(reference):#x1B[90m#x1B[39;49;00m
        pbmc = pbmc68k_reduced()#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        groups = [#x1B[33m"#x1B[39;49;00m#x1B[33mCD14+ Monocyte#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mDendritic#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        groupby = #x1B[33m"#x1B[39;49;00m#x1B[33mbulk_labels#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _, groups_masks = select_groups(pbmc, groups, groupby)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        x = pbmc.raw.X[groups_masks[#x1B[94m0#x1B[39;49;00m]].toarray()#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        mask_rest = groups_masks[#x1B[94m1#x1B[39;49;00m] #x1B[94mif#x1B[39;49;00m reference #x1B[94melse#x1B[39;49;00m ~groups_masks[#x1B[94m0#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        y = pbmc.raw.X[mask_rest].toarray()#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        pvals = mannwhitneyu(x, y, use_continuity=#x1B[94mFalse#x1B[39;49;00m, alternative=#x1B[33m"#x1B[39;49;00m#x1B[33mtwo-sided#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m).pvalue#x1B[90m#x1B[39;49;00m
        pvals[np.isnan(pvals)] = #x1B[94m1.0#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m reference:#x1B[90m#x1B[39;49;00m
            ref = groups[#x1B[94m1#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            ref = #x1B[33m"#x1B[39;49;00m#x1B[33mrest#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            groups = groups[:#x1B[94m1#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        test_obj = _RankGenes(pbmc, groups, groupby, reference=ref)#x1B[90m#x1B[39;49;00m
        #x1B[94mwith#x1B[39;49;00m (#x1B[90m#x1B[39;49;00m
            pytest.warns(#x1B[96mRuntimeWarning#x1B[39;49;00m, match=#x1B[33mr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33minvalid value encountered#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m reference#x1B[90m#x1B[39;49;00m
            #x1B[94melse#x1B[39;49;00m nullcontext()#x1B[90m#x1B[39;49;00m
        ):#x1B[90m#x1B[39;49;00m
            test_obj.compute_statistics(#x1B[33m"#x1B[39;49;00m#x1B[33mwilcoxon#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, tie_correct=#x1B[94mTrue#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       np.testing.assert_allclose(test_obj.stats[groups[#x1B[94m0#x1B[39;49;00m]][#x1B[33m"#x1B[39;49;00m#x1B[33mpvals#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m], pvals)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       AssertionError: #x1B[0m
#x1B[1m#x1B[31mE       Not equal to tolerance rtol=1e-07, atol=0#x1B[0m
#x1B[1m#x1B[31mE       #x1B[0m
#x1B[1m#x1B[31mE       Mismatched elements: 465 / 765 (60.8%)#x1B[0m
#x1B[1m#x1B[31mE       Max absolute difference among violations: 7.09363885e-07#x1B[0m
#x1B[1m#x1B[31mE       Max relative difference among violations: 0.43511157#x1B[0m
#x1B[1m#x1B[31mE        ACTUAL: array([4.747381e-47, 2.910919e-01, 9.350926e-01, 1.204920e-01,#x1B[0m
#x1B[1m#x1B[31mE              6.826701e-18, 4.262317e-04, 6.489862e-01, 3.630759e-11,#x1B[0m
#x1B[1m#x1B[31mE              3.053055e-17, 3.037204e-01, 2.432239e-01, 5.370464e-01,...#x1B[0m
#x1B[1m#x1B[31mE        DESIRED: array([0.000000e+00, 2.910920e-01, 9.350926e-01, 1.204920e-01,#x1B[0m
#x1B[1m#x1B[31mE              6.826711e-18, 4.262317e-04, 6.489862e-01, 3.630755e-11,#x1B[0m
#x1B[1m#x1B[31mE              3.053048e-17, 3.037204e-01, 2.432239e-01, 5.370464e-01,...#x1B[0m

#x1B[1m#x1B[31mtests/test_rank_genes_groups.py#x1B[0m:301: 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.

@patcon
Copy link
Author

patcon commented Dec 15, 2025

Sorry, I'm a little disoriented, and trying to figure this out. I have a feeling maybe I'm missing something, but on the off chance this has merit, I'll leave it to someone else to close :)

@patcon patcon changed the title Remove "n_genes_by_{expr_type}" from variable-level metrics. Remove "n_genes_by_{expr_type}" typo from variable-level metrics docs Dec 16, 2025
@patcon patcon changed the title Remove "n_genes_by_{expr_type}" typo from variable-level metrics docs Remove "n_genes_by_{expr_type}" typo from variable-level qc metrics docs Dec 16, 2025
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