diff --git a/CHANGELOG.md b/CHANGELOG.md index ed80915..03e51af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog -## Version 0.0.11 -- BUGFIX: `to_anndata()` only populates `obsm` with spatial coordinates if the original `SpatialExperiment` has spatial coordinates (PR #53) +## Version 0.0.11-0.0.12 +- BUGFIX: `to_anndata()` only populates `obsm` with spatial coordinates if the original `SpatialExperiment` has spatial coordinates (PR #53, #54) ## Version 0.0.10 diff --git a/src/spatialexperiment/spatialexperiment.py b/src/spatialexperiment/spatialexperiment.py index bdf69e6..da60c08 100644 --- a/src/spatialexperiment/spatialexperiment.py +++ b/src/spatialexperiment/spatialexperiment.py @@ -1051,7 +1051,7 @@ def to_anndata(self, include_alternative_experiments: bool = False) -> "anndata. "tissue_hires_scalef": row["scale_factor"] } # default to `tissue_hires_scalef` for now - if len(self.spatial_coordinates) > 0: + if self.spatial_coords_names: coords_by_axis = [self.spatial_coordinates[axis] for axis in self.spatial_coords_names] obj.obsm["spatial"] = np.column_stack(coords_by_axis)