Skip to content

Commit ce93fda

Browse files
authored
key_added to uns for clustering (#378)
* add key added to uns * add release note
1 parent 80030af commit ce93fda

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

docs/release-notes/0.12.7.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
```{rubric} Bug fixes
1010
```
11+
* `key_added` will now be used as the key for `.uns` for `tl.leiden` and `tl.louvain` {pr}`378` {smaller}`S Dicks`
12+
1113

1214
```{rubric} Misc
1315
```

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.12.0
6+
```{include} /release-notes/0.12.7.md
7+
```
68
```{include} /release-notes/0.12.6.md
79
```
810
```{include} /release-notes/0.12.5.md

src/rapids_singlecell/tools/_clustering.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ def leiden(
181181
categories=natsorted(map(str, np.unique(groups))),
182182
)
183183
# store information on the clustering parameters
184-
adata.uns["leiden"] = {}
185-
adata.uns["leiden"]["params"] = {
184+
adata.uns[key_added] = {}
185+
adata.uns[key_added]["params"] = {
186186
"resolution": resolution,
187187
"random_state": random_state,
188188
"n_iterations": n_iterations,
@@ -319,8 +319,8 @@ def louvain(
319319
values=groups.astype("U"),
320320
categories=natsorted(map(str, np.unique(groups))),
321321
)
322-
adata.uns["louvain"] = {}
323-
adata.uns["louvain"]["params"] = {
322+
adata.uns[key_added] = {}
323+
adata.uns[key_added]["params"] = {
324324
"resolution": resolution,
325325
"n_iterations": n_iterations,
326326
"threshold": threshold,

0 commit comments

Comments
 (0)