From 6c9ac1105a9e7473dad26431952fac77549b3c1a Mon Sep 17 00:00:00 2001 From: "H. Thomson Comer" Date: Thu, 5 Oct 2023 16:03:26 -0500 Subject: [PATCH] Re-enable cuspatial tests and dependency. (#1253) 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: https://github.com/rapidsai/cuspatial/pull/1253 --- ci/build_wheel.sh | 5 ++++ ci/test_wheel_cuproj.sh | 4 +++ dependencies.yaml | 30 ++++++++++++++++++-- python/cuproj/cuproj/tests/test_transform.py | 10 ++----- python/cuproj/pyproject.toml | 3 +- 5 files changed, 42 insertions(+), 10 deletions(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 6801137e3..ff997e245 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -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 diff --git a/ci/test_wheel_cuproj.sh b/ci/test_wheel_cuproj.sh index 0f52ddeb5..e89d1c650 100755 --- a/ci/test_wheel_cuproj.sh +++ b/ci/test_wheel_cuproj.sh @@ -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] diff --git a/dependencies.yaml b/dependencies.yaml index eb564f809..de80a97bc 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -103,6 +103,7 @@ files: key: test includes: - test_python_cuproj + - depends_on_cuspatial channels: - rapidsai @@ -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 @@ -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: @@ -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 diff --git a/python/cuproj/cuproj/tests/test_transform.py b/python/cuproj/cuproj/tests/test_transform.py index a02e66fb2..d90d3297e 100644 --- a/python/cuproj/cuproj/tests/test_transform.py +++ b/python/cuproj/cuproj/tests/test_transform.py @@ -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), @@ -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( @@ -200,4 +197,3 @@ def test_geoseries_input(): assert_allclose(cuproj_x, pyproj_x) assert_allclose(cuproj_y, pyproj_y) -""" diff --git a/python/cuproj/pyproject.toml b/python/cuproj/pyproject.toml index 525c9fda6..719888df7 100644 --- a/python/cuproj/pyproject.toml +++ b/python/cuproj/pyproject.toml @@ -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",