Skip to content

Commit 8ed8463

Browse files
committed
Merge branch 'main' into bugfix/issue294-keyerror-not-raised-when-element-is-not-present-for-labels-points-and-shapes
2 parents 3ce04a2 + 91e5726 commit 8ed8463

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ and this project adheres to [Semantic Versioning][].
1212

1313
### Added
1414

15-
-
16-
1715
### Changed
1816

1917
-
2018

2119
### Fixed
2220

21+
- Took RNG out of categorical label test (#306)
22+
- Performance bug when plotting shapes (#298)
23+
- scale parameter was ignored for single-scale images (#301)
24+
- Changes to support for dask-expr (#283)
2325
- Added error handling for non-existent elements (#305)
2426

2527
## [0.2.3] - 2024-07-03

tests/pl/test_render_labels.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,14 @@ def test_plot_label_categorical_color(self, sdata_blobs: SpatialData, label: str
111111
self._make_tablemodel_with_categorical_labels(sdata_blobs, label)
112112

113113
def _make_tablemodel_with_categorical_labels(self, sdata_blobs, label):
114+
114115
n_obs = max(get_element_instances(sdata_blobs[label]))
115-
adata = AnnData(
116-
RNG.normal(size=(n_obs, 10)),
117-
obs=pd.DataFrame(RNG.normal(size=(n_obs, 3)), columns=["a", "b", "c"]),
118-
)
119-
adata.obs["instance_id"] = np.arange(adata.n_obs)
120-
adata.obs["category"] = RNG.choice(["a", "b", "c"], size=adata.n_obs)
121-
adata.obs["category"][:3] = ["a", "b", "c"]
122-
adata.obs["instance_id"] = list(range(adata.n_obs))
116+
vals = np.arange(n_obs)
117+
obs = pd.DataFrame({"a": vals, "b": vals + 0.3, "c": vals + 0.7})
118+
119+
adata = AnnData(vals.reshape(-1, 1), obs=obs)
120+
adata.obs["instance_id"] = vals
121+
adata.obs["category"] = list(["a", "b", "c"] * ((n_obs // 3) + 1))[:n_obs]
123122
adata.obs["region"] = label
124123
table = TableModel.parse(
125124
adata=adata,

0 commit comments

Comments
 (0)