Skip to content

Commit

Permalink
adds backwards compatibilty for louvain (#114)
Browse files Browse the repository at this point in the history
* adds backwards compatibilty for louvain

* adds release notes

* add installer

* update notebooks

* updates notebooks

* updates release notes
  • Loading branch information
Intron7 committed Jan 3, 2024
1 parent cc04c58 commit 6460b7c
Show file tree
Hide file tree
Showing 14 changed files with 791 additions and 845 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The easiest way to install *rapids-singlecell* is to use one of the *yaml* file
```
conda env create -f conda/rsc_rapids_23.04.yml
# or
mamba env create -f conda/rsc_rapids_23.10.yml
mamba env create -f conda/rsc_rapids_23.12.yml
```
### PyPI
```
Expand Down
2 changes: 1 addition & 1 deletion conda/rsc_rapids_23.10.yml → conda/rsc_rapids_23.12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
- conda-forge
- bioconda
dependencies:
- rapids=23.10
- rapids=23.12
- python=3.10
- cuda-version=11.8
- cudnn
Expand Down
2 changes: 1 addition & 1 deletion docs/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The easiest way to install *rapids-singlecell* is to use one of the *yaml* file
```
conda env create -f conda/rsc_rapids_23.04.yml
# or
mamba env create -f conda/rsc_rapids_23.10.yml
mamba env create -f conda/rsc_rapids_23.12.yml
```
## PyPI
As of version 0.4.0 *rapids-singlecell* is now on PyPI.
Expand Down
182 changes: 88 additions & 94 deletions docs/notebooks/demo_gpu-PR.ipynb

Large diffs are not rendered by default.

165 changes: 79 additions & 86 deletions docs/notebooks/demo_gpu-seuratv3-brain-1M.ipynb
100755 → 100644

Large diffs are not rendered by default.

206 changes: 100 additions & 106 deletions docs/notebooks/demo_gpu-seuratv3.ipynb

Large diffs are not rendered by default.

186 changes: 89 additions & 97 deletions docs/notebooks/demo_gpu.ipynb

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions docs/release-notes/0.9.5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### 0.9.5

```{rubric} Bug fixes
```
* {func}`~rapids_singlecell.tl.louvain` now has backward compatibility with older rapids versions {pr}`114` {smaller}`S Dicks`

```{rubric} Misc
```
* Updates Conda yaml file to work with rapids-23.12 {pr}`114` {smaller}`S Dicks`
3 changes: 3 additions & 0 deletions docs/release-notes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# Release notes

## Version 0.9.0
```{include} /release-notes/0.9.5.md
``````

```{include} /release-notes/0.9.4.md
``````

Expand Down
182 changes: 88 additions & 94 deletions notebooks/demo_gpu-PR.ipynb

Large diffs are not rendered by default.

152 changes: 73 additions & 79 deletions notebooks/demo_gpu-seuratv3-brain.ipynb

Large diffs are not rendered by default.

339 changes: 156 additions & 183 deletions notebooks/demo_gpu-seuratv3.ipynb

Large diffs are not rendered by default.

185 changes: 88 additions & 97 deletions notebooks/demo_gpu.ipynb

Large diffs are not rendered by default.

21 changes: 15 additions & 6 deletions src/rapids_singlecell/tools/_clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pandas as pd
from anndata import AnnData
from natsort import natsorted
from packaging import version
from scanpy.tools._utils import _choose_graph
from scanpy.tools._utils_clustering import rename_groups, restrict_adjacency
from scipy import sparse
Expand Down Expand Up @@ -221,6 +222,7 @@ def louvain(
"""
# Adjacency graph
from cugraph import Graph
from cugraph import __version__ as cuv
from cugraph import louvain as culouvain

adata = adata.copy() if copy else adata
Expand All @@ -247,12 +249,19 @@ def louvain(
g.from_cudf_adjlist(offsets, indices, weights)

# Cluster
louvain_parts, _ = culouvain(
g,
resolution=resolution,
max_level=n_iterations,
threshold=threshold,
)
if version.parse(cuv) >= version.parse("23.08.00"):
louvain_parts, _ = culouvain(
g,
resolution=resolution,
max_level=n_iterations,
threshold=threshold,
)
else:
louvain_parts, _ = culouvain(
g,
resolution=resolution,
max_iter=n_iterations,
)

# Format output
groups = (
Expand Down

0 comments on commit 6460b7c

Please sign in to comment.