Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Python bindings for cuProj #1217

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
219 commits
Select commit Hold shift + click to select a range
cfd69ad
Add cmake infrastructure and placeholder files for projection library
harrism May 9, 2023
dcb23ef
Merge branch 'branch-23.06' into feature/projection/cmake
harrism May 9, 2023
7b2e9b9
Rename to cuproj
harrism May 10, 2023
f469cf0
Merge branch 'branch-23.06' into feature/projection/cmake
harrism May 10, 2023
68acf29
Delete cugeo dir
harrism May 11, 2023
c16e735
show more digits in vec_2d_matcher
harrism May 31, 2023
818a3e5
Add copy of PROJ license
harrism May 31, 2023
c1550cd
Initial tmerc implementation and test
harrism May 31, 2023
c2784a9
Merge branch 'branch-23.08' into feature/projection/cmake
harrism May 31, 2023
d8d851d
Remove _ctk_static_suffix
harrism May 31, 2023
dade592
if TARGET conda_env update
harrism May 31, 2023
10b0590
Merge branch 'branch-23.08' into feature/projection/cmake
harrism Jun 1, 2023
88a3760
Update version to 23.08 and PUBLIC -> PRIVATE
harrism Jun 1, 2023
c36c7eb
Merge branch 'feature/projection/cmake' into feature/projection/wgs-utm
harrism Jun 1, 2023
2be7746
Move PROJ license into the file that uses its code.
harrism Jun 1, 2023
87172f0
Remove placeholder CPU code
harrism Jun 1, 2023
8cdc8dc
Rename test.
harrism Jun 6, 2023
48ead2e
Move cuproj into cpp and build it when cuspatial builds.
harrism Jun 6, 2023
b889452
re-add cuml
harrism Jun 6, 2023
2073b1f
Add sqlite dependency
harrism Jun 6, 2023
d366ad5
Merge branch 'branch-23.08' into feature/projection/cmake
harrism Jun 6, 2023
d59cdc4
Add proj and sqlite dependencies to conda meta.yaml
harrism Jun 6, 2023
3eba34e
Merge branch 'branch-23.08' into feature/projection/cmake
harrism Jun 7, 2023
cd68e4e
Fix comment
harrism Jun 7, 2023
5243a5d
rename to get_cudf.cmake
harrism Jun 7, 2023
e27f7bb
Remove GNUInstallDirs
harrism Jun 7, 2023
a0ad375
Copyright
harrism Jun 7, 2023
e2a28ea
cuspatial-exports --> cuproj-exports
harrism Jun 7, 2023
5d395c4
PROJ namespace
harrism Jun 7, 2023
517e65b
Remove FIND_PACKAGE_ARGUMENTS
harrism Jun 7, 2023
5a00596
Get cudftestutil when BUILD_BENCHMARKS is enabled too.
harrism Jun 7, 2023
9bb736b
Merge branch 'feature/projection/cmake' into feature/projection/wgs-utm
harrism Jun 7, 2023
6a168fc
Remove extraneous comma
harrism Jun 7, 2023
fb4148a
Remove the b combinator
harrism Jun 7, 2023
4428dac
Remove unused factories
harrism Jun 7, 2023
33fa489
white space
harrism Jun 7, 2023
48c9ffc
Merge branch 'branch-23.08' into feature/projection/cmake
harrism Jun 7, 2023
1745d0b
PROJ case
harrism Jun 7, 2023
beee5a4
Remove rapids_export of PROJ
harrism Jun 7, 2023
24923f2
Make cuproj get_cudf.cmake match cuspatial's
harrism Jun 8, 2023
6e08915
Merge branch 'feature/projection/cmake' into feature/projection/wgs-utm
harrism Jun 8, 2023
5bdc59c
Refactor to use an operator base class
harrism Jun 8, 2023
95cc7df
Refactor ctor
harrism Jun 8, 2023
300e769
Remove `BUILD_INTERFACE` from `target_compile_definitions`.
harrism Jun 13, 2023
42e5103
Temporary: attempt debugging cmake find_package in CI
harrism Jun 13, 2023
8bbc369
Merge branch 'branch-23.08' into feature/projection/cmake
harrism Jun 13, 2023
725d785
Merge branch 'feature/projection/cmake' into feature/projection/wgs-utm
harrism Jun 13, 2023
2a11430
Factor operations and parameters out of projections
harrism Jun 13, 2023
3552d0c
Revert temporary cmake debugging
harrism Jun 13, 2023
d063ca9
Update cpp/CMakeLists.txt
harrism Jun 14, 2023
fcdb4bb
Update CUPROJ VERSION in update-version.sh
harrism Jun 14, 2023
b130fb3
Big refactor to a dynamic device-side pipeline
harrism Jun 15, 2023
9875d8c
Factor cartesian coord scale and offset into a separate operation, an…
harrism Jun 20, 2023
4d0727f
Inverse of clamp
harrism Jun 20, 2023
fcbed5c
inverse of deg_to_rad
harrism Jun 20, 2023
1321415
Comment out debugging message
harrism Jun 20, 2023
6d5c907
inverse tmerc
harrism Jun 20, 2023
fc47c8e
Add support for inverse transformation
harrism Jun 21, 2023
5f8235b
Test inverse transformation and major test cleanup
harrism Jun 21, 2023
2812e0d
Merge branch 'branch-23.08' into feature/projection/cmake
harrism Jun 21, 2023
da30f35
Merge branch 'feature/projection/cmake' into feature/projection/wgs-utm
harrism Jun 21, 2023
45f38d8
Clean up setup switch
harrism Jun 22, 2023
404ec69
Clean up comments
harrism Jun 22, 2023
e8f0bdc
utm projection factory, for now...
harrism Jun 22, 2023
b54aaf7
Rename clenshaw functions to get around codespell false positives
harrism Jun 22, 2023
b552b9a
detail namespace
harrism Jun 22, 2023
b31c650
Move operations to subfolder
harrism Jun 22, 2023
eb14f2e
Add projection factories
harrism Jun 22, 2023
51ba7e8
Merge branch 'branch-23.08' into feature/projection/wgs-utm
harrism Jun 27, 2023
0cd4644
Add initial README
harrism Jun 28, 2023
9e04781
Support and test UTM->WGS84 construction
harrism Jun 28, 2023
d4e2b0e
Move pipeline into a detail header
harrism Jun 28, 2023
1f7bca6
operation docs
harrism Jun 28, 2023
88cfeca
Document enums
harrism Jun 28, 2023
83727e8
Document projection_factories
harrism Jun 28, 2023
2341ffe
projection_factories docs and detail namespace
harrism Jun 28, 2023
f4ceed3
Document ellipsoid.hpp
harrism Jun 28, 2023
6485b2e
Document projection_parameters.hpp
harrism Jun 28, 2023
176642b
Document transverse_mercator operation
harrism Jun 28, 2023
57d817e
Document axis_swap
harrism Jun 28, 2023
ade7cdc
Document clamp_angular_coordinates
harrism Jun 28, 2023
2a38ecd
Document degrees_to_radians
harrism Jun 28, 2023
c323cef
Document offset_scale_cartesian_coordinates
harrism Jun 28, 2023
569c42f
Remove horizontal rules
harrism Jun 28, 2023
0c32e06
Document pipeline.cuh
harrism Jun 28, 2023
a15f94e
Brief test docs
harrism Jun 28, 2023
d79563c
Merge branch 'branch-23.08' into feature/projection/wgs-utm
harrism Jun 28, 2023
19e9699
Improve reverse construction logic and fix failing tests
harrism Jun 29, 2023
292f85e
Factor out wrapping to -PI..PI and constants
harrism Jul 4, 2023
c23db51
Remove commented out code
harrism Jul 4, 2023
ce69abc
Factor out central meridian/parallel, remove unused comments
harrism Jul 4, 2023
38fe73c
Use HOST_DEVICE_EXPECTS and comment instead of #if 0
harrism Jul 4, 2023
cc5afb2
Improve mismatch printing
harrism Jul 4, 2023
e9471a0
Test multiple places around the globe.
harrism Jul 4, 2023
6e02100
Merge branch 'branch-23.08' into feature/projection/wgs-utm
harrism Jul 11, 2023
2fe01f7
Simplify test vector conversion
harrism Jul 11, 2023
09d0b63
Move grid_generator to cuproj_test
harrism Jul 11, 2023
174e7b7
Initial dependencies and cmake
harrism Jul 13, 2023
7c32c0a
Inner Python cmakelists and (empty) readme
harrism Jul 13, 2023
f37b24c
Initial failing pytest
harrism Jul 13, 2023
2d5e228
Start of projection cython class
harrism Jul 13, 2023
28fefc1
Add cython bindings to cuproj
isVoid Jul 13, 2023
7fabbe9
missed cuspatial->cuproj instances
harrism Jul 13, 2023
1206f3c
Non-working cuprojshim
harrism Jul 13, 2023
571318c
Add streams to allocate_like call
isVoid Jul 14, 2023
5321d00
Merge branch 'fix/allocate_like' into feature/projection/python-bindi…
isVoid Jul 17, 2023
bc031aa
Vended vec_2d from cuspatial
isVoid Jul 17, 2023
6f95a51
restructure cuproj folder structures and update cuproj cython binding…
isVoid Jul 17, 2023
a12533d
Merge pull request #2 from isVoid/feature/projection/python-bindings-…
harrism Jul 18, 2023
0c6e929
Fix names in cmakelists
harrism Jul 18, 2023
8464f0e
cuproj changes in support of cython
harrism Jul 18, 2023
82ed74c
python bindings and cuprojshim library
harrism Jul 18, 2023
e2fe411
dereference unique_ptr
harrism Jul 18, 2023
0b9eac1
Allow different input and output iterator types
harrism Jul 18, 2023
6621850
.hpp --> .cuh required
harrism Jul 18, 2023
7a9b8aa
Add zipping deinterleaved transform to shim layer (not compiling yet)
harrism Jul 18, 2023
2335e32
Add semicolon
isVoid Jul 18, 2023
73dc654
Rewrite cython API to accept separate column input
isVoid Jul 18, 2023
5bb5db0
change factory to return a raw pointer
isVoid Jul 18, 2023
cc30c7c
cleanup
isVoid Jul 18, 2023
050376a
Merge pull request #3 from isVoid/feature/projection/python-bindings-…
harrism Jul 19, 2023
c6c1ba2
Support lowercase epsg codes.
harrism Jul 19, 2023
8952f21
Add another invalid EPSG test
harrism Jul 19, 2023
31817bc
Add transformer Cython class and passing one-point pytest
harrism Jul 19, 2023
aa3b56d
Style
harrism Jul 19, 2023
d115413
Don't use `always_xy`
harrism Jul 19, 2023
af4f65c
Refactor epsg string parsing into a class for type safety and simplic…
harrism Jul 19, 2023
de2a3d2
Fix comment.
harrism Jul 19, 2023
7808e68
Fix logic error with previous change
harrism Jul 19, 2023
ca38108
Support integer EPSG codes
harrism Jul 19, 2023
4a37d07
Python support for int epsg codes
harrism Jul 19, 2023
3b0429c
First working array pytest
harrism Jul 20, 2023
dd20f4a
style
harrism Jul 20, 2023
7b1f552
Test multiple grid locations and container types
harrism Jul 20, 2023
0f47cfa
cuprojshim clang-format
harrism Jul 20, 2023
11004a0
Merge branch 'branch-23.08' into feature/projection/python-bindings
harrism Jul 20, 2023
601a0ac
CUPROJ_HOST_DEVICE
harrism Jul 20, 2023
9b29d27
Replace grid generator with np.meshgrid
harrism Jul 23, 2023
4e3cb6b
Remove unused template parameter
harrism Jul 23, 2023
2e437ae
pytest inverse transforms
harrism Jul 23, 2023
cbf768f
Comments
harrism Jul 23, 2023
017bf01
Use __cuda_array_interface instead of assuming cupy array input
harrism Jul 23, 2023
3982a00
Fix geoseries test
harrism Jul 24, 2023
48420c7
Support (and test) float32
harrism Jul 25, 2023
7b876a1
Remove unused shim function
harrism Jul 25, 2023
9d6d4c4
Allow EPSG tuples, and mixed strings, ints and tuples.
harrism Jul 25, 2023
9091f03
style
harrism Jul 25, 2023
9be2bdf
lowercase
harrism Jul 25, 2023
6668bb9
Rely on cupy for __cuda_array_interface__, and improve docs
harrism Jul 26, 2023
b9540c1
Unused import
harrism Jul 26, 2023
30ae6a1
New cuproj benchmark notebook.
harrism Jul 26, 2023
7733004
Update `update-version.sh` for cuproj
harrism Jul 26, 2023
d21645f
Merge branch 'branch-23.08' into feature/projection/python-bindings
harrism Jul 26, 2023
845f4ee
A bit more of a readme.
harrism Jul 26, 2023
726ba3f
Add cuproj to CI scripts and configuration
harrism Jul 26, 2023
4c462c8
Add cuproj to validargs
harrism Jul 26, 2023
76d8e03
Document notebook
harrism Jul 26, 2023
b6b8fb6
libcuproj is built by libcuspatial cmake
harrism Jul 27, 2023
5b906e3
Some updates / consistency improvements for cuprojshim cmake
harrism Jul 27, 2023
b6cfa7e
Remove nonexistant libcuproj/libcuproj-tests conda packages
harrism Jul 27, 2023
fd0f65a
cuspatial --> cuprojshim copy/paste fix
harrism Jul 27, 2023
5389d06
Add rapids-cmake-find
harrism Jul 27, 2023
3b051b1
Find RMM
harrism Jul 27, 2023
7790231
rapids-cpm
harrism Jul 27, 2023
6029d98
Add get_rmm.cmake for cuproj
harrism Jul 27, 2023
8676232
.coveragerc for cuproj
harrism Jul 27, 2023
12b0230
cuProj wheel build and test
harrism Jul 27, 2023
9ec1705
Update .github/workflows/pr.yaml
isVoid Jul 28, 2023
f832118
Apply review comments to fix pr.yaml
isVoid Jul 28, 2023
967cff6
Further workflow fixes
harrism Jul 28, 2023
4a51037
Another workflow error
harrism Jul 28, 2023
b4d394d
assert_allclose in pytest
harrism Jul 28, 2023
98b3ae5
include `cudatoolkit` pkgs for notebooks environment
ajschmidt8 Jul 28, 2023
72b2ea0
More review fixes.
harrism Jul 28, 2023
8f23683
Merge branch 'branch-23.08' into feature/projection/python-bindings
harrism Jul 28, 2023
fdb59f9
Merge branch 'feature/projection/python-bindings' of github.com:harri…
harrism Jul 28, 2023
cb9ccab
Add conda recipe
harrism Jul 28, 2023
4536049
wheel test dependencies.
harrism Jul 28, 2023
8e505ec
Fix cupy dependency.
harrism Jul 28, 2023
d8d70da
precommit pyproject
harrism Jul 28, 2023
b90b48a
Make libcuproj cmake actually
harrism Jul 28, 2023
b12afae
geopandas dependency for cuproj python test
harrism Jul 29, 2023
9547138
Add example to libcuproj readme and test it.
harrism Jul 29, 2023
2b5f03c
precommit pyproject
harrism Jul 29, 2023
e4cb408
Don't test for libcuproj.so, don't depend on cudf
harrism Jul 29, 2023
3445a9e
conda test requires cuspatial, cupy, and rmm
harrism Jul 29, 2023
d47f460
Hopefully remove unneeded -lcuproj
harrism Jul 29, 2023
f271157
cuproj::cuproj
harrism Jul 29, 2023
f73e8ee
Re-add gdal install to test_wheel_cuproj.sh
harrism Jul 29, 2023
3c5490d
Specify fiona version for cuproj wheel test, as with cuspatial
harrism Jul 29, 2023
e2511af
Try to get cuspatial dependency for cuproj wheel test
harrism Jul 29, 2023
76c1c84
pre-commit pyproject
harrism Jul 29, 2023
e9f4228
Try cuspatial 23.6.*
harrism Jul 29, 2023
9e9c002
Trying >=23.6.0
harrism Jul 29, 2023
2753be1
Try cuspatial with no version specified
harrism Jul 29, 2023
4bd9e0d
Try installing cuspatial in test_wheel_cuproj.sh
harrism Jul 29, 2023
4e6f382
Try cuspatial-cu12/cu11
harrism Jul 29, 2023
9a67801
Remove cuspatial from test_wheel_cuproj.sh
harrism Jul 29, 2023
6ff898d
Try using apply_wheel_modifications
harrism Jul 29, 2023
b792813
Separate out cuproj python build script
harrism Jul 31, 2023
62f94dd
Single build_python.sh
harrism Aug 1, 2023
361764e
Remove cudf dependency from cuproj
harrism Aug 1, 2023
f1d489b
Permissions
harrism Aug 1, 2023
849a051
Add missing __init__.py
harrism Aug 1, 2023
7ff8115
mamba install cuproj in ci pytest script
harrism Aug 1, 2023
dacfc5f
Install cuproj for notebook tests
harrism Aug 1, 2023
13abb28
Update ci/test_wheel_cuproj.sh
harrism Aug 1, 2023
9b7736b
Move test-only dependencies to test_python_cuproj and name sections m…
harrism Aug 1, 2023
4a459d7
Fix dependencies typo, rerun dependency generator
harrism Aug 1, 2023
3c0cb85
Fix test_python includes
harrism Aug 2, 2023
906b441
Respond to @vyasr reviews
harrism Aug 2, 2023
b0608da
generate conda envs
harrism Aug 2, 2023
448355b
Update benchmark notebook
harrism Aug 2, 2023
f0f0431
Reviews from @isvoid and @bdice
harrism Aug 2, 2023
2fb6292
Merge branch 'branch-23.08' into feature/projection/python-bindings
harrism Aug 2, 2023
73c5c24
Reduce max memory usage in benchmark so that it won't fail CI
harrism Aug 2, 2023
dc4c679
Merge branch 'feature/projection/python-bindings' of github.com:harri…
harrism Aug 2, 2023
e8aa0ee
Merge branch 'branch-23.08' into feature/projection/python-bindings
harrism Aug 2, 2023
c8ee4ac
Merge branch 'branch-23.08' into feature/projection/python-bindings
harrism Aug 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ jobs:
node_type: "gpu-v100-latest-1"
run_script: "ci/build_docs.sh"
sha: ${{ inputs.sha }}
wheel-build:
wheel-build-cuspatial:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-build.yaml@branch-23.08
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
script: ci/build_wheel.sh
wheel-publish:
needs: wheel-build
script: ci/build_wheel_cuspatial.sh
wheel-publish-cuspatial:
needs: wheel-build-cuspatial
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-publish.yaml@branch-23.08
with:
Expand All @@ -85,3 +85,22 @@ jobs:
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
package-name: cuspatial
wheel-build-cuproj:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-build.yaml@branch-23.08
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
script: ci/build_wheel_cuproj.sh
wheel-publish-cuproj:
needs: wheel-build-cuproj
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-publish.yaml@branch-23.08
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
package-name: cuproj
30 changes: 23 additions & 7 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ jobs:
- conda-python-tests
- conda-notebook-tests
- docs-build
- wheel-build
- wheel-tests
- wheel-build-cuspatial
- wheel-tests-cuspatial
- wheel-build-cuproj
- wheel-tests-cuproj
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/pr-builder.yaml@branch-23.08
checks:
Expand Down Expand Up @@ -72,17 +74,31 @@ jobs:
arch: "amd64"
container_image: "rapidsai/ci:latest"
run_script: "ci/build_docs.sh"
wheel-build:
wheel-build-cuspatial:
needs: checks
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-build.yaml@branch-23.08
with:
build_type: pull-request
script: ci/build_wheel.sh
wheel-tests:
needs: wheel-build
script: ci/build_wheel_cuspatial.sh
wheel-tests-cuspatial:
needs: wheel-build-cuspatial
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-test.yaml@branch-23.08
with:
build_type: pull-request
script: ci/test_wheel.sh
script: ci/test_wheel_cuspatial.sh
wheel-build-cuproj:
needs: checks
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-build.yaml@branch-23.08
with:
build_type: pull-request
script: ci/build_wheel_cuproj.sh
wheel-tests-cuproj:
needs: wheel-build-cuproj
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-test.yaml@branch-23.08
with:
build_type: pull-request
script: ci/test_wheel_cuproj.sh
22 changes: 20 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ ARGS=$*
# script, and that this script resides in the repo dir!
REPODIR=$(cd $(dirname $0); pwd)

