Skip to content

Commit

Permalink
Backport PR #2832: Fix for _validate_palette for old numpy versions, …
Browse files Browse the repository at this point in the history
…prepare 1.9.8 hotfix release (#2833)
  • Loading branch information
flying-sheep authored Jan 26, 2024
1 parent 07c6e90 commit 6da39f1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/release-notes/1.9.8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### 1.9.8 {small}`2024-01-26`

```{rubric} Bug fixes
```
- Fix handling of numpy array palettes for old numpy versions {pr}`2832` {smaller}`P Angerer`
3 changes: 3 additions & 0 deletions docs/release-notes/release-latest.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Version 1.9

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

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

Expand Down
4 changes: 2 additions & 2 deletions scanpy/plotting/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ def _validate_palette(adata: anndata.AnnData, key: str) -> None:
_palette = None
break
_palette.append(color)
# Don't modify if nothing changed
if _palette is None or np.equal(_palette, adata.uns[color_key]).all():
# Dont modify if nothing changed
if _palette is None or np.array_equal(_palette, adata.uns[color_key]):
return
adata.uns[color_key] = _palette

Expand Down

0 comments on commit 6da39f1

Please sign in to comment.