File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
src/spatialdata_io/readers Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change 44import logging
55import os
66import re
7- import tempfile
87import warnings
9- import zipfile
108from pathlib import Path
119from types import MappingProxyType
1210from typing import TYPE_CHECKING , Any
@@ -418,9 +416,6 @@ def _get_polygons(
418416 n_jobs : int ,
419417 idx : ArrayLike | None = None ,
420418) -> GeoDataFrame :
421- def _poly (arr : ArrayLike ) -> Polygon :
422- return Polygon (arr [:- 1 ])
423-
424419 # seems to be faster than pd.read_parquet
425420 df = pq .read_table (path / file ).to_pandas ()
426421
@@ -429,8 +424,9 @@ def _poly(arr: ArrayLike) -> Polygon:
429424 # convert the index to str since we will compare it with an AnnData object, where the index is a str
430425 index .index = index .index .astype (str )
431426 index = _decode_cell_id_column (index )
427+
432428 out = Parallel (n_jobs = n_jobs )(
433- delayed (_poly )(i .to_numpy ())
429+ delayed (Polygon )(i .to_numpy ())
434430 for _ , i in group_by [[XeniumKeys .BOUNDARIES_VERTEX_X , XeniumKeys .BOUNDARIES_VERTEX_Y ]]
435431 )
436432 geo_df = GeoDataFrame ({"geometry" : out })
You can’t perform that action at this time.
0 commit comments