VALIDARGS="clean libcuspatial cuspatial tests benchmarks -v -g -n -h --allgpuarch --show_depr_warn"
VALIDARGS="clean libcuspatial cuspatial cuproj tests benchmarks -v -g -n -h --allgpuarch --show_depr_warn"
bdice marked this conversation as resolved.
Show resolved Hide resolved
HELP="$0 [clean] [libcuspatial] [cuspatial] [tests] [-v] [-g] [-n] [-h] [-l] [--show_depr_warn] [--cmake-args=\"<args>\"]
clean - remove all existing build artifacts and configuration (start over)
libcuspatial - build the libcuspatial C++ code only
cuspatial - build the cuspatial Python package
cuproj - build the cuproj Python package
tests - build tests
benchmarks - build benchmarks
-v - verbose build mode
Expand All @@ -36,8 +37,10 @@ HELP="$0 [clean] [libcuspatial] [cuspatial] [tests] [-v] [-g] [-n] [-h] [-l] [--
'cuspatial' targets
"
LIBCUSPATIAL_BUILD_DIR=${REPODIR}/cpp/build
LIBCUPROJ_BUILD_DIR=${REPODIR}/cpp/build/cuproj
CUSPATIAL_BUILD_DIR=${REPODIR}/python/cuspatial/_skbuild
BUILD_DIRS="${LIBCUSPATIAL_BUILD_DIR} ${CUSPATIAL_BUILD_DIR}"
CUPROJ_BUILD_DIR=${REPODIR}/python/cuproj/_skbuild
BUILD_DIRS="${LIBCUSPATIAL_BUILD_DIR} ${CUSPATIAL_BUILD_DIR} ${LIBCUPROJ_BUILD_DIR} ${CUPROJ_BUILD_DIR}"

