From d992d7cf75e8f8792b7ea2dfd4e1ac7939664cd8 Mon Sep 17 00:00:00 2001 From: Martin Fleischmann Date: Fri, 31 Jan 2025 18:31:51 +0100 Subject: [PATCH 1/6] BUG: cast GeometryDtype to object prior assigning as index --- xvec/zonal.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xvec/zonal.py b/xvec/zonal.py index eb28a35..31e2b59 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(geometry.astype("O"), name=name, dims=name), ).xvec.set_geom_indexes(name, crs=crs) gc.collect() From b872c6c192c0a12d2c10cabfc4936cd75b38240a Mon Sep 17 00:00:00 2001 From: Martin Fleischmann Date: Fri, 31 Jan 2025 18:34:28 +0100 Subject: [PATCH 2/6] fix rtd --- readthedocs.yml | 4 ++++ 1 file changed, 4 insertions(+) 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: From 71b95ff7817ee5ddc936dc7ebdab93830d637198 Mon Sep 17 00:00:00 2001 From: Martin Fleischmann Date: Fri, 31 Jan 2025 18:38:49 +0100 Subject: [PATCH 3/6] exactextract from conda --- ci/dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From a56c1695a686b20bf316aa73d0d16ee32c7c248b Mon Sep 17 00:00:00 2001 From: Martin Fleischmann Date: Fri, 31 Jan 2025 18:41:47 +0100 Subject: [PATCH 4/6] ee from conda-forge everywhere --- ci/310.yaml | 7 ++----- ci/311.yaml | 5 +---- ci/312.yaml | 4 +--- ci/39.yaml | 6 ++---- 4 files changed, 6 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..70f6fd7 100644 --- a/ci/312.yaml +++ b/ci/312.yaml @@ -9,6 +9,7 @@ dependencies: - rioxarray - joblib - rasterio + - exactextract - tqdm - pyproj # testing @@ -20,7 +21,4 @@ dependencies: - geodatasets - pyogrio - mypy - - pip - - pip: - - exactextract==0.2.0.dev0 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 From ad14abf395d65a81be735647f6756599453a708c Mon Sep 17 00:00:00 2001 From: Martin Fleischmann Date: Fri, 31 Jan 2025 18:45:08 +0100 Subject: [PATCH 5/6] cast to array for safety --- xvec/zonal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xvec/zonal.py b/xvec/zonal.py index 31e2b59..2de04ca 100644 --- a/xvec/zonal.py +++ b/xvec/zonal.py @@ -194,7 +194,7 @@ def _zonal_stats_iterative( vec_cube = xr.concat( zonal, # type: ignore # astype('O') is a temporary fix for #87 - dim=xr.DataArray(geometry.astype("O"), name=name, dims=name), + dim=xr.DataArray(np.asarray(geometry).astype("O"), name=name, dims=name), ).xvec.set_geom_indexes(name, crs=crs) gc.collect() From b681eff826b61787a8f5399319257d0b2352a42d Mon Sep 17 00:00:00 2001 From: Martin Fleischmann Date: Fri, 31 Jan 2025 18:50:02 +0100 Subject: [PATCH 6/6] exactextract from pip on win --- ci/312.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/312.yaml b/ci/312.yaml index 70f6fd7..189ae72 100644 --- a/ci/312.yaml +++ b/ci/312.yaml @@ -9,7 +9,6 @@ dependencies: - rioxarray - joblib - rasterio - - exactextract - tqdm - pyproj # testing @@ -21,4 +20,8 @@ dependencies: - geodatasets - pyogrio - mypy + - pip + - pip: + - exactextract +