Skip to content

Commit

Permalink
fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneDefauw committed Dec 17, 2024
1 parent 5c3edee commit 5b95fc1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/spatialdata/_core/operations/rasterize_bins.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ def rasterize_bins(

if isinstance(element, DataArray):
transformations = get_transformation(element, get_all=True)
# satisfy mypy
if not isinstance(transformations, dict):
raise TypeError("Expected transformations to be a dictionary when get_all=True.")
else:
# get the transformation
if table.n_obs < 6:
Expand Down Expand Up @@ -228,7 +231,12 @@ def channel_rasterization(block_id: tuple[int, int, int] | None) -> ArrayLike:
else:
image[i, y, x] = table.X[:, key_index]

return Image2DModel.parse(image, transformations=transformations, c_coords=keys, dims=("c", "y", "x"))
return Image2DModel.parse(
data=image,
dims=("c", "y", "x"),
transformations=transformations,
c_coords=keys,
)


def _get_uint_dtype(value: int) -> str:
Expand Down

0 comments on commit 5b95fc1

Please sign in to comment.