Skip to content

Commit

Permalink
drop unmaintained pygeos for shapely 2.0 (#545)
Browse files Browse the repository at this point in the history
* drop unmaintained pygeos for shapely 2.0

* removed unused pygeos env variable

---------

Co-authored-by: Luca Marconato <[email protected]>
  • Loading branch information
omsai and LucaMarconato authored May 24, 2024
1 parent fdbf8eb commit ece4de4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 49 deletions.
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ dependencies = [
"dask-image",
"dask<=2024.2.1",
"fsspec<=2023.6",
"geopandas",
"geopandas>=0.14",
"multiscale_spatial_image==0.11.2",
"networkx",
"numpy",
"ome_zarr>=0.7.0",
"pandas",
"pooch",
"pyarrow",
"pygeos",
"rich",
"shapely>=2.0.1",
"spatial_image==0.3.0",
Expand Down
7 changes: 0 additions & 7 deletions src/spatialdata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@

__version__ = version("spatialdata")

# Forcing usage of shapely 2.0 by geopandas
# https://geopandas.org/en/stable/getting_started/install.html#using-the-optional-pygeos-dependency
from ._compat import _check_geopandas_using_shapely

_check_geopandas_using_shapely()


__all__ = [
"models",
"transformations",
Expand Down
27 changes: 0 additions & 27 deletions src/spatialdata/_compat.py

This file was deleted.

22 changes: 9 additions & 13 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
from __future__ import annotations

# isort: off
import os
from typing import Any
from collections.abc import Sequence

os.environ["USE_PYGEOS"] = "0"
# isort:on

from shapely import linearrings, polygons
from pathlib import Path
from spatialdata._types import ArrayLike
from typing import Any

import dask.dataframe as dd
import geopandas as gpd
import numpy as np
import pandas as pd
import pytest
Expand All @@ -19,9 +14,13 @@
from geopandas import GeoDataFrame
from multiscale_spatial_image import MultiscaleSpatialImage
from numpy.random import default_rng
from shapely import linearrings, polygons
from shapely.geometry import MultiPolygon, Point, Polygon
from spatial_image import SpatialImage
from spatialdata._core._deepcopy import deepcopy as _deepcopy
from spatialdata._core.spatialdata import SpatialData
from spatialdata._types import ArrayLike
from spatialdata.datasets import BlobsDataset
from spatialdata.models import (
Image2DModel,
Image3DModel,
Expand All @@ -32,10 +31,6 @@
TableModel,
)
from xarray import DataArray
from spatialdata.datasets import BlobsDataset
import geopandas as gpd
import dask.dataframe as dd
from spatialdata._core._deepcopy import deepcopy as _deepcopy

RNG = default_rng(seed=0)

Expand Down Expand Up @@ -309,6 +304,7 @@ def labels_blobs() -> ArrayLike:
def sdata_blobs() -> SpatialData:
"""Create a 2D labels."""
from copy import deepcopy

from spatialdata.datasets import blobs

sdata = deepcopy(blobs(256, 300, 3))
Expand Down

0 comments on commit ece4de4

Please sign in to comment.