# Set defaults for vars modified by flags to this script
VERBOSE_FLAG=""
Expand Down Expand Up @@ -126,6 +129,11 @@ if [[ "${EXTRA_CMAKE_ARGS}" != *"DFIND_CUSPATIAL_CPP"* ]]; then
EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DFIND_CUSPATIAL_CPP=ON"
fi

# Append `-DFIND_CUPROJ_CPP=ON` to EXTRA_CMAKE_ARGS unless a user specified the option.
if [[ "${EXTRA_CMAKE_ARGS}" != *"DFIND_CUPROJ_CPP"* ]]; then
EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DFIND_CUPROJ_CPP=ON"
fi

# If clean given, run it prior to any other steps
if hasArg clean; then
# If the dirs to clean are mounted dirs in a container, the
Expand Down Expand Up @@ -179,3 +187,13 @@ if (( ${NUMARGS} == 0 )) || hasArg cuspatial; then
python setup.py install --single-version-externally-managed --record=record.txt -- -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_LIBRARY_PATH=${LIBCUSPATIAL_BUILD_DIR} ${EXTRA_CMAKE_ARGS}
fi
fi

# Build and install the cuproj Python package
vyasr marked this conversation as resolved.
Show resolved Hide resolved
if (( ${NUMARGS} == 0 )) || hasArg cuproj; then

