diff --git a/CHANGELOG.md b/CHANGELOG.md index 69d51062..ab0b60a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,18 @@ and this project adheres to [Semantic Versioning][]. ## [0.2.6] - TBD +### Added + +- Added `set_channel_names` method to `SpatialData` to change the channel names of an + image element in `SpatialData` +- Added `write_channel_names` method to `SpatialData` to overwrite channel metadata on disk + without overwriting the image array itself. + +### Changed + +- `get_channels` is marked for deprecation in `SpatialData` v0.3.0. Function is replaced + by `get_channel_names` + ### Fixed - Updated deprecated default stages of `pre-commit` #771 diff --git a/docs/api.md b/docs/api.md index 23312c9b..bbe05f8d 100644 --- a/docs/api.md +++ b/docs/api.md @@ -89,6 +89,8 @@ The elements (building-blocks) that constitute `SpatialData`. points_geopandas_to_dask_dataframe points_dask_dataframe_to_geopandas get_channels + get_channel_names + set_channel_names force_2d ``` diff --git a/src/spatialdata/models/_utils.py b/src/spatialdata/models/_utils.py index 8f81c2a4..436043ed 100644 --- a/src/spatialdata/models/_utils.py +++ b/src/spatialdata/models/_utils.py @@ -14,6 +14,7 @@ from spatialdata._logging import logger from spatialdata._utils import _check_match_length_channels_c_dim +from spatialdata.models.models import Image2DModel, Image3DModel from spatialdata.transformations.transformations import BaseTransformation SpatialElement: TypeAlias = DataArray | DataTree | GeoDataFrame | DaskDataFrame @@ -27,7 +28,7 @@ X = "x" if TYPE_CHECKING: - from spatialdata.models.models import Image2DModel, Image3DModel, RasterSchema + from spatialdata.models.models import RasterSchema # mypy says that we can't do isinstance(something, SpatialElement),