From 754e170ffdf1944fda1e2be6f608ec1396611426 Mon Sep 17 00:00:00 2001 From: Martin Fleischmann Date: Fri, 31 Jan 2025 18:55:30 +0100 Subject: [PATCH] BUG: cast GeometryDtype to object prior assigning as index (#93) * BUG: cast GeometryDtype to object prior assigning as index * fix rtd * exactextract from conda * ee from conda-forge everywhere * cast to array for safety * exactextract from pip on win --- ci/310.yaml | 7 ++----- ci/311.yaml | 5 +---- ci/312.yaml | 3 ++- ci/39.yaml | 6 ++---- ci/dev.yaml | 2 +- readthedocs.yml | 4 ++++ xvec/zonal.py | 3 ++- 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/ci/310.yaml b/ci/310.yaml index 5979c3b..4cc43d8 100644 --- a/ci/310.yaml +++ b/ci/310.yaml @@ -9,6 +9,7 @@ dependencies: - rioxarray - joblib - rasterio + - exactextract - tqdm - pyproj # testing @@ -18,8 +19,4 @@ dependencies: - pytest-reportlog - geopandas-base - geodatasets - - pyogrio - - pip - - pip: - - exactextract==0.2.0.dev0 - + - pyogrio \ No newline at end of file diff --git a/ci/311.yaml b/ci/311.yaml index 1fe52c1..67739c6 100644 --- a/ci/311.yaml +++ b/ci/311.yaml @@ -9,6 +9,7 @@ dependencies: - rioxarray - joblib - rasterio + - exactextract - tqdm - pyproj # testing @@ -19,7 +20,3 @@ dependencies: - geopandas-base - geodatasets - pyogrio - - pip - - pip: - - exactextract==0.2.0.dev0 - diff --git a/ci/312.yaml b/ci/312.yaml index 24e8474..189ae72 100644 --- a/ci/312.yaml +++ b/ci/312.yaml @@ -22,5 +22,6 @@ dependencies: - mypy - pip - pip: - - exactextract==0.2.0.dev0 + - exactextract + diff --git a/ci/39.yaml b/ci/39.yaml index 7382d33..836fcee 100644 --- a/ci/39.yaml +++ b/ci/39.yaml @@ -9,6 +9,7 @@ dependencies: - rioxarray - joblib - rasterio + - exactextract - tqdm - pyproj # testing @@ -18,7 +19,4 @@ dependencies: - pytest-reportlog - geopandas-base - geodatasets - - pyogrio - - pip - - pip: - - exactextract==0.2.0.dev0 + - pyogrio \ No newline at end of file diff --git a/ci/dev.yaml b/ci/dev.yaml index 57d4840..b178946 100644 --- a/ci/dev.yaml +++ b/ci/dev.yaml @@ -10,6 +10,7 @@ dependencies: - rioxarray - joblib - rasterio + - exactextract - tqdm # testing - pytest @@ -24,4 +25,3 @@ dependencies: - git+https://github.com/shapely/shapely.git@main - git+https://github.com/pydata/xarray.git@main - git+https://github.com/pyproj4/pyproj.git - - exactextract==0.2.0.dev0 diff --git a/readthedocs.yml b/readthedocs.yml index 4a018c3..b564b6f 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -1,5 +1,9 @@ version: 2 +sphinx: + # Path to your Sphinx configuration file. + configuration: doc/source/conf.py + build: os: "ubuntu-20.04" tools: diff --git a/xvec/zonal.py b/xvec/zonal.py index eb28a35..2de04ca 100644 --- a/xvec/zonal.py +++ b/xvec/zonal.py @@ -193,7 +193,8 @@ def _zonal_stats_iterative( crs = None vec_cube = xr.concat( zonal, # type: ignore - dim=xr.DataArray(geometry, name=name, dims=name), + # astype('O') is a temporary fix for #87 + dim=xr.DataArray(np.asarray(geometry).astype("O"), name=name, dims=name), ).xvec.set_geom_indexes(name, crs=crs) gc.collect()