cd ${REPODIR}/python/cuproj
python setup.py build_ext -j${PARALLEL_LEVEL:-1} --inplace -- -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_LIBRARY_PATH=${LIBCUPROJ_BUILD_DIR} ${EXTRA_CMAKE_ARGS}
if [[ ${INSTALL_TARGET} != "" ]]; then
python setup.py install --single-version-externally-managed --record=record.txt -- -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_LIBRARY_PATH=${LIBCUPROJ_BUILD_DIR} ${EXTRA_CMAKE_ARGS}
fi
fi
13 changes: 11 additions & 2 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,24 @@ export CMAKE_GENERATOR=Ninja

rapids-print-env

rapids-logger "Begin py build"

CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)

rapids-logger "Begin py build cuSpatial"

# TODO: Remove `--no-test` flag once importing on a CPU
# node works correctly
rapids-mamba-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
conda/recipes/cuspatial

rapids-logger "Begin py build cuProj"

# TODO: Remove `--no-test` flag once importing on a CPU
# node works correctly
rapids-mamba-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
conda/recipes/cuproj

rapids-upload-conda-to-s3 python
26 changes: 26 additions & 0 deletions ci/build_wheel_cuproj.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.

set -euo pipefail

source rapids-configure-sccache
source rapids-date-string

# Use gha-tools rapids-pip-wheel-version to generate wheel version then
# update the necessary files
version_override="$(rapids-pip-wheel-version ${RAPIDS_DATE_STRING})"

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"

