Skip to content

Commit

Permalink
Merge pull request #81 from callum-jpg/fix_xenium_decode
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaMarconato authored Oct 7, 2023
2 parents a225d69 + e9b5004 commit af55696
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/spatialdata_io/readers/xenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ def _poly(arr: ArrayLike) -> Polygon:

def _get_points(path: Path, specs: dict[str, Any]) -> Table:
table = read_parquet(path / XeniumKeys.TRANSCRIPTS_FILE)
table["feature_name"] = table["feature_name"].apply(lambda x: x.decode("utf-8"), meta=("feature_name", "object"))
table["feature_name"] = table["feature_name"].apply(
lambda x: x.decode("utf-8") if isinstance(x, bytes) else str(x), meta=("feature_name", "object")
)

transform = Scale([1.0 / specs["pixel_size"], 1.0 / specs["pixel_size"]], axes=("x", "y"))
points = PointsModel.parse(
Expand Down

0 comments on commit af55696

Please sign in to comment.