Skip to content

Settings docs overhaul - #3672

Merged
flying-sheep merged 30 commits into
mainfrom
pa/settings-overhaul
Jun 10, 2025
Merged

Settings docs overhaul#3672
flying-sheep merged 30 commits into
mainfrom
pa/settings-overhaul

Conversation

@flying-sheep

@flying-sheep flying-sheep commented Jun 6, 2025

Copy link
Copy Markdown
Member

Preparation PR for presets

Compare:

Old New
Settings Settings (click here to see a diff)
scanpy._settings.ScanpyConfig scanpy.settings
set_figure_params on both sc and sc.settings sc.settings.set_figure_params deprecated in favor of sc.set_figure_params
scanpy._settings.ScanpyConfig.verbosity scanpy.settings.verbosity and scanpy.Verbosity
scanpy.logging.print_versions deprecated scanpy.logging.print_versions deprecated and moved to “Deprecated Functions”

TODO

  • make inherited-members skipping work
  • extract into own PR

@flying-sheep
flying-sheep changed the base branch from pa/presets to main June 6, 2025 10:05
@flying-sheep flying-sheep added this to the 1.11.3 milestone Jun 6, 2025
@flying-sheep
flying-sheep requested a review from ilan-gold June 6, 2025 10:08
@flying-sheep flying-sheep changed the title Settings overhaul Settings docs overhaul Jun 6, 2025
@codecov

codecov Bot commented Jun 6, 2025

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2119 1 2118 105
View the top 1 failed test(s) by shortest run time
tests/test_highly_variable_genes.py::test_compare_to_upstream[dask_array_sparse-seurat-fgd]
Stack Traces | 0.066s run time
#x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mfunc#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mhvg#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mfgd#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mflavor#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mparams#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mref_path#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
                #x1B[33m"#x1B[39;49;00m#x1B[33mseurat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[96mdict#x1B[39;49;00m(min_mean=#x1B[94m0.0125#x1B[39;49;00m, max_mean=#x1B[94m3#x1B[39;49;00m, min_disp=#x1B[94m0.5#x1B[39;49;00m), FILE, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mseurat#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
                #x1B[33m"#x1B[39;49;00m#x1B[33mcell_ranger#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[96mdict#x1B[39;49;00m(n_top_genes=#x1B[94m100#x1B[39;49;00m), FILE_CELL_RANGER, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mcell_ranger#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[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33marray_type#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, ARRAY_TYPES)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_compare_to_upstream#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        *,#x1B[90m#x1B[39;49;00m
        request: pytest.FixtureRequest,#x1B[90m#x1B[39;49;00m
        func: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mhvg#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mfgd#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        flavor: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mseurat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcell_ranger#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        params: #x1B[96mdict#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, #x1B[96mfloat#x1B[39;49;00m | #x1B[96mint#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        ref_path: Path,#x1B[90m#x1B[39;49;00m
        array_type: Callable,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m func == #x1B[33m"#x1B[39;49;00m#x1B[33mfgd#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m flavor == #x1B[33m"#x1B[39;49;00m#x1B[33mcell_ranger#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            reason = #x1B[33m"#x1B[39;49;00m#x1B[33mThe deprecated filter_genes_dispersion behaves differently with cell_ranger#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            request.applymarker(pytest.mark.xfail(reason=reason))#x1B[90m#x1B[39;49;00m
        hvg_info = pd.read_csv(ref_path)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        pbmc = pbmc68k_reduced()#x1B[90m#x1B[39;49;00m
        pbmc.X = pbmc.raw.X#x1B[90m#x1B[39;49;00m
        pbmc.X = array_type(pbmc.X)#x1B[90m#x1B[39;49;00m
        pbmc.var_names_make_unique()#x1B[90m#x1B[39;49;00m
        sc.pp.filter_cells(pbmc, min_counts=#x1B[94m1#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        sc.pp.normalize_total(pbmc, target_sum=#x1B[94m1e4#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m func == #x1B[33m"#x1B[39;49;00m#x1B[33mhvg#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            sc.pp.log1p(pbmc)#x1B[90m#x1B[39;49;00m
            sc.pp.highly_variable_genes(pbmc, flavor=flavor, **params, inplace=#x1B[94mTrue#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m func == #x1B[33m"#x1B[39;49;00m#x1B[33mfgd#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            sc.pp.filter_genes_dispersion(#x1B[90m#x1B[39;49;00m
                pbmc, flavor=flavor, **params, log=#x1B[94mTrue#x1B[39;49;00m, subset=#x1B[94mFalse#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            )#x1B[90m#x1B[39;49;00m
        #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mAssertionError#x1B[39;49;00m()#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        np.testing.assert_array_equal(#x1B[90m#x1B[39;49;00m
            hvg_info[#x1B[33m"#x1B[39;49;00m#x1B[33mhighly_variable#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m], pbmc.var[#x1B[33m"#x1B[39;49;00m#x1B[33mhighly_variable#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# (still) Not equal to tolerance rtol=2e-05, atol=2e-05#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# np.testing.assert_allclose(4, 3.9999, rtol=2e-05, atol=2e-05)#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       np.testing.assert_allclose(#x1B[90m#x1B[39;49;00m
            hvg_info[#x1B[33m"#x1B[39;49;00m#x1B[33mmeans#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
            pbmc.var[#x1B[33m"#x1B[39;49;00m#x1B[33mmeans#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
            rtol=#x1B[94m2e-05#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            atol=#x1B[94m2e-05#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       AssertionError: #x1B[0m
#x1B[1m#x1B[31mE       Not equal to tolerance rtol=2e-05, atol=2e-05#x1B[0m
#x1B[1m#x1B[31mE       #x1B[0m
#x1B[1m#x1B[31mE       Mismatched elements: 100 / 765 (13.1%)#x1B[0m
#x1B[1m#x1B[31mE       Max absolute difference among violations: 0.01983668#x1B[0m
#x1B[1m#x1B[31mE       Max relative difference among violations: 0.01231257#x1B[0m
#x1B[1m#x1B[31mE        ACTUAL: array([1.88077 , 0.862207, 2.789555, 3.51563 , 0.779662, 2.495507,#x1B[0m
#x1B[1m#x1B[31mE              2.051983, 2.200089, 2.121406, 2.272991, 2.340023, 2.030907,#x1B[0m
#x1B[1m#x1B[31mE              2.267801, 1.565244, 2.465999, 0.676449, 2.246484, 3.938324,...#x1B[0m
#x1B[1m#x1B[31mE        DESIRED: array([1.88077 , 0.862207, 2.789555, 3.515629, 0.779662, 2.495507,#x1B[0m
#x1B[1m#x1B[31mE              2.051983, 2.200089, 2.121406, 2.272991, 2.340023, 2.030907,#x1B[0m
#x1B[1m#x1B[31mE              2.267801, 1.565244, 2.465999, 0.676449, 2.246485, 3.938324,...#x1B[0m

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

Comment thread docs/extensions/autosummary_skip_inherited.py
Comment thread src/scanpy/_singleton.py Outdated
Comment thread src/scanpy/_singleton.py Outdated
@flying-sheep
flying-sheep requested a review from ilan-gold June 10, 2025 09:31
Comment thread docs/extensions/autosummary_skip_inherited.py Outdated
Comment thread docs/extensions/autosummary_skip_inherited.py
Co-authored-by: Ilan Gold <ilanbassgold@gmail.com>

@ilan-gold ilan-gold left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a suggestion

Comment thread docs/extensions/autosummary_skip_inherited.py
flying-sheep and others added 2 commits June 10, 2025 13:32
Co-authored-by: Ilan Gold <ilanbassgold@gmail.com>
@flying-sheep
flying-sheep enabled auto-merge (squash) June 10, 2025 12:08
@flying-sheep
flying-sheep disabled auto-merge June 10, 2025 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants