Skip to content

Commit

Permalink
Rename cugraph-nx to nx-cugraph (rapidsai#3840)
Browse files Browse the repository at this point in the history
We decided to rename `cugraph-nx` to `nx-cugraph` to follow (and help establish) conventions for names of networkx backends. See: networkx/networkx#6883

This PR was created from the following commands:
```sh
mv notebooks/ ../notebooks-bak
find * -type f -print0 | xargs -0 sed -i 's/cugraph_nx/nx_cugraph/g'
find * -type f -print0 | xargs -0 sed -i 's/cugraph-nx/nx-cugraph/g'
git mv ./conda/recipes/cugraph-nx ./conda/recipes/nx-cugraph
git mv ./python/cugraph-nx ./python/nx-cugraph
git mv ./python/nx-cugraph/cugraph_nx ./python/nx-cugraph/nx_cugraph
mv ../notebooks-bak/ notebooks
```
(a more reliable bash script would ensure the destination of `git mv` does not exist yet, b/c if the destination is a directory, it will happily--and incorrectly--move the target _into_ the directory)
```sh
# Make sure everything got renamed correctly
git grep -i 'cugraph.nx'
find . -iname '*cugraph*nx*' -print
```
Should we remove `cugraph-nx` nightlies once this is merged?

Authors:
  - Erik Welch (https://github.com/eriknw)

Approvers:
  - Rick Ratzel (https://github.com/rlratzel)
  - Ray Douglass (https://github.com/raydouglass)

URL: rapidsai#3840
  • Loading branch information
eriknw authored Sep 6, 2023
1 parent 5b5001a commit b27d99f
Show file tree
Hide file tree
Showing 39 changed files with 361 additions and 336 deletions.
14 changes: 7 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ VALIDARGS="
cpp-mgtests
cugraph-pyg
cugraph-dgl
cugraph-nx
nx-cugraph
docs
-v
-g
Expand All @@ -54,7 +54,7 @@ HELP="$0 [<target> ...] [<flag> ...]
pylibcugraph - build the pylibcugraph Python package
cugraph-pyg - build the cugraph-pyg Python package
cugraph - build the cugraph Python package
cugraph-nx - build the cugraph-nx Python package
nx-cugraph - build the nx-cugraph Python package
cugraph-service - build the cugraph-service_client and cugraph-service_server Python package
cpp-mgtests - build libcugraph and libcugraph_etl MG tests. Builds MPI communicator, adding MPI as a dependency.
cugraph-dgl - build the cugraph-dgl extensions for DGL
Expand Down Expand Up @@ -209,7 +209,7 @@ if hasArg uninstall; then
# removes the latest one and leaves the others installed. build.sh uninstall
# can be run multiple times to remove all of them, but that is not obvious.
pip uninstall -y pylibcugraph cugraph cugraph-service-client cugraph-service-server \
cugraph-dgl cugraph-pyg cugraph-nx
cugraph-dgl cugraph-pyg nx-cugraph
fi

if hasArg clean; then
Expand Down Expand Up @@ -382,12 +382,12 @@ if hasArg cugraph-dgl; then
fi
fi

# Build and install the cugraph-nx Python package
if hasArg cugraph-nx; then
# Build and install the nx-cugraph Python package
if hasArg nx-cugraph; then
if hasArg --clean; then
cleanPythonDir ${REPODIR}/python/cugraph-nx
cleanPythonDir ${REPODIR}/python/nx-cugraph
else
python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/cugraph-nx
python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/nx-cugraph
fi
fi

Expand Down
4 changes: 2 additions & 2 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ rapids-mamba-retry mambabuild \
--channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \
conda/recipes/cugraph

# NOTE: nothing in cugraph-nx is CUDA-specific, but it is built on each CUDA
# NOTE: nothing in nx-cugraph is CUDA-specific, but it is built on each CUDA
# platform to ensure it is included in each set of artifacts, since test
# scripts only install from one set of artifacts based on the CUDA version used
# for the test run.
rapids-mamba-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
--channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \
conda/recipes/cugraph-nx
conda/recipes/nx-cugraph

# NOTE: nothing in the cugraph-service packages are CUDA-specific, but they are
# built on each CUDA platform to ensure they are included in each set of
Expand Down
4 changes: 2 additions & 2 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/cugr
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/cugraph-service/client/cugraph_service_client/__init__.py
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/cugraph-service/server/cugraph_service_server/__init__.py
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/pylibcugraph/pylibcugraph/__init__.py
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/cugraph-nx/cugraph_nx/__init__.py
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/nx-cugraph/nx_cugraph/__init__.py

# Python pyproject.toml updates
sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/cugraph/pyproject.toml
Expand All @@ -70,7 +70,7 @@ sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/cugraph-pyg
sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/cugraph-service/client/pyproject.toml
sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/cugraph-service/server/pyproject.toml
sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/pylibcugraph/pyproject.toml
sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/cugraph-nx/pyproject.toml
sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/nx-cugraph/pyproject.toml

# Wheel testing script
sed_runner "s/branch-.*/branch-${NEXT_SHORT_TAG}/g" ci/test_wheel_cugraph.sh
Expand Down
20 changes: 10 additions & 10 deletions ci/test_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ rapids-mamba-retry install \
libcugraph \
pylibcugraph \
cugraph \
cugraph-nx \
nx-cugraph \
cugraph-service-server \
cugraph-service-client

Expand Down Expand Up @@ -93,28 +93,28 @@ pytest \
cugraph/pytest-based/bench_algos.py
popd

rapids-logger "pytest cugraph-nx"
pushd python/cugraph-nx/cugraph_nx
rapids-logger "pytest nx-cugraph"
pushd python/nx-cugraph/nx_cugraph
pytest \
--capture=no \
--verbose \
--cache-clear \
--junitxml="${RAPIDS_TESTS_DIR}/junit-cugraph-nx.xml" \
--junitxml="${RAPIDS_TESTS_DIR}/junit-nx-cugraph.xml" \
--cov-config=../../.coveragerc \
--cov=cugraph_nx \
--cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cugraph-nx-coverage.xml" \
--cov=nx_cugraph \
--cov-report=xml:"${RAPIDS_COVERAGE_DIR}/nx-cugraph-coverage.xml" \
--cov-report=term \
--benchmark-disable \
tests
popd

rapids-logger "pytest networkx using cugraph-nx backend"
pushd python/cugraph-nx
rapids-logger "pytest networkx using nx-cugraph backend"
pushd python/nx-cugraph
./run_nx_tests.sh
# run_nx_tests.sh outputs coverage data, so check that total coverage is >0.0%
# in case cugraph-nx failed to load but fallback mode allowed the run to pass.
# in case nx-cugraph failed to load but fallback mode allowed the run to pass.
_coverage=$(coverage report|grep "^TOTAL")
echo "cugraph-nx coverage from networkx tests: $_coverage"
echo "nx-cugraph coverage from networkx tests: $_coverage"
echo $_coverage | awk '{ if ($NF == "0.0%") exit 1 }'
popd

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

# This assumes the script is executed from the root of the repo directory

./build.sh cugraph-nx
./build.sh nx-cugraph
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% set date_string = environ['RAPIDS_DATE_STRING'] %}

package:
name: cugraph-nx
name: nx-cugraph
version: {{ version }}

source:
Expand All @@ -29,7 +29,7 @@ requirements:

tests:
imports:
- cugraph_nx
- nx_cugraph
commands:
- pip check
requires:
Expand Down
26 changes: 13 additions & 13 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ files:
- python_build_cythonize
- python_run_cugraph
- python_run_pylibcugraph
- python_run_cugraph_nx
- python_run_nx_cugraph
- python_run_cugraph_dgl
- python_run_cugraph_pyg
- test_notebook
- test_python_common
- test_python_cugraph
- test_python_pylibcugraph
- test_python_cugraph_nx
- test_python_nx_cugraph
checks:
output: none
includes:
Expand Down Expand Up @@ -105,29 +105,29 @@ files:
includes:
- test_python_common
- test_python_pylibcugraph
py_build_cugraph_nx:
py_build_nx_cugraph:
output: pyproject
pyproject_dir: python/cugraph-nx
pyproject_dir: python/nx-cugraph
extras:
table: build-system
includes:
- python_build_wheel
py_run_cugraph_nx:
py_run_nx_cugraph:
output: pyproject
pyproject_dir: python/cugraph-nx
pyproject_dir: python/nx-cugraph
extras:
table: project
includes:
- python_run_cugraph_nx
py_test_cugraph_nx:
- python_run_nx_cugraph
py_test_nx_cugraph:
output: pyproject
pyproject_dir: python/cugraph-nx
pyproject_dir: python/nx-cugraph
extras:
table: project.optional-dependencies
key: test
includes:
- test_python_common
- test_python_cugraph_nx
- test_python_nx_cugraph
py_build_cugraph_dgl:
output: pyproject
pyproject_dir: python/cugraph-dgl
Expand Down Expand Up @@ -375,7 +375,7 @@ dependencies:
packages:
- *pylibraft
- *rmm
python_run_cugraph_nx:
python_run_nx_cugraph:
common:
- output_types: [conda, pyproject]
packages:
Expand Down Expand Up @@ -482,12 +482,12 @@ dependencies:
packages:
- *cudf
- *numpy
test_python_cugraph_nx:
test_python_nx_cugraph:
common:
- output_types: [conda, pyproject]
packages:
- packaging>=21
# not needed by cugraph-nx tests, but is required for running networkx tests
# not needed by nx-cugraph tests, but is required for running networkx tests
- pytest-mpl
cugraph_dgl_dev:
common:
Expand Down
2 changes: 1 addition & 1 deletion docs/cugraph/source/installation/source_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ build.sh [<target> ...] [<flag> ...]
libcugraph_etl - build libcugraph_etl.so and SG test binaries
pylibcugraph - build the pylibcugraph Python package
cugraph - build the cugraph Python package
cugraph-nx - build the cugraph-nx Python package
nx-cugraph - build the nx-cugraph Python package
cugraph-service - build the cugraph-service_client and cugraph-service_server Python package
cpp-mgtests - build libcugraph and libcugraph_etl MG tests. Builds MPI communicator, adding MPI as a dependency.
cugraph-dgl - build the cugraph-dgl extensions for DGL
Expand Down
Loading

0 comments on commit b27d99f

Please sign in to comment.