Skip to content

Commit

Permalink
Update rapids 24 04 (#166)
Browse files Browse the repository at this point in the history
* removes notebooks from docs

* adds notebooks

* adds the folder

* updates notebooks

* adds the submodule to rtd

* adds links

* adds release note

* update pandas dep

* update ligrec for pandas

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* updates installers

* added date

* unpin pandas

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Intron7 and pre-commit-ci[bot] authored Apr 15, 2024
1 parent f2dce86 commit 2e8d6b5
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The easiest way to install *rapids-singlecell* is to use one of the *yaml* file
```
conda env create -f conda/rsc_rapids_24.02.yml
# or
mamba env create -f conda/rsc_rapids_23.12.yml
mamba env create -f conda/rsc_rapids_24.04.yml
```
### PyPI
```
Expand Down
2 changes: 1 addition & 1 deletion conda/rsc_rapids_23.12.yml → conda/rsc_rapids_24.04.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
- conda-forge
- bioconda
dependencies:
- rapids=23.12
- rapids=24.04
- 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_24.02.yml
# or
mamba env create -f conda/rsc_rapids_23.12.yml
mamba env create -f conda/rsc_rapids_24.04.yml
```
## PyPI
As of version 0.4.0 *rapids-singlecell* is now on PyPI.
Expand Down
7 changes: 6 additions & 1 deletion docs/release-notes/0.10.2.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
### 0.10.2 {small}`the future`
### 0.10.2 {small}`2024-04-15`

```{rubric} Features
```
* adds the option to return the results for `get.aggregate` as sparse matrices if the input is sparse {pr}`160` {smaller}`S Dicks`
* adds support for `rapids-24.04` {pr}`166` {smaller}`S Dicks`


```{rubric} Performance
Expand All @@ -12,7 +13,11 @@

```{rubric} Bug fixes
```
* fixes small bugs with pandas in `ligrec` {pr}`166` {smaller}`S Dicks`


```{rubric} Misc
```
* moves the notebooks from docs into a submodule {pr}`164` {smaller}`S Dicks`
* moves tests to rapids-24.04 {pr}`166` {smaller}`S Dicks`
* unpinned pandas version {pr}`166` {smaller}`S Dicks`
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies = [
"numpy>=1.17.0",
"decoupler>=1.3.2",
"scipy>=1.4",
"pandas<2.0.0",
"pandas",
"natsort",
"scikit-misc>=0.1.3",
"matplotlib>=3.4",
Expand All @@ -26,8 +26,8 @@ dependencies = [
]

[project.optional-dependencies]
rapids11 = ["cudf-cu11==24.2.*", "cuml-cu11==24.2.*", "cugraph-cu11==24.2.*"]
rapids12 = ["cudf-cu12==24.2.*", "cuml-cu12==24.2.*", "cugraph-cu12==24.2.*"]
rapids11 = ["cudf-cu11==24.4.*", "cuml-cu11==24.4.*", "cugraph-cu11==24.4.*"]
rapids12 = ["cudf-cu12==24.4.*", "cuml-cu12==24.4.*", "cugraph-cu12==24.4.*"]
doc = [
"sphinx>=4.5.0",
"sphinx-copybutton",
Expand Down
8 changes: 7 additions & 1 deletion src/rapids_singlecell/squidpy_gpu/_ligrec.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,13 @@ def find_min_gene_in_complex(_complex: str | None) -> str | None:
return complexes[0]

df = data[complexes].mean()
return str(df.index[df.argmin()])
try:
return str(df.index[df.argmin()])
except ValueError as e:
if "attempt to get argmin of an empty sequence" in str(e):
return str(df.index[0])
else:
raise ValueError(e)

if complex_policy == "min":
interactions[SOURCE] = interactions[SOURCE].apply(find_min_gene_in_complex)
Expand Down
Binary file modified tests/_data/paul15_means.pickle
Binary file not shown.
16 changes: 1 addition & 15 deletions tests/test_ligrec.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ def paul15() -> AnnData:

@pytest.fixture()
def paul15_means() -> pd.DataFrame:
file = Path(__file__).parent / Path("_data/paul15_means.pickle")
with open(file, "rb") as fin:
with open("tests/_data/paul15_means.pickle", "rb") as fin:
return pickle.load(fin)


Expand Down Expand Up @@ -185,19 +184,6 @@ def test_fdr_axis_works(self, adata: AnnData, interactions: Interactions_t):

assert not np.allclose(rc["pvalues"].values[mask], ri["pvalues"].values[mask])

"""
def test_inplace_default_key(self, adata: AnnData, interactions: Interactions_t):
res = ligrec(adata, _CK, interactions=interactions, n_perms=5, copy=False)
assert res is None
assert isinstance(adata.uns[key], dict)
r = adata.uns[key]
assert len(r) == 3
assert isinstance(r["means"], pd.DataFrame)
assert isinstance(r["pvalues"], pd.DataFrame)
assert isinstance(r["metadata"], pd.DataFrame)
"""

def test_inplace_key_added(self, adata: AnnData, interactions: Interactions_t):
assert "foobar" not in adata.uns
res = ligrec(
Expand Down

0 comments on commit 2e8d6b5

Please sign in to comment.