Skip to content

Commit

Permalink
Fix for _validate_palette for old numpy versions, prepare 1.9.8 hotfi…
Browse files Browse the repository at this point in the history
…x release (#2832)
  • Loading branch information
flying-sheep committed Jan 26, 2024
1 parent bf5f27a commit 72780fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/release-notes/1.9.8.md
@@ -1,4 +1,5 @@
### 1.9.8 {small}`the future`
### 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`
4 changes: 2 additions & 2 deletions scanpy/plotting/_utils.py
Expand Up @@ -380,8 +380,8 @@ def _validate_palette(adata: 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 72780fc

Please sign in to comment.