ci/release/apply_wheel_modifications.sh ${version_override} "-${RAPIDS_PY_CUDA_SUFFIX}"
echo "The package name and/or version was modified in the package source. The git diff is:"
git diff

cd python/cuproj

SKBUILD_CONFIGURE_OPTIONS="-DCUPROJ_BUILD_WHEELS=ON" python -m pip wheel . -w dist -vvv --no-deps --disable-pip-version-check

mkdir -p final_dist
python -m auditwheel repair -w final_dist dist/*

RAPIDS_PY_WHEEL_NAME="cuproj_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 final_dist
File renamed without changes.
11 changes: 9 additions & 2 deletions ci/release/apply_wheel_modifications.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@ VERSION=${1}
CUDA_SUFFIX=${2}

sed -i "s/^version = .*/version = \"${VERSION}\"/g" python/cuspatial/pyproject.toml

sed -i "s/^name = \"cuspatial\"/name = \"cuspatial${CUDA_SUFFIX}\"/g" python/cuspatial/pyproject.toml

sed -i "s/rmm==/rmm${CUDA_SUFFIX}==/g" python/cuspatial/pyproject.toml
sed -i "s/cudf==/cudf${CUDA_SUFFIX}==/g" python/cuspatial/pyproject.toml

sed -i "s/^version = .*/version = \"${VERSION}\"/g" python/cuproj/pyproject.toml
sed -i "s/^name = \"cuproj\"/name = \"cuproj${CUDA_SUFFIX}\"/g" python/cuproj/pyproject.toml
sed -i "s/rmm==/rmm${CUDA_SUFFIX}==/g" python/cuproj/pyproject.toml
sed -i "s/cuspatial==/cuspatial${CUDA_SUFFIX}==/g" python/cuproj/pyproject.toml

