Skip to content

Commit 0042e6f

Browse files
authored
Merge pull request #58 from KatherLab/fix/tile-warning
fix numpy casting warning
2 parents ad5f8fd + 8829eca commit 0042e6f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/stamp/modeling/data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,11 @@ def get_coords(feature_h5: h5py.File) -> CoordsInfo:
214214
"unit", None
215215
) == "um":
216216
# STAMP v2 format
217-
tile_size_um = Microns(tile_size)
217+
tile_size_um = Microns(float(tile_size))
218218
coords_um = coords
219219
elif tile_size := feature_h5.attrs.get("tile_size_um", None):
220220
# Newer STAMP format
221-
tile_size_um = Microns(tile_size)
221+
tile_size_um = Microns(float(tile_size))
222222
coords_um = coords
223223
elif round(feature_h5.attrs.get("tile_size", get_stride(coords))) == 224:
224224
# Historic STAMP format
@@ -237,7 +237,7 @@ def get_coords(feature_h5: h5py.File) -> CoordsInfo:
237237
)
238238

239239
if not tile_size_px and "tile_size_px" in feature_h5.attrs:
240-
tile_size_px = TilePixels(feature_h5.attrs["tile_size_px"]) # pyright: ignore[reportArgumentType]
240+
tile_size_px = TilePixels(int(feature_h5.attrs["tile_size_px"])) # pyright: ignore[reportArgumentType]
241241

242242
if not tile_size_um or coords_um is None:
243243
raise RuntimeError(

0 commit comments

Comments
 (0)