Skip to content

Commit

Permalink
Re-enable cuspatial tests and dependency. (#1253)
Browse files Browse the repository at this point in the history
A poorly understood cuproj->cuspatial dependency required that cuspatial be removed from cuproj's tests during the 23.08->23.10 merge rebase. This PR re-enables those tests.

Authors:
  - H. Thomson Comer (https://github.com/thomcom)
  - Mark Harris (https://github.com/harrism)
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Michael Wang (https://github.com/isVoid)
  - Mark Harris (https://github.com/harrism)
  - Bradley Dice (https://github.com/bdice)
  - AJ Schmidt (https://github.com/ajschmidt8)

URL: #1253
  • Loading branch information
thomcom authored Oct 5, 2023
1 parent 366183c commit 6c9ac11
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 10 deletions.
5 changes: 5 additions & 0 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,16 @@ if ! rapids-is-release-build; then
alpha_spec=',>=0.0.0a0'
fi

# Add CUDA version suffix to dependencies
sed -r -i "s/rmm(.*)\"/rmm${PACKAGE_CUDA_SUFFIX}\1${alpha_spec}\"/g" ${pyproject_file}
if [[ ${package_name} == "cuspatial" ]]; then
sed -r -i "s/cudf==(.*)\"/cudf${PACKAGE_CUDA_SUFFIX}==\1${alpha_spec}\"/g" ${pyproject_file}
fi

if [[ ${package_name} == "cuproj" ]]; then
sed -r -i "s/cuspatial==(.*)\"/cuspatial${PACKAGE_CUDA_SUFFIX}==\1${alpha_spec}\"/g" ${pyproject_file}
fi

if [[ $PACKAGE_CUDA_SUFFIX == "-cu12" ]]; then
sed -i "s/cupy-cuda11x/cupy-cuda12x/g" ${pyproject_file}
fi
Expand Down
4 changes: 4 additions & 0 deletions ci/test_wheel_cuproj.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ apt update
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends libgdal-dev
python -m pip install --no-binary fiona 'fiona>=1.8.19,<1.9'

# Download the cuspatial built in the previous step
RAPIDS_PY_WHEEL_NAME="cuspatial_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./local-cuspatial-dep
python -m pip install --no-deps ./local-cuspatial-dep/cuspatial*.whl

# echo to expand wildcard before adding `[extra]` requires for pip
python -m pip install $(echo ./dist/cuproj*.whl)[test]

Expand Down
30 changes: 28 additions & 2 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ files:
key: test
includes:
- test_python_cuproj
- depends_on_cuspatial

channels:
- rapidsai
Expand Down Expand Up @@ -311,7 +312,7 @@ dependencies:
- scikit-image
- output_types: [requirements, pyproject]
packages:
- pyproj
- pyproj>=3.6.0,<3.7a0
py_version:
specific:
- output_types: conda
Expand Down Expand Up @@ -349,7 +350,7 @@ dependencies:
- geopandas>=0.11.0
- output_types: [requirements, pyproject]
packages:
- pyproj
- pyproj>=3.6.0,<3.7a0

depends_on_rmm:
common:
Expand Down Expand Up @@ -426,6 +427,31 @@ dependencies:
- {matrix: {cuda: "11.2"}, packages: *cuml_packages_pip_cu11}
- {matrix: null, packages: [*cuml_conda]}

depends_on_cuspatial:
common:
- output_types: conda
packages:
- &cuspatial_conda cuspatial==23.10.*
- output_types: requirements
packages:
# pip recognizes the index as a global option for the requirements.txt file
- --extra-index-url=https://pypi.nvidia.com
specific:
- output_types: [requirements, pyproject]
matrices:
- matrix: {cuda: "12.2"}
packages: &cuspatial_packages_pip_cu12
- cuspatial-cu12==23.10.*
- {matrix: {cuda: "12.1"}, packages: *cuspatial_packages_pip_cu12}
- {matrix: {cuda: "12.0"}, packages: *cuspatial_packages_pip_cu12}
- matrix: {cuda: "11.8"}
packages: &cuspatial_packages_pip_cu11
- cuspatial-cu11==23.10.*
- {matrix: {cuda: "11.5"}, packages: *cuspatial_packages_pip_cu11}
- {matrix: {cuda: "11.4"}, packages: *cuspatial_packages_pip_cu11}
- {matrix: {cuda: "11.2"}, packages: *cuspatial_packages_pip_cu11}
- {matrix: null, packages: [*cuspatial_conda]}

depends_on_cupy:
common:
- output_types: conda
Expand Down
10 changes: 3 additions & 7 deletions python/cuproj/cuproj/tests/test_transform.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@

import cupy as cp
# import geopandas as gpd
import geopandas as gpd
import numpy as np
import pytest
from cupy.testing import assert_allclose
from pyproj import Transformer
from pyproj.enums import TransformDirection
from shapely.geometry import Point

# import cuspatial
import cuspatial
from cuproj import Transformer as cuTransformer

# from shapely.geometry import Point


valid_crs_combos = [
(4326, 32756),
(32756, 4326),
Expand Down Expand Up @@ -178,7 +176,6 @@ def test_wgs84_to_utm_grid(dtype, container_type,
dtype, container_type, min_corner, max_corner, crs_to)


""" Temporary fix to repair 23.08 -> 23.10 automerge
# test __cuda_array_interface__ support by using cuspatial geoseries as input
def test_geoseries_input():
s = gpd.GeoSeries(
Expand All @@ -200,4 +197,3 @@ def test_geoseries_input():

assert_allclose(cuproj_x, pyproj_x)
assert_allclose(cuproj_y, pyproj_y)
"""
3 changes: 2 additions & 1 deletion python/cuproj/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ classifiers = [

[project.optional-dependencies]
test = [
"cuspatial==23.10.*",
"geopandas>=0.11.0",
"pyproj",
"pyproj>=3.6.0,<3.7a0",
"pytest",
"pytest-cov",
"pytest-xdist",
Expand Down

0 comments on commit 6c9ac11

Please sign in to comment.