if [[ $CUDA_SUFFIX == "-cu12" ]]; then
sed -i "s/cupy-cuda11x/cupy-cuda12x/g" python/cuproj/pyproject.toml
fi
5 changes: 4 additions & 1 deletion ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,18 @@ function sed_runner() {
sed_runner 's/'"CUSPATIAL VERSION .* LANGUAGES"'/'"CUSPATIAL VERSION ${NEXT_FULL_TAG} LANGUAGES"'/g' cpp/CMakeLists.txt
sed_runner 's/'"CUPROJ VERSION .* LANGUAGES"'/'"CUPROJ VERSION ${NEXT_FULL_TAG} LANGUAGES"'/g' cpp/cuproj/CMakeLists.txt
sed_runner 's/'"cuspatial_version .*)"'/'"cuspatial_version ${NEXT_FULL_TAG})"'/g' python/cuspatial/CMakeLists.txt
sed_runner 's/'"cuproj_version .*)"'/'"cuproj_version ${NEXT_FULL_TAG})"'/g' python/cuproj/CMakeLists.txt

# RTD update
sed_runner 's/version = .*/version = '"'${NEXT_SHORT_TAG}'"'/g' docs/source/conf.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will cuproj have docs that are integrated in the cuSpatial docs? Or will it need to have separate docs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually separated still Todo.

sed_runner 's/release = .*/release = '"'${NEXT_FULL_TAG}'"'/g' docs/source/conf.py

# Python __init__.py updates
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/cuspatial/cuspatial/__init__.py
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/cuproj/cuproj/__init__.py

# rapids-cmake version
sed_runner 's/'"branch-.*\/RAPIDS.cmake"'/'"branch-${NEXT_SHORT_TAG}\/RAPIDS.cmake"'/g' fetch_rapids.cmake
sed_runner 's/'"branch-.*\/RAPIDS.cmake"'/'"branch-${NEXT_SHORT_TAG}\/RAPIDS.cmake"'/g' python/cuspatial/CMakeLists.txt

# Doxyfile update
sed_runner "/PROJECT_NUMBER[ ]*=/ s|=.*|= ${NEXT_FULL_TAG}|g" cpp/doxygen/Doxyfile
Expand Down Expand Up @@ -72,10 +73,12 @@ for DEP in "${DEPENDENCIES[@]}"; do
sed_runner "/-.* ${DEP}==/ s/==.*/==${NEXT_SHORT_TAG_PEP440}.*/g" ${FILE}
done
sed_runner "s/${DEP}==.*\",/${DEP}==${NEXT_SHORT_TAG_PEP440}.*\",/g" python/cuspatial/pyproject.toml
sed_runner "s/${DEP}==.*\",/${DEP}==${NEXT_SHORT_TAG_PEP440}.*\",/g" python/cuproj/pyproject.toml
done

# Version in pyproject.toml
sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG_PEP440}\"/g" python/cuspatial/pyproject.toml
sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG_PEP440}\"/g" python/cuproj/pyproject.toml

# Dependency versions in dependencies.yaml
sed_runner "/-cu[0-9]\{2\}==/ s/==.*/==${NEXT_SHORT_TAG_PEP440}.*/g" dependencies.yaml
2 changes: 1 addition & 1 deletion ci/test_notebooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ PYTHON_CHANNEL=$(rapids-download-conda-from-s3 python)
rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
--channel "${PYTHON_CHANNEL}" \
cuspatial libcuspatial
cuspatial libcuspatial cuproj

NBTEST="$(realpath "$(dirname "$0")/utils/nbtest.sh")"
pushd notebooks
Expand Down
17 changes: 16 additions & 1 deletion ci/test_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ rapids-print-env
rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
--channel "${PYTHON_CHANNEL}" \
libcuspatial cuspatial
libcuspatial cuspatial cuproj

rapids-logger "Check GPU usage"
nvidia-smi
Expand All @@ -58,5 +58,20 @@ pytest \
tests
popd

rapids-logger "pytest cuproj"
pushd python/cuproj/cuproj
# It is essential to cd into python/cuproj/cuproj as `pytest-xdist` + `coverage` seem to work only at this directory level.
pytest \
--cache-clear \
--junitxml="${RAPIDS_TESTS_DIR}/junit-cuproj.xml" \
--numprocesses=8 \
--dist=loadscope \
--cov-config=../.coveragerc \
--cov=cuproj \
--cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cuproj-coverage.xml" \
--cov-report=term \
tests
popd

rapids-logger "Test script exiting with value: $EXITCODE"
exit ${EXITCODE}
22 changes: 22 additions & 0 deletions ci/test_wheel_cuproj.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.

set -eou pipefail

mkdir -p ./dist
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
RAPIDS_PY_WHEEL_NAME="cuproj_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./dist

# Install additional dependencies
apt update
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends libgdal-dev
harrism marked this conversation as resolved.
Show resolved Hide resolved
python -m pip install --no-binary fiona 'fiona>=1.8.19,<1.9'
harrism marked this conversation as resolved.
Show resolved Hide resolved

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

if [[ "$(arch)" == "aarch64" && ${RAPIDS_BUILD_TYPE} == "pull-request" ]]; then
python ./ci/wheel_smoke_test_cuproj.py
else
python -m pytest -n 8 ./python/cuproj/cuproj/tests
fi
2 changes: 1 addition & 1 deletion ci/test_wheel.sh → ci/test_wheel_cuspatial.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ python -m pip install --no-binary fiona 'fiona>=1.8.19,<1.9'
python -m pip install $(echo ./dist/cuspatial*.whl)[test]

if [[ "$(arch)" == "aarch64" && ${RAPIDS_BUILD_TYPE} == "pull-request" ]]; then
python ./ci/wheel_smoke_test.py
python ./ci/wheel_smoke_test_cuspatial.py
else
python -m pytest -n 8 ./python/cuspatial/cuspatial/tests
fi
17 changes: 17 additions & 0 deletions ci/wheel_smoke_test_cuproj.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2023, NVIDIA CORPORATION.

from cuproj import Transformer as cuTransformer

from cupy.testing import assert_allclose

if __name__ == '__main__':
# Sydney opera house latitude and longitude
lat = -33.8587
lon = 151.2140

# Transform to UTM using cuproj
cu_transformer = cuTransformer.from_crs("epsg:4326", "EPSG:32756")
cuproj_x, cuproj_y = cu_transformer.transform(lat, lon)

assert_allclose(cuproj_x, 334783.9544807102)
assert_allclose(cuproj_y, 6252075.961741454)
File renamed without changes.
2 changes: 2 additions & 0 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ dependencies:
- cudatoolkit
- cudf==23.8.*
- cuml==23.8.*
- cupy>=12.0.0
- cuspatial==23.8.*
- cxx-compiler
- cython>=0.29,<0.30
- doxygen
Expand Down
2 changes: 2 additions & 0 deletions conda/environments/all_cuda-120_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ dependencies:
- cuda-version=12.0
- cudf==23.8.*
- cuml==23.8.*
- cupy>=12.0.0
- cuspatial==23.8.*
- cxx-compiler
- cython>=0.29,<0.30
- doxygen
Expand Down
4 changes: 4 additions & 0 deletions conda/recipes/cuproj/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2023, NVIDIA CORPORATION.

# This assumes the script is executed from the root of the repo directory
./build.sh cuproj
17 changes: 17 additions & 0 deletions conda/recipes/cuproj/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
c_compiler_version:
- 11

cxx_compiler_version:
- 11

cuda_compiler:
- cuda-nvcc

cuda11_compiler:
- nvcc

sysroot_version:
- "2.17"

cmake_version:
- ">=3.26.4"
Loading