Skip to content

Commit c819046

Browse files
selmanozleyenpre-commit-ci[bot]Intron7
authored
Add pertpy's E-Distance (#454)
* init working version with pytest. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * naive implementation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * error from merge * integrate more tests * save state with temporary scripts. now there is a reference code to improve * vibe codded version + the version I simplied. it works roughly * changes * simplify kernels and create a separate file * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * move to float64 for precision. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * bootstrapping * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * swich to f32 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * refactor * push working state * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add documentation and write a comparison script * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * speed up kernel * update * update to faster implementation * update kernel and tests * add docs and fix test with smaller fucntions * fix shared memory size issues * avoid register pressure on old hardware * add skipped test * update docstring * update docs * finish docs * update the page --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Severin Dicks <37635888+Intron7@users.noreply.github.com> Co-authored-by: Intron7 <severin.dicks@icloud.com>
1 parent 3a436bd commit c819046

16 files changed

Lines changed: 3129 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ __pycache__/
4242
.vscode/
4343
.cursor/
4444
.claude/
45-
Claude.md
45+
CLAUDE.md
4646

4747
# tmp_scripts
4848
tmp_scripts/

docs/_templates/autosummary/class.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Attributes table
1313

1414
.. autosummary::
1515
{% for item in attributes %}
16-
~{{ fullname }}.{{ item }}
16+
~{{ objname }}.{{ item }}
1717
{%- endfor %}
1818
{% endif %}
1919
{% endblock %}
@@ -26,7 +26,7 @@ Methods table
2626
.. autosummary::
2727
{% for item in methods %}
2828
{%- if item != '__init__' %}
29-
~{{ fullname }}.{{ item }}
29+
~{{ objname }}.{{ item }}
3030
{%- endif -%}
3131
{%- endfor %}
3232
{% endif %}

docs/api/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import rapids_singlecell as rsc
1212
1313
scanpy_gpu
1414
squidpy_gpu
15+
pertpy_gpu
1516
decoupler_gpu
1617
get
1718
```

docs/api/pertpy_gpu.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# pertpy-GPU: `ptg`
2+
3+
[pertpy](https://pertpy.readthedocs.io) contains tools for perturbation analysis. {mod}`rapids_singlecell.ptg` accelerates some of these methods.
4+
5+
```{eval-rst}
6+
.. module:: rapids_singlecell.ptg
7+
.. currentmodule:: rapids_singlecell.ptg
8+
```
9+
10+
## Distance
11+
12+
```{eval-rst}
13+
.. autosummary::
14+
:toctree: generated
15+
16+
Distance
17+
```
18+
19+
```{eval-rst}
20+
.. autoclass:: Distance
21+
:no-index:
22+
23+
.. rubric:: Methods
24+
25+
.. autosummary::
26+
27+
~Distance.pairwise
28+
~Distance.onesided_distances
29+
~Distance.bootstrap
30+
31+
.. automethod:: __call__
32+
:no-index:
33+
.. automethod:: pairwise
34+
:no-index:
35+
.. automethod:: onesided_distances
36+
:no-index:
37+
.. automethod:: bootstrap
38+
:no-index:
39+
```

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from pathlib import Path, PurePosixPath
99
from typing import TYPE_CHECKING
1010
import anndata # noqa
11+
import fast_array_utils # noqa
1112

1213
if TYPE_CHECKING:
1314
from sphinx.application import Sphinx
@@ -119,6 +120,7 @@
119120
"pymde": ("https://pymde.org", None),
120121
"scanpy": ("https://scanpy.readthedocs.io/en/stable/", None),
121122
"squidpy": ("https://squidpy.readthedocs.io/en/stable/", None),
123+
"pertpy": ("https://pertpy.readthedocs.io/en/stable/", None),
122124
"seaborn": ("https://seaborn.pydata.org/", None),
123125
"decoupler": ("https://decoupler.readthedocs.io/en/latest/", None),
124126
"rmm": ("https://docs.rapids.ai/api/rmm/stable/", None),
@@ -172,6 +174,7 @@
172174
("py:class", "scipy.sparse.base.spmatrix"),
173175
("py:meth", "pandas.DataFrame.iloc"),
174176
("py:meth", "pandas.DataFrame.loc"),
177+
("py:class", "pandas.core.series.Series"),
175178
("py:class", "anndata._core.views.ArrayView"),
176179
("py:class", "anndata._core.raw.Raw"),
177180
("py:class", "scanpy._utils.Empty"),

docs/release-notes/0.13.6.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### 0.13.6 {small}`the-future`
2+
3+
```{rubric} Features
4+
```
5+
* Adds `ptg.Distance` for GPU-accelerated distance computation between groups of cells, compatible with pertpy's Distance API {pr}`454` {smaller}`S Dicks & S Özleyen`

docs/release-notes/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Release notes
44

55
## Version 0.13.0
6+
```{include} /release-notes/0.13.6.md
7+
```
68
```{include} /release-notes/0.13.5.md
79
```
810
```{include} /release-notes/0.13.4.md

src/rapids_singlecell/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import cuml.internals.logger as logger
44

5-
from . import dcg, get, gr, pp, tl
5+
from . import dcg, get, gr, pp, ptg, tl
66
from ._version import __version__
77

88
logger.set_level(2)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from __future__ import annotations
2+
3+
from ._distance import Distance, MeanVar

0 commit comments

Comments
 (0)