Skip to content

Backport PR #4096 on branch 1.12.x (chore: use scverse-misc’s @deprecated)#4109

Open
flying-sheep wants to merge 5 commits into1.12.xfrom
auto-backport-of-pr-4096-on-1.12.x
Open

Backport PR #4096 on branch 1.12.x (chore: use scverse-misc’s @deprecated)#4109
flying-sheep wants to merge 5 commits into1.12.xfrom
auto-backport-of-pr-4096-on-1.12.x

Conversation

@flying-sheep
Copy link
Copy Markdown
Member

@flying-sheep flying-sheep commented May 7, 2026

Backport PR #4096

Blocked by scverse/scverse-misc#27

@flying-sheep flying-sheep enabled auto-merge (squash) May 7, 2026 16:10
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

❌ 5 Tests Failed:

Tests completed Failed Passed Skipped
1816 5 1811 935
View the top 3 failed test(s) by shortest run time
tests/test_preprocessing.py::test_normalize_per_cell
Stack Traces | 0.006s run time
#x1B[1m#x1B[31mE   Failed: DID NOT WARN. No warnings of type (<class 'FutureWarning'>,) matching the regex were emitted.#x1B[0m
#x1B[1m#x1B[31m     Regex: sc\.pp\.normalize_total#x1B[0m
#x1B[1m#x1B[31m     Emitted warnings: [ FutureWarning("The function normalize_per_cell is deprecated and will be removed in the future. Use :func:`~scanpy.pp.normalize_total` instead.\nThe new function is equivalent to the present\nfunction, except that\n\n* the new function doesn't filter cells based on `min_counts`,\n    use :func:`~scanpy.pp.filter_cells` if filtering is needed.\n* some arguments were renamed\n* `copy` is replaced by `inplace`"),#x1B[0m
#x1B[1m#x1B[31m      FutureWarning("The function normalize_per_cell is deprecated and will be removed in the future. Use :func:`~scanpy.pp.normalize_total` instead.\nThe new function is equivalent to the present\nfunction, except that\n\n* the new function doesn't filter cells based on `min_counts`,\n    use :func:`~scanpy.pp.filter_cells` if filtering is needed.\n* some arguments were renamed\n* `copy` is replaced by `inplace`")].#x1B[0m
All traceback entries are hidden. Pass `--full-trace` to see hidden and internal frames.

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

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_normalize_per_cell#x1B[39;49;00m() -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        x = np.array([[#x1B[94m1#x1B[39;49;00m, #x1B[94m0#x1B[39;49;00m], [#x1B[94m3#x1B[39;49;00m, #x1B[94m0#x1B[39;49;00m], [#x1B[94m5#x1B[39;49;00m, #x1B[94m6#x1B[39;49;00m]], dtype=np.float32)#x1B[90m#x1B[39;49;00m
        adata = AnnData(x.copy())#x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m pytest.warns(#x1B[96mFutureWarning#x1B[39;49;00m, match=#x1B[33mr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33msc#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m.pp#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m.normalize_total#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       FutureWarning: The function normalize_per_cell is deprecated and will be removed in the future. Use :func:`~scanpy.pp.normalize_total` instead.#x1B[0m
#x1B[1m#x1B[31mE       The new function is equivalent to the present#x1B[0m
#x1B[1m#x1B[31mE       function, except that#x1B[0m
#x1B[1m#x1B[31mE       #x1B[0m
#x1B[1m#x1B[31mE       * the new function doesn't filter cells based on `min_counts`,#x1B[0m
#x1B[1m#x1B[31mE           use :func:`~scanpy.pp.filter_cells` if filtering is needed.#x1B[0m
#x1B[1m#x1B[31mE       * some arguments were renamed#x1B[0m
#x1B[1m#x1B[31mE       * `copy` is replaced by `inplace`#x1B[0m

#x1B[1m#x1B[31mtests/test_preprocessing.py#x1B[0m:105: FutureWarning
src/scanpy/preprocessing/_simple.py::scanpy.preprocessing._simple.normalize_per_cell
Stack Traces | 0.007s run time
516 `adata.X` : :class:`numpy.ndarray` | :class:`scipy.sparse.csr_matrix` (dtype `float`)
517     Normalized count data matrix.
518 
519 Examples
520 --------
521 >>> import scanpy as sc
522 >>> adata = AnnData(np.array([[1, 0], [3, 0], [5, 6]], dtype=np.float32))
523 >>> print(adata.X.sum(axis=1))
524 [ 1.  3. 11.]
525 >>> sc.pp.normalize_per_cell(adata)
Expected:
    FutureWarning: Use `sc.pp.normalize_total` instead.
        sc.pp.normalize_per_cell(adata)
Got:
    FutureWarning: The function normalize_per_cell is deprecated and will be removed in the future. Use :func:`~scanpy.pp.normalize_total` instead.
    The new function is equivalent to the present
    function, except that
    <BLANKLINE>
    * the new function doesn't filter cells based on `min_counts`,
        use :func:`~scanpy.pp.filter_cells` if filtering is needed.
    * some arguments were renamed
    * `copy` is replaced by `inplace`
        sc.pp.normalize_per_cell(adata)
    FutureWarning: The function normalize_per_cell is deprecated and will be removed in the future. Use :func:`~scanpy.pp.normalize_total` instead.
    The new function is equivalent to the present
    function, except that
    <BLANKLINE>
    * the new function doesn't filter cells based on `min_counts`,
        use :func:`~scanpy.pp.filter_cells` if filtering is needed.
    * some arguments were renamed
    * `copy` is replaced by `inplace`
        normalize_per_cell(

#x1B[1m#x1B[.../scanpy/preprocessing/_simple.py#x1B[0m:525: DocTestFailure
tests/test_score_genes.py::test_add_score
Stack Traces | 0.01s run time
#x1B[1m#x1B[31mE   Failed: DID NOT WARN. No warnings of type (<class 'FutureWarning'>,) matching the regex were emitted.#x1B[0m
#x1B[1m#x1B[31m     Regex: sc\.pp\.normalize_total#x1B[0m
#x1B[1m#x1B[31m     Emitted warnings: [ FutureWarning("The function normalize_per_cell is deprecated and will be removed in the future. Use :func:`~scanpy.pp.normalize_total` instead.\nThe new function is equivalent to the present\nfunction, except that\n\n* the new function doesn't filter cells based on `min_counts`,\n    use :func:`~scanpy.pp.filter_cells` if filtering is needed.\n* some arguments were renamed\n* `copy` is replaced by `inplace`"),#x1B[0m
#x1B[1m#x1B[31m      FutureWarning("The function normalize_per_cell is deprecated and will be removed in the future. Use :func:`~scanpy.pp.normalize_total` instead.\nThe new function is equivalent to the present\nfunction, except that\n\n* the new function doesn't filter cells based on `min_counts`,\n    use :func:`~scanpy.pp.filter_cells` if filtering is needed.\n* some arguments were renamed\n* `copy` is replaced by `inplace`")].#x1B[0m
All traceback entries are hidden. Pass `--full-trace` to see hidden and internal frames.

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

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_add_score#x1B[39;49;00m():#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Check the dtype of the scores and that non-existing genes get ignored."""#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# TODO: write a test that costs less resources and is more meaningful#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        adata = _create_adata(#x1B[94m100#x1B[39;49;00m, #x1B[94m1000#x1B[39;49;00m, p_zero=#x1B[94m0#x1B[39;49;00m, p_nan=#x1B[94m0#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m pytest.warns(#x1B[96mFutureWarning#x1B[39;49;00m, match=#x1B[33mr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33msc#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m.pp#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m.normalize_total#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       FutureWarning: The function normalize_per_cell is deprecated and will be removed in the future. Use :func:`~scanpy.pp.normalize_total` instead.#x1B[0m
#x1B[1m#x1B[31mE       The new function is equivalent to the present#x1B[0m
#x1B[1m#x1B[31mE       function, except that#x1B[0m
#x1B[1m#x1B[31mE       #x1B[0m
#x1B[1m#x1B[31mE       * the new function doesn't filter cells based on `min_counts`,#x1B[0m
#x1B[1m#x1B[31mE           use :func:`~scanpy.pp.filter_cells` if filtering is needed.#x1B[0m
#x1B[1m#x1B[31mE       * some arguments were renamed#x1B[0m
#x1B[1m#x1B[31mE       * `copy` is replaced by `inplace`#x1B[0m

#x1B[1m#x1B[31mtests/test_score_genes.py#x1B[0m:82: FutureWarning
tests/test_score_genes.py::test_layer
Stack Traces | 0.014s run time
#x1B[1m#x1B[31mE   Failed: DID NOT WARN. No warnings of type (<class 'FutureWarning'>,) matching the regex were emitted.#x1B[0m
#x1B[1m#x1B[31m     Regex: sc\.pp\.normalize_total#x1B[0m
#x1B[1m#x1B[31m     Emitted warnings: [ FutureWarning("The function normalize_per_cell is deprecated and will be removed in the future. Use :func:`~scanpy.pp.normalize_total` instead.\nThe new function is equivalent to the present\nfunction, except that\n\n* the new function doesn't filter cells based on `min_counts`,\n    use :func:`~scanpy.pp.filter_cells` if filtering is needed.\n* some arguments were renamed\n* `copy` is replaced by `inplace`"),#x1B[0m
#x1B[1m#x1B[31m      FutureWarning("The function normalize_per_cell is deprecated and will be removed in the future. Use :func:`~scanpy.pp.normalize_total` instead.\nThe new function is equivalent to the present\nfunction, except that\n\n* the new function doesn't filter cells based on `min_counts`,\n    use :func:`~scanpy.pp.filter_cells` if filtering is needed.\n* some arguments were renamed\n* `copy` is replaced by `inplace`")].#x1B[0m
All traceback entries are hidden. Pass `--full-trace` to see hidden and internal frames.

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

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_layer#x1B[39;49;00m():#x1B[90m#x1B[39;49;00m
        adata = _create_adata(#x1B[94m100#x1B[39;49;00m, #x1B[94m1000#x1B[39;49;00m, p_zero=#x1B[94m0#x1B[39;49;00m, p_nan=#x1B[94m0#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m pytest.warns(#x1B[96mFutureWarning#x1B[39;49;00m, match=#x1B[33mr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33msc#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m.pp#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m.normalize_total#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       FutureWarning: The function normalize_per_cell is deprecated and will be removed in the future. Use :func:`~scanpy.pp.normalize_total` instead.#x1B[0m
#x1B[1m#x1B[31mE       The new function is equivalent to the present#x1B[0m
#x1B[1m#x1B[31mE       function, except that#x1B[0m
#x1B[1m#x1B[31mE       #x1B[0m
#x1B[1m#x1B[31mE       * the new function doesn't filter cells based on `min_counts`,#x1B[0m
#x1B[1m#x1B[31mE           use :func:`~scanpy.pp.filter_cells` if filtering is needed.#x1B[0m
#x1B[1m#x1B[31mE       * some arguments were renamed#x1B[0m
#x1B[1m#x1B[31mE       * `copy` is replaced by `inplace`#x1B[0m

#x1B[1m#x1B[31mtests/test_score_genes.py#x1B[0m:236: FutureWarning
tests/test_score_genes.py::test_score_with_reference
Stack Traces | 0.444s run time
#x1B[1m#x1B[31mE   Failed: DID NOT WARN. No warnings of type (<class 'FutureWarning'>,) matching the regex were emitted.#x1B[0m
#x1B[1m#x1B[31m     Regex: sc\.pp\.normalize_total#x1B[0m
#x1B[1m#x1B[31m     Emitted warnings: [ FutureWarning("The function normalize_per_cell is deprecated and will be removed in the future. Use :func:`~scanpy.pp.normalize_total` instead.\nThe new function is equivalent to the present\nfunction, except that\n\n* the new function doesn't filter cells based on `min_counts`,\n    use :func:`~scanpy.pp.filter_cells` if filtering is needed.\n* some arguments were renamed\n* `copy` is replaced by `inplace`"),#x1B[0m
#x1B[1m#x1B[31m      FutureWarning("The function normalize_per_cell is deprecated and will be removed in the future. Use :func:`~scanpy.pp.normalize_total` instead.\nThe new function is equivalent to the present\nfunction, except that\n\n* the new function doesn't filter cells based on `min_counts`,\n    use :func:`~scanpy.pp.filter_cells` if filtering is needed.\n* some arguments were renamed\n* `copy` is replaced by `inplace`")].#x1B[0m
All traceback entries are hidden. Pass `--full-trace` to see hidden and internal frames.

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

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_score_with_reference#x1B[39;49;00m():#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Checks if score_genes output agrees with pre-computed reference values.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    The reference values had been generated using the same code#x1B[39;49;00m
    #x1B[33m    and stored as a pickle object in `./data`.#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        adata = paul15()#x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m pytest.warns(#x1B[96mFutureWarning#x1B[39;49;00m, match=#x1B[33mr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33msc#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m.pp#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m.normalize_total#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       FutureWarning: The function normalize_per_cell is deprecated and will be removed in the future. Use :func:`~scanpy.pp.normalize_total` instead.#x1B[0m
#x1B[1m#x1B[31mE       The new function is equivalent to the present#x1B[0m
#x1B[1m#x1B[31mE       function, except that#x1B[0m
#x1B[1m#x1B[31mE       #x1B[0m
#x1B[1m#x1B[31mE       * the new function doesn't filter cells based on `min_counts`,#x1B[0m
#x1B[1m#x1B[31mE           use :func:`~scanpy.pp.filter_cells` if filtering is needed.#x1B[0m
#x1B[1m#x1B[31mE       * some arguments were renamed#x1B[0m
#x1B[1m#x1B[31mE       * `copy` is replaced by `inplace`#x1B[0m

#x1B[1m#x1B[31mtests/test_score_genes.py#x1B[0m:66: FutureWarning

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

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