Skip to content

Commit

Permalink
bump geopandas to 1.x, drop fiona
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Sep 9, 2024
1 parent eaac568 commit 9295c3f
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 78 deletions.
36 changes: 0 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,42 +145,6 @@ pip install cuspatial-cu12 --extra-index-url=https://pypi.nvidia.com
pip install cuspatial-cu11 --extra-index-url=https://pypi.nvidia.com
```

#### Troubleshooting Fiona/GDAL versions

cuSpatial depends on [`geopandas`](https://github.com/geopandas/geopandas), which uses [`fiona >= 1.8.19`](https://pypi.org/project/Fiona/), to read common GIS formats with GDAL.

Fiona requires GDAL is already present on your system, but its minimum required version may be newer than the version of GDAL in your OS's package manager.

Fiona checks the GDAL version at install time and fails with an error like this if a compatible version of GDAL isn't installed:
```
ERROR: GDAL >= 3.2 is required for fiona. Please upgrade GDAL.
```

There are two ways to fix this:

1. Install a version of GDAL that meets fiona's minimum required version
* Ubuntu users can install a newer GDAL with the [UbuntuGIS PPA](https://wiki.ubuntu.com/UbuntuGIS):
```shell
sudo -y add-apt-repository ppa:ubuntugis/ppa
sudo apt install libgdal-dev
```
* Rocky Linux users can install a newer GDAL as follows
```shell
yum update -y
yum config-manager --set-enabled powertools
yum update -y
yum install -y gdal-devel
```
2. Pin fiona's version to a range that's compatible with your version of `libgdal-dev`
* For Ubuntu20.04 ([GDAL v3.0.4](https://packages.ubuntu.com/focal/libgdal-dev)):
```shell
pip install --no-binary fiona --extra-index-url=https://pypi.nvidia.com cuspatial-cu12 'fiona>=1.8.19,<1.9'
```
* For Ubuntu22.04 ([GDAL v3.4.1](https://packages.ubuntu.com/jammy/libgdal-dev)):
```shell
pip install --no-binary fiona --extra-index-url=https://pypi.nvidia.com cuspatial-cu12 'fiona>=1.9'
```

### Build/Install from source

To build and install cuSpatial from source please see the [build documentation](https://docs.rapids.ai/api/cuspatial/stable/developer_guide/build.html).
Expand Down
16 changes: 1 addition & 15 deletions ci/test_wheel_cuproj.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,16 @@ set -eou pipefail
mkdir -p ./dist
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"

# install build dependencies for fiona
if type -f yum > /dev/null 2>&1; then
yum update -y
# some of gdal-devel's dependencies, like 'libdap', come from the powertools repo
yum config-manager --set-enabled powertools
yum update -y
yum install -y gdal-devel
else
apt update
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends libgdal-dev
fi

# Download the cuproj and cuspatial built in the previous step
RAPIDS_PY_WHEEL_NAME="cuproj_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 python ./dist
RAPIDS_PY_WHEEL_NAME="cuspatial_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 python ./dist
RAPIDS_PY_WHEEL_NAME="libcuspatial_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 cpp ./dist

# echo to expand wildcard before adding `[extra]` requires for pip
python -m pip install \
--no-binary 'fiona' \
"$(echo ./dist/cuspatial*.whl)" \
"$(echo ./dist/cuproj*.whl)[test]" \
"$(echo ./dist/libcuspatial*.whl)" \
'fiona>=1.8.19,<1.9'
"$(echo ./dist/libcuspatial*.whl)"

rapids-logger "pytest cuproj"
pushd python/cuproj/cuproj
Expand Down
16 changes: 1 addition & 15 deletions ci/test_wheel_cuspatial.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,14 @@ set -eou pipefail
mkdir -p ./dist
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"

# install build dependencies for fiona
if type -f yum > /dev/null 2>&1; then
yum update -y
# some of gdal-devel's dependencies, like 'libdap', come from the powertools repo
yum config-manager --set-enabled powertools
yum update -y
yum install -y gdal-devel
else
apt update
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends libgdal-dev
fi

# Download the cuspatial and libcuspatial built in the previous step
RAPIDS_PY_WHEEL_NAME="cuspatial_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 python ./dist
RAPIDS_PY_WHEEL_NAME="libcuspatial_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 cpp ./dist

# echo to expand wildcard before adding `[extra]` requires for pip
python -m pip install \
--no-binary 'fiona' \
"$(echo ./dist/cuspatial*.whl)[test]" \
"$(echo ./dist/libcuspatial*.whl)" \
'fiona>=1.8.19,<1.9'
"$(echo ./dist/libcuspatial*.whl)"

rapids-logger "pytest cuspatial"
pushd python/cuspatial/cuspatial
Expand Down
3 changes: 1 addition & 2 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ dependencies:
- cython>=3.0.0
- doxygen
- gcc_linux-64=11.*
- geopandas<1
- geopandas>=0.11.0
- geopandas>=1.0.0
- ipython
- ipywidgets
- libcudf==24.10.*,>=0.0.0a0
Expand Down
3 changes: 1 addition & 2 deletions conda/environments/all_cuda-125_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ dependencies:
- cython>=3.0.0
- doxygen
- gcc_linux-64=11.*
- geopandas<1
- geopandas>=0.11.0
- geopandas>=1.0.0
- ipython
- ipywidgets
- libcudf==24.10.*,>=0.0.0a0
Expand Down
2 changes: 1 addition & 1 deletion conda/recipes/cuspatial/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ requirements:
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
- cudf ={{ minor_version }}
- pylibcudf ={{ minor_version }}
- geopandas >=0.11.0
- geopandas >=1.0.0
- numpy >=1.23,<2.0a0
- python
- rmm ={{ minor_version }}
Expand Down
7 changes: 2 additions & 5 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,6 @@ dependencies:
# TODO: Remove geopandas.dataset usage in cuspatial_api_examples.ipynb
test_notebooks:
common:
- output_types: [conda, requirements, pyproject]
packages:
- geopandas<1
- output_types: conda
packages:
- osmnx>=1.9.3
Expand All @@ -405,7 +402,7 @@ dependencies:
common:
- output_types: [conda, requirements, pyproject]
packages:
- geopandas>=0.11.0
- &geopandas geopandas>=1.0.0
- &numpy numpy>=1.23,<2.0a0
test_python_cuspatial:
common:
Expand All @@ -422,7 +419,7 @@ dependencies:
- pytest
- pytest-cov
- pytest-xdist
- geopandas>=0.11.0
- *geopandas
- output_types: [requirements, pyproject]
packages:
- pyproj>=3.6.0,<3.7a0
Expand Down
2 changes: 1 addition & 1 deletion python/cuproj/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ classifiers = [
[project.optional-dependencies]
test = [
"cuspatial==24.10.*,>=0.0.0a0",
"geopandas>=0.11.0",
"geopandas>=1.0.0",
"numpy>=1.23,<2.0a0",
"pyproj>=3.6.0,<3.7a0",
"pytest",
Expand Down
2 changes: 1 addition & 1 deletion python/cuspatial/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ license = { text = "Apache 2.0" }
requires-python = ">=3.10"
dependencies = [
"cudf==24.10.*,>=0.0.0a0",
"geopandas>=0.11.0",
"geopandas>=1.0.0",
"libcudf==24.10.*,>=0.0.0a0",
"libcuspatial==24.10.*,>=0.0.0a0",
"numpy>=1.23,<2.0a0",
Expand Down

0 comments on commit 9295c3f

Please sign in to comment.