diff --git a/.flake8 b/.flake8 index 0e2591353..cdda8d108 100644 --- a/.flake8 +++ b/.flake8 @@ -1,25 +1,15 @@ -# Copyright (c) 2022-2024, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. [flake8] -filename = *.py, *.pyx, *.pxd, *.pxi -exclude = __init__.py, *.egg, build, docs, .git -force-check = True max-line-length = 88 -ignore = - # line break before binary operator - W503, - # whitespace before : - E203 +inline-quotes = " +extend-ignore = + B020, + E203, + SIM105, + SIM401, +# E203 whitespace before ':' (to be compatible with black) per-file-ignores = - # Rules ignored only in Cython: - # E211: whitespace before '(' (used in multi-line imports) - # E225: Missing whitespace around operators (breaks cython casting syntax like ) - # E226: Missing whitespace around arithmetic operators (breaks cython pointer syntax like int*) - # E227: Missing whitespace around bitwise or shift operator (Can also break casting syntax) - # E275: Missing whitespace after keyword (Doesn't work with Cython except?) - # E402: invalid syntax (works for Python, not Cython) - # E999: invalid syntax (works for Python, not Cython) - # W504: line break after binary operator (breaks lines that end with a pointer) - *.pyx: E211, E225, E226, E227, E275, E402, E999, W504 - *.pxd: E211, E225, E226, E227, E275, E402, E999, W504 - *.pxi: E211, E225, E226, E227, E275, E402, E999, W504 + nx_cugraph/tests/*.py:T201, + __init__.py:F401,F403, + _nx_cugraph/__init__.py:E501, diff --git a/python/Makefile b/Makefile similarity index 100% rename from python/Makefile rename to Makefile diff --git a/README.md b/README.md index 458421e2b..c3ca0b880 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ to run supported algorithms with GPU acceleration. nx-cugraph requires the following: * NVIDIA GPU, Volta architecture or later, with [compute capability](https://developer.nvidia.com/cuda-gpus) 7.0+ - * CUDA 11.2, 11.4, 11.5, 11.8, or 12.0 - * Python version 3.9, 3.10, or 3.11 + * CUDA 11.2, 11.4, 11.5, 11.8, 12.0, 12.2, or 12.5 + * Python version 3.10, 3.11, or 3.12 * NetworkX >= version 3.0 (version 3.2 or higher recommended) More details about system requirements can be found in the [RAPIDS System Requirements documentation](https://docs.rapids.ai/install#system-req). diff --git a/python/_nx_cugraph/VERSION b/_nx_cugraph/VERSION similarity index 100% rename from python/_nx_cugraph/VERSION rename to _nx_cugraph/VERSION diff --git a/python/_nx_cugraph/__init__.py b/_nx_cugraph/__init__.py similarity index 100% rename from python/_nx_cugraph/__init__.py rename to _nx_cugraph/__init__.py diff --git a/python/_nx_cugraph/_version.py b/_nx_cugraph/_version.py similarity index 100% rename from python/_nx_cugraph/_version.py rename to _nx_cugraph/_version.py diff --git a/python/_nx_cugraph/core.py b/_nx_cugraph/core.py similarity index 100% rename from python/_nx_cugraph/core.py rename to _nx_cugraph/core.py diff --git a/python/conftest.py b/conftest.py similarity index 100% rename from python/conftest.py rename to conftest.py diff --git a/lint.yaml b/lint.yaml index ce46360e2..dab2ea70e 100644 --- a/lint.yaml +++ b/lint.yaml @@ -26,7 +26,7 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.18 + rev: v0.19 hooks: - id: validate-pyproject name: Validate pyproject.toml @@ -40,29 +40,29 @@ repos: hooks: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: v3.16.0 + rev: v3.17.0 hooks: - id: pyupgrade - args: [--py39-plus] + args: [--py310-plus] - repo: https://github.com/psf/black - rev: 24.4.2 + rev: 24.8.0 hooks: - id: black # - id: black-jupyter - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.4 + rev: v0.6.7 hooks: - id: ruff args: [--fix-only, --show-fixes] # --unsafe-fixes] - repo: https://github.com/PyCQA/flake8 - rev: 7.1.0 + rev: 7.1.1 hooks: - id: flake8 args: ['--per-file-ignores=_nx_cugraph/__init__.py:E501', '--extend-ignore=B020,SIM105'] # Why is this necessary? additional_dependencies: &flake8_dependencies # These versions need updated manually - - flake8==7.1.0 - - flake8-bugbear==24.4.26 + - flake8==7.1.1 + - flake8-bugbear==24.8.19 - flake8-simplify==0.21.0 - repo: https://github.com/asottile/yesqa rev: v1.5.0 @@ -77,7 +77,7 @@ repos: additional_dependencies: [tomli] files: ^(nx_cugraph|docs)/ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.4 + rev: v0.6.7 hooks: - id: ruff - repo: https://github.com/pre-commit/pre-commit-hooks diff --git a/python/nx_cugraph/__init__.py b/nx_cugraph/__init__.py similarity index 100% rename from python/nx_cugraph/__init__.py rename to nx_cugraph/__init__.py diff --git a/python/nx_cugraph/algorithms/__init__.py b/nx_cugraph/algorithms/__init__.py similarity index 100% rename from python/nx_cugraph/algorithms/__init__.py rename to nx_cugraph/algorithms/__init__.py diff --git a/python/nx_cugraph/algorithms/bipartite/__init__.py b/nx_cugraph/algorithms/bipartite/__init__.py similarity index 100% rename from python/nx_cugraph/algorithms/bipartite/__init__.py rename to nx_cugraph/algorithms/bipartite/__init__.py diff --git a/python/nx_cugraph/algorithms/bipartite/generators.py b/nx_cugraph/algorithms/bipartite/generators.py similarity index 100% rename from python/nx_cugraph/algorithms/bipartite/generators.py rename to nx_cugraph/algorithms/bipartite/generators.py diff --git a/python/nx_cugraph/algorithms/centrality/__init__.py b/nx_cugraph/algorithms/centrality/__init__.py similarity index 100% rename from python/nx_cugraph/algorithms/centrality/__init__.py rename to nx_cugraph/algorithms/centrality/__init__.py diff --git a/python/nx_cugraph/algorithms/centrality/betweenness.py b/nx_cugraph/algorithms/centrality/betweenness.py similarity index 100% rename from python/nx_cugraph/algorithms/centrality/betweenness.py rename to nx_cugraph/algorithms/centrality/betweenness.py diff --git a/python/nx_cugraph/algorithms/centrality/degree_alg.py b/nx_cugraph/algorithms/centrality/degree_alg.py similarity index 100% rename from python/nx_cugraph/algorithms/centrality/degree_alg.py rename to nx_cugraph/algorithms/centrality/degree_alg.py diff --git a/python/nx_cugraph/algorithms/centrality/eigenvector.py b/nx_cugraph/algorithms/centrality/eigenvector.py similarity index 100% rename from python/nx_cugraph/algorithms/centrality/eigenvector.py rename to nx_cugraph/algorithms/centrality/eigenvector.py diff --git a/python/nx_cugraph/algorithms/centrality/katz.py b/nx_cugraph/algorithms/centrality/katz.py similarity index 100% rename from python/nx_cugraph/algorithms/centrality/katz.py rename to nx_cugraph/algorithms/centrality/katz.py diff --git a/python/nx_cugraph/algorithms/cluster.py b/nx_cugraph/algorithms/cluster.py similarity index 100% rename from python/nx_cugraph/algorithms/cluster.py rename to nx_cugraph/algorithms/cluster.py diff --git a/python/nx_cugraph/algorithms/community/__init__.py b/nx_cugraph/algorithms/community/__init__.py similarity index 100% rename from python/nx_cugraph/algorithms/community/__init__.py rename to nx_cugraph/algorithms/community/__init__.py diff --git a/python/nx_cugraph/algorithms/community/louvain.py b/nx_cugraph/algorithms/community/louvain.py similarity index 100% rename from python/nx_cugraph/algorithms/community/louvain.py rename to nx_cugraph/algorithms/community/louvain.py diff --git a/python/nx_cugraph/algorithms/components/__init__.py b/nx_cugraph/algorithms/components/__init__.py similarity index 100% rename from python/nx_cugraph/algorithms/components/__init__.py rename to nx_cugraph/algorithms/components/__init__.py diff --git a/python/nx_cugraph/algorithms/components/connected.py b/nx_cugraph/algorithms/components/connected.py similarity index 100% rename from python/nx_cugraph/algorithms/components/connected.py rename to nx_cugraph/algorithms/components/connected.py diff --git a/python/nx_cugraph/algorithms/components/strongly_connected.py b/nx_cugraph/algorithms/components/strongly_connected.py similarity index 100% rename from python/nx_cugraph/algorithms/components/strongly_connected.py rename to nx_cugraph/algorithms/components/strongly_connected.py diff --git a/python/nx_cugraph/algorithms/components/weakly_connected.py b/nx_cugraph/algorithms/components/weakly_connected.py similarity index 100% rename from python/nx_cugraph/algorithms/components/weakly_connected.py rename to nx_cugraph/algorithms/components/weakly_connected.py diff --git a/python/nx_cugraph/algorithms/core.py b/nx_cugraph/algorithms/core.py similarity index 100% rename from python/nx_cugraph/algorithms/core.py rename to nx_cugraph/algorithms/core.py diff --git a/python/nx_cugraph/algorithms/dag.py b/nx_cugraph/algorithms/dag.py similarity index 100% rename from python/nx_cugraph/algorithms/dag.py rename to nx_cugraph/algorithms/dag.py diff --git a/python/nx_cugraph/algorithms/isolate.py b/nx_cugraph/algorithms/isolate.py similarity index 100% rename from python/nx_cugraph/algorithms/isolate.py rename to nx_cugraph/algorithms/isolate.py diff --git a/python/nx_cugraph/algorithms/link_analysis/__init__.py b/nx_cugraph/algorithms/link_analysis/__init__.py similarity index 100% rename from python/nx_cugraph/algorithms/link_analysis/__init__.py rename to nx_cugraph/algorithms/link_analysis/__init__.py diff --git a/python/nx_cugraph/algorithms/link_analysis/hits_alg.py b/nx_cugraph/algorithms/link_analysis/hits_alg.py similarity index 100% rename from python/nx_cugraph/algorithms/link_analysis/hits_alg.py rename to nx_cugraph/algorithms/link_analysis/hits_alg.py diff --git a/python/nx_cugraph/algorithms/link_analysis/pagerank_alg.py b/nx_cugraph/algorithms/link_analysis/pagerank_alg.py similarity index 100% rename from python/nx_cugraph/algorithms/link_analysis/pagerank_alg.py rename to nx_cugraph/algorithms/link_analysis/pagerank_alg.py diff --git a/python/nx_cugraph/algorithms/operators/__init__.py b/nx_cugraph/algorithms/operators/__init__.py similarity index 100% rename from python/nx_cugraph/algorithms/operators/__init__.py rename to nx_cugraph/algorithms/operators/__init__.py diff --git a/python/nx_cugraph/algorithms/operators/unary.py b/nx_cugraph/algorithms/operators/unary.py similarity index 100% rename from python/nx_cugraph/algorithms/operators/unary.py rename to nx_cugraph/algorithms/operators/unary.py diff --git a/python/nx_cugraph/algorithms/reciprocity.py b/nx_cugraph/algorithms/reciprocity.py similarity index 100% rename from python/nx_cugraph/algorithms/reciprocity.py rename to nx_cugraph/algorithms/reciprocity.py diff --git a/python/nx_cugraph/algorithms/shortest_paths/__init__.py b/nx_cugraph/algorithms/shortest_paths/__init__.py similarity index 100% rename from python/nx_cugraph/algorithms/shortest_paths/__init__.py rename to nx_cugraph/algorithms/shortest_paths/__init__.py diff --git a/python/nx_cugraph/algorithms/shortest_paths/generic.py b/nx_cugraph/algorithms/shortest_paths/generic.py similarity index 100% rename from python/nx_cugraph/algorithms/shortest_paths/generic.py rename to nx_cugraph/algorithms/shortest_paths/generic.py diff --git a/python/nx_cugraph/algorithms/shortest_paths/unweighted.py b/nx_cugraph/algorithms/shortest_paths/unweighted.py similarity index 100% rename from python/nx_cugraph/algorithms/shortest_paths/unweighted.py rename to nx_cugraph/algorithms/shortest_paths/unweighted.py diff --git a/python/nx_cugraph/algorithms/shortest_paths/weighted.py b/nx_cugraph/algorithms/shortest_paths/weighted.py similarity index 100% rename from python/nx_cugraph/algorithms/shortest_paths/weighted.py rename to nx_cugraph/algorithms/shortest_paths/weighted.py diff --git a/python/nx_cugraph/algorithms/traversal/__init__.py b/nx_cugraph/algorithms/traversal/__init__.py similarity index 100% rename from python/nx_cugraph/algorithms/traversal/__init__.py rename to nx_cugraph/algorithms/traversal/__init__.py diff --git a/python/nx_cugraph/algorithms/traversal/breadth_first_search.py b/nx_cugraph/algorithms/traversal/breadth_first_search.py similarity index 100% rename from python/nx_cugraph/algorithms/traversal/breadth_first_search.py rename to nx_cugraph/algorithms/traversal/breadth_first_search.py diff --git a/python/nx_cugraph/algorithms/tree/__init__.py b/nx_cugraph/algorithms/tree/__init__.py similarity index 100% rename from python/nx_cugraph/algorithms/tree/__init__.py rename to nx_cugraph/algorithms/tree/__init__.py diff --git a/python/nx_cugraph/algorithms/tree/recognition.py b/nx_cugraph/algorithms/tree/recognition.py similarity index 100% rename from python/nx_cugraph/algorithms/tree/recognition.py rename to nx_cugraph/algorithms/tree/recognition.py diff --git a/python/nx_cugraph/classes/__init__.py b/nx_cugraph/classes/__init__.py similarity index 100% rename from python/nx_cugraph/classes/__init__.py rename to nx_cugraph/classes/__init__.py diff --git a/python/nx_cugraph/classes/digraph.py b/nx_cugraph/classes/digraph.py similarity index 100% rename from python/nx_cugraph/classes/digraph.py rename to nx_cugraph/classes/digraph.py diff --git a/python/nx_cugraph/classes/function.py b/nx_cugraph/classes/function.py similarity index 100% rename from python/nx_cugraph/classes/function.py rename to nx_cugraph/classes/function.py diff --git a/python/nx_cugraph/classes/graph.py b/nx_cugraph/classes/graph.py similarity index 100% rename from python/nx_cugraph/classes/graph.py rename to nx_cugraph/classes/graph.py diff --git a/python/nx_cugraph/classes/multidigraph.py b/nx_cugraph/classes/multidigraph.py similarity index 100% rename from python/nx_cugraph/classes/multidigraph.py rename to nx_cugraph/classes/multidigraph.py diff --git a/python/nx_cugraph/classes/multigraph.py b/nx_cugraph/classes/multigraph.py similarity index 100% rename from python/nx_cugraph/classes/multigraph.py rename to nx_cugraph/classes/multigraph.py diff --git a/python/nx_cugraph/convert.py b/nx_cugraph/convert.py similarity index 100% rename from python/nx_cugraph/convert.py rename to nx_cugraph/convert.py diff --git a/python/nx_cugraph/convert_matrix.py b/nx_cugraph/convert_matrix.py similarity index 100% rename from python/nx_cugraph/convert_matrix.py rename to nx_cugraph/convert_matrix.py diff --git a/python/nx_cugraph/generators/__init__.py b/nx_cugraph/generators/__init__.py similarity index 100% rename from python/nx_cugraph/generators/__init__.py rename to nx_cugraph/generators/__init__.py diff --git a/python/nx_cugraph/generators/_utils.py b/nx_cugraph/generators/_utils.py similarity index 100% rename from python/nx_cugraph/generators/_utils.py rename to nx_cugraph/generators/_utils.py diff --git a/python/nx_cugraph/generators/classic.py b/nx_cugraph/generators/classic.py similarity index 100% rename from python/nx_cugraph/generators/classic.py rename to nx_cugraph/generators/classic.py diff --git a/python/nx_cugraph/generators/community.py b/nx_cugraph/generators/community.py similarity index 100% rename from python/nx_cugraph/generators/community.py rename to nx_cugraph/generators/community.py diff --git a/python/nx_cugraph/generators/ego.py b/nx_cugraph/generators/ego.py similarity index 100% rename from python/nx_cugraph/generators/ego.py rename to nx_cugraph/generators/ego.py diff --git a/python/nx_cugraph/generators/small.py b/nx_cugraph/generators/small.py similarity index 100% rename from python/nx_cugraph/generators/small.py rename to nx_cugraph/generators/small.py diff --git a/python/nx_cugraph/generators/social.py b/nx_cugraph/generators/social.py similarity index 100% rename from python/nx_cugraph/generators/social.py rename to nx_cugraph/generators/social.py diff --git a/python/nx_cugraph/interface.py b/nx_cugraph/interface.py similarity index 100% rename from python/nx_cugraph/interface.py rename to nx_cugraph/interface.py diff --git a/python/nx_cugraph/relabel.py b/nx_cugraph/relabel.py similarity index 100% rename from python/nx_cugraph/relabel.py rename to nx_cugraph/relabel.py diff --git a/python/nx_cugraph/scripts/__init__.py b/nx_cugraph/scripts/__init__.py similarity index 100% rename from python/nx_cugraph/scripts/__init__.py rename to nx_cugraph/scripts/__init__.py diff --git a/python/nx_cugraph/scripts/__main__.py b/nx_cugraph/scripts/__main__.py similarity index 100% rename from python/nx_cugraph/scripts/__main__.py rename to nx_cugraph/scripts/__main__.py diff --git a/python/nx_cugraph/scripts/print_table.py b/nx_cugraph/scripts/print_table.py similarity index 100% rename from python/nx_cugraph/scripts/print_table.py rename to nx_cugraph/scripts/print_table.py diff --git a/python/nx_cugraph/scripts/print_tree.py b/nx_cugraph/scripts/print_tree.py similarity index 100% rename from python/nx_cugraph/scripts/print_tree.py rename to nx_cugraph/scripts/print_tree.py diff --git a/python/nx_cugraph/tests/__init__.py b/nx_cugraph/tests/__init__.py similarity index 100% rename from python/nx_cugraph/tests/__init__.py rename to nx_cugraph/tests/__init__.py diff --git a/python/nx_cugraph/tests/bench_convert.py b/nx_cugraph/tests/bench_convert.py similarity index 100% rename from python/nx_cugraph/tests/bench_convert.py rename to nx_cugraph/tests/bench_convert.py diff --git a/python/nx_cugraph/tests/conftest.py b/nx_cugraph/tests/conftest.py similarity index 100% rename from python/nx_cugraph/tests/conftest.py rename to nx_cugraph/tests/conftest.py diff --git a/python/nx_cugraph/tests/ensure_algos_covered.py b/nx_cugraph/tests/ensure_algos_covered.py similarity index 100% rename from python/nx_cugraph/tests/ensure_algos_covered.py rename to nx_cugraph/tests/ensure_algos_covered.py diff --git a/python/nx_cugraph/tests/pytest.ini b/nx_cugraph/tests/pytest.ini similarity index 100% rename from python/nx_cugraph/tests/pytest.ini rename to nx_cugraph/tests/pytest.ini diff --git a/python/nx_cugraph/tests/test_bfs.py b/nx_cugraph/tests/test_bfs.py similarity index 100% rename from python/nx_cugraph/tests/test_bfs.py rename to nx_cugraph/tests/test_bfs.py diff --git a/python/nx_cugraph/tests/test_classes.py b/nx_cugraph/tests/test_classes.py similarity index 100% rename from python/nx_cugraph/tests/test_classes.py rename to nx_cugraph/tests/test_classes.py diff --git a/python/nx_cugraph/tests/test_classes_function.py b/nx_cugraph/tests/test_classes_function.py similarity index 100% rename from python/nx_cugraph/tests/test_classes_function.py rename to nx_cugraph/tests/test_classes_function.py diff --git a/python/nx_cugraph/tests/test_cluster.py b/nx_cugraph/tests/test_cluster.py similarity index 100% rename from python/nx_cugraph/tests/test_cluster.py rename to nx_cugraph/tests/test_cluster.py diff --git a/python/nx_cugraph/tests/test_community.py b/nx_cugraph/tests/test_community.py similarity index 100% rename from python/nx_cugraph/tests/test_community.py rename to nx_cugraph/tests/test_community.py diff --git a/python/nx_cugraph/tests/test_connected.py b/nx_cugraph/tests/test_connected.py similarity index 100% rename from python/nx_cugraph/tests/test_connected.py rename to nx_cugraph/tests/test_connected.py diff --git a/python/nx_cugraph/tests/test_convert.py b/nx_cugraph/tests/test_convert.py similarity index 100% rename from python/nx_cugraph/tests/test_convert.py rename to nx_cugraph/tests/test_convert.py diff --git a/python/nx_cugraph/tests/test_convert_matrix.py b/nx_cugraph/tests/test_convert_matrix.py similarity index 100% rename from python/nx_cugraph/tests/test_convert_matrix.py rename to nx_cugraph/tests/test_convert_matrix.py diff --git a/python/nx_cugraph/tests/test_ego_graph.py b/nx_cugraph/tests/test_ego_graph.py similarity index 100% rename from python/nx_cugraph/tests/test_ego_graph.py rename to nx_cugraph/tests/test_ego_graph.py diff --git a/python/nx_cugraph/tests/test_generators.py b/nx_cugraph/tests/test_generators.py similarity index 100% rename from python/nx_cugraph/tests/test_generators.py rename to nx_cugraph/tests/test_generators.py diff --git a/python/nx_cugraph/tests/test_graph_methods.py b/nx_cugraph/tests/test_graph_methods.py similarity index 100% rename from python/nx_cugraph/tests/test_graph_methods.py rename to nx_cugraph/tests/test_graph_methods.py diff --git a/python/nx_cugraph/tests/test_ktruss.py b/nx_cugraph/tests/test_ktruss.py similarity index 100% rename from python/nx_cugraph/tests/test_ktruss.py rename to nx_cugraph/tests/test_ktruss.py diff --git a/python/nx_cugraph/tests/test_match_api.py b/nx_cugraph/tests/test_match_api.py similarity index 100% rename from python/nx_cugraph/tests/test_match_api.py rename to nx_cugraph/tests/test_match_api.py diff --git a/python/nx_cugraph/tests/test_multigraph.py b/nx_cugraph/tests/test_multigraph.py similarity index 100% rename from python/nx_cugraph/tests/test_multigraph.py rename to nx_cugraph/tests/test_multigraph.py diff --git a/python/nx_cugraph/tests/test_pagerank.py b/nx_cugraph/tests/test_pagerank.py similarity index 100% rename from python/nx_cugraph/tests/test_pagerank.py rename to nx_cugraph/tests/test_pagerank.py diff --git a/python/nx_cugraph/tests/test_relabel.py b/nx_cugraph/tests/test_relabel.py similarity index 100% rename from python/nx_cugraph/tests/test_relabel.py rename to nx_cugraph/tests/test_relabel.py diff --git a/python/nx_cugraph/tests/test_utils.py b/nx_cugraph/tests/test_utils.py similarity index 100% rename from python/nx_cugraph/tests/test_utils.py rename to nx_cugraph/tests/test_utils.py diff --git a/python/nx_cugraph/tests/test_version.py b/nx_cugraph/tests/test_version.py similarity index 100% rename from python/nx_cugraph/tests/test_version.py rename to nx_cugraph/tests/test_version.py diff --git a/python/nx_cugraph/tests/testing_utils.py b/nx_cugraph/tests/testing_utils.py similarity index 100% rename from python/nx_cugraph/tests/testing_utils.py rename to nx_cugraph/tests/testing_utils.py diff --git a/python/nx_cugraph/typing.py b/nx_cugraph/typing.py similarity index 100% rename from python/nx_cugraph/typing.py rename to nx_cugraph/typing.py diff --git a/python/nx_cugraph/utils/__init__.py b/nx_cugraph/utils/__init__.py similarity index 100% rename from python/nx_cugraph/utils/__init__.py rename to nx_cugraph/utils/__init__.py diff --git a/python/nx_cugraph/utils/decorators.py b/nx_cugraph/utils/decorators.py similarity index 100% rename from python/nx_cugraph/utils/decorators.py rename to nx_cugraph/utils/decorators.py diff --git a/python/nx_cugraph/utils/misc.py b/nx_cugraph/utils/misc.py similarity index 100% rename from python/nx_cugraph/utils/misc.py rename to nx_cugraph/utils/misc.py diff --git a/python/pyproject.toml b/pyproject.toml similarity index 100% rename from python/pyproject.toml rename to pyproject.toml diff --git a/python/.flake8 b/python/.flake8 deleted file mode 100644 index cdda8d108..000000000 --- a/python/.flake8 +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2023-2024, NVIDIA CORPORATION. - -[flake8] -max-line-length = 88 -inline-quotes = " -extend-ignore = - B020, - E203, - SIM105, - SIM401, -# E203 whitespace before ':' (to be compatible with black) -per-file-ignores = - nx_cugraph/tests/*.py:T201, - __init__.py:F401,F403, - _nx_cugraph/__init__.py:E501, diff --git a/python/LICENSE b/python/LICENSE deleted file mode 120000 index 30cff7403..000000000 --- a/python/LICENSE +++ /dev/null @@ -1 +0,0 @@ -../../LICENSE \ No newline at end of file diff --git a/python/README.md b/python/README.md deleted file mode 100644 index c3ca0b880..000000000 --- a/python/README.md +++ /dev/null @@ -1,276 +0,0 @@ -# nx-cugraph - -## Description -[RAPIDS](https://rapids.ai) nx-cugraph is a [backend to NetworkX](https://networkx.org/documentation/stable/reference/utils.html#backends) -to run supported algorithms with GPU acceleration. - -## System Requirements - -nx-cugraph requires the following: - * NVIDIA GPU, Volta architecture or later, with [compute capability](https://developer.nvidia.com/cuda-gpus) 7.0+ - * CUDA 11.2, 11.4, 11.5, 11.8, 12.0, 12.2, or 12.5 - * Python version 3.10, 3.11, or 3.12 - * NetworkX >= version 3.0 (version 3.2 or higher recommended) - -More details about system requirements can be found in the [RAPIDS System Requirements documentation](https://docs.rapids.ai/install#system-req). - -## Installation - -nx-cugraph can be installed using either conda or pip. - -### conda -#### latest nightly version -``` -conda install -c rapidsai-nightly -c conda-forge -c nvidia nx-cugraph -``` -#### latest stable version -``` -conda install -c rapidsai -c conda-forge -c nvidia nx-cugraph -``` -### pip -#### latest nightly version -``` -python -m pip install nx-cugraph-cu11 --extra-index-url https://pypi.anaconda.org/rapidsai-wheels-nightly/simple -``` -#### latest stable version -``` -python -m pip install nx-cugraph-cu11 --extra-index-url https://pypi.nvidia.com -``` -Notes: - * The pip example above installs for CUDA 11. To install for CUDA 12, replace `-cu11` with `-cu12` - * Additional information relevant to installing any RAPIDS package can be found [here](https://rapids.ai/#quick-start). - -## Enabling nx-cugraph - -NetworkX will use nx-cugraph as the graph analytics backend if any of the -following are used: - -### `NETWORKX_AUTOMATIC_BACKENDS` environment variable. -The `NETWORKX_AUTOMATIC_BACKENDS` environment variable can be used to have NetworkX automatically dispatch to specified backends an API is called that the backend supports. -Set `NETWORKX_AUTOMATIC_BACKENDS=cugraph` to use nx-cugraph to GPU accelerate supported APIs with no code changes. -Example: -``` -bash> NETWORKX_AUTOMATIC_BACKENDS=cugraph python my_networkx_script.py -``` - -### `backend=` keyword argument -To explicitly specify a particular backend for an API, use the `backend=` -keyword argument. This argument takes precedence over the -`NETWORKX_AUTOMATIC_BACKENDS` environment variable. This requires anyone -running code that uses the `backend=` keyword argument to have the specified -backend installed. - -Example: -``` -nx.betweenness_centrality(cit_patents_graph, k=k, backend="cugraph") -``` - -### Type-based dispatching - -NetworkX also supports automatically dispatching to backends associated with -specific graph types. Like the `backend=` keyword argument example above, this -requires the user to write code for a specific backend, and therefore requires -the backend to be installed, but has the advantage of ensuring a particular -behavior without the potential for runtime conversions. - -To use type-based dispatching with nx-cugraph, the user must import the backend -directly in their code to access the utilities provided to create a Graph -instance specifically for the nx-cugraph backend. - -Example: -``` -import networkx as nx -import nx_cugraph as nxcg - -G = nx.Graph() -... -nxcg_G = nxcg.from_networkx(G) # conversion happens once here -nx.betweenness_centrality(nxcg_G, k=1000) # nxcg Graph type causes cugraph backend - # to be used, no conversion necessary -``` - -## Supported Algorithms - -The nx-cugraph backend to NetworkX connects -[pylibcugraph](../../readme_pages/pylibcugraph.md) (cuGraph's low-level python -interface to its CUDA-based graph analytics library) and -[CuPy](https://cupy.dev/) (a GPU-accelerated array library) to NetworkX's -familiar and easy-to-use API. - -Below is the list of algorithms that are currently supported in nx-cugraph. - -### [Algorithms](https://networkx.org/documentation/latest/reference/algorithms/index.html) - -
-bipartite
- └─ generators
-     └─ complete_bipartite_graph
-centrality
- ├─ betweenness
- │   ├─ betweenness_centrality
- │   └─ edge_betweenness_centrality
- ├─ degree_alg
- │   ├─ degree_centrality
- │   ├─ in_degree_centrality
- │   └─ out_degree_centrality
- ├─ eigenvector
- │   └─ eigenvector_centrality
- └─ katz
-     └─ katz_centrality
-cluster
- ├─ average_clustering
- ├─ clustering
- ├─ transitivity
- └─ triangles
-community
- └─ louvain
-     └─ louvain_communities
-components
- ├─ connected
- │   ├─ connected_components
- │   ├─ is_connected
- │   ├─ node_connected_component
- │   └─ number_connected_components
- └─ weakly_connected
-     ├─ is_weakly_connected
-     ├─ number_weakly_connected_components
-     └─ weakly_connected_components
-core
- ├─ core_number
- └─ k_truss
-dag
- ├─ ancestors
- └─ descendants
-isolate
- ├─ is_isolate
- ├─ isolates
- └─ number_of_isolates
-link_analysis
- ├─ hits_alg
- │   └─ hits
- └─ pagerank_alg
-     └─ pagerank
-operators
- └─ unary
-     ├─ complement
-     └─ reverse
-reciprocity
- ├─ overall_reciprocity
- └─ reciprocity
-shortest_paths
- ├─ generic
- │   ├─ has_path
- │   ├─ shortest_path
- │   └─ shortest_path_length
- ├─ unweighted
- │   ├─ all_pairs_shortest_path
- │   ├─ all_pairs_shortest_path_length
- │   ├─ bidirectional_shortest_path
- │   ├─ single_source_shortest_path
- │   ├─ single_source_shortest_path_length
- │   ├─ single_target_shortest_path
- │   └─ single_target_shortest_path_length
- └─ weighted
-     ├─ all_pairs_bellman_ford_path
-     ├─ all_pairs_bellman_ford_path_length
-     ├─ all_pairs_dijkstra
-     ├─ all_pairs_dijkstra_path
-     ├─ all_pairs_dijkstra_path_length
-     ├─ bellman_ford_path
-     ├─ bellman_ford_path_length
-     ├─ dijkstra_path
-     ├─ dijkstra_path_length
-     ├─ single_source_bellman_ford
-     ├─ single_source_bellman_ford_path
-     ├─ single_source_bellman_ford_path_length
-     ├─ single_source_dijkstra
-     ├─ single_source_dijkstra_path
-     └─ single_source_dijkstra_path_length
-traversal
- └─ breadth_first_search
-     ├─ bfs_edges
-     ├─ bfs_layers
-     ├─ bfs_predecessors
-     ├─ bfs_successors
-     ├─ bfs_tree
-     ├─ descendants_at_distance
-     └─ generic_bfs_edges
-tree
- └─ recognition
-     ├─ is_arborescence
-     ├─ is_branching
-     ├─ is_forest
-     └─ is_tree
-
- -### [Generators](https://networkx.org/documentation/latest/reference/generators.html) - -
-classic
- ├─ barbell_graph
- ├─ circular_ladder_graph
- ├─ complete_graph
- ├─ complete_multipartite_graph
- ├─ cycle_graph
- ├─ empty_graph
- ├─ ladder_graph
- ├─ lollipop_graph
- ├─ null_graph
- ├─ path_graph
- ├─ star_graph
- ├─ tadpole_graph
- ├─ trivial_graph
- ├─ turan_graph
- └─ wheel_graph
-community
- └─ caveman_graph
-ego
- └─ ego_graph
-small
- ├─ bull_graph
- ├─ chvatal_graph
- ├─ cubical_graph
- ├─ desargues_graph
- ├─ diamond_graph
- ├─ dodecahedral_graph
- ├─ frucht_graph
- ├─ heawood_graph
- ├─ house_graph
- ├─ house_x_graph
- ├─ icosahedral_graph
- ├─ krackhardt_kite_graph
- ├─ moebius_kantor_graph
- ├─ octahedral_graph
- ├─ pappus_graph
- ├─ petersen_graph
- ├─ sedgewick_maze_graph
- ├─ tetrahedral_graph
- ├─ truncated_cube_graph
- ├─ truncated_tetrahedron_graph
- └─ tutte_graph
-social
- ├─ davis_southern_women_graph
- ├─ florentine_families_graph
- ├─ karate_club_graph
- └─ les_miserables_graph
-
- -### Other - -
-classes
- └─ function
-     └─ is_negatively_weighted
-convert
- ├─ from_dict_of_lists
- └─ to_dict_of_lists
-convert_matrix
- ├─ from_pandas_edgelist
- └─ from_scipy_sparse_array
-relabel
- ├─ convert_node_labels_to_integers
- └─ relabel_nodes
-
- -To request nx-cugraph backend support for a NetworkX API that is not listed -above, visit the [cuGraph GitHub repo](https://github.com/rapidsai/cugraph). diff --git a/python/lint.yaml b/python/lint.yaml deleted file mode 100644 index dab2ea70e..000000000 --- a/python/lint.yaml +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright (c) 2023-2024, NVIDIA CORPORATION. -# -# https://pre-commit.com/ -# -# Before first use: `pre-commit install` -# To run: `make lint` -# To update: `make lint-update` -# - &flake8_dependencies below needs updated manually -fail_fast: false -default_language_version: - python: python3 -repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 - hooks: - - id: check-added-large-files - - id: check-case-conflict - - id: check-merge-conflict - - id: check-symlinks - - id: check-ast - - id: check-toml - - id: check-yaml - - id: debug-statements - - id: end-of-file-fixer - exclude_types: [svg] - - id: mixed-line-ending - - id: trailing-whitespace - - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.19 - hooks: - - id: validate-pyproject - name: Validate pyproject.toml - - repo: https://github.com/PyCQA/autoflake - rev: v2.3.1 - hooks: - - id: autoflake - args: [--in-place] - - repo: https://github.com/pycqa/isort - rev: 5.13.2 - hooks: - - id: isort - - repo: https://github.com/asottile/pyupgrade - rev: v3.17.0 - hooks: - - id: pyupgrade - args: [--py310-plus] - - repo: https://github.com/psf/black - rev: 24.8.0 - hooks: - - id: black - # - id: black-jupyter - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.7 - hooks: - - id: ruff - args: [--fix-only, --show-fixes] # --unsafe-fixes] - - repo: https://github.com/PyCQA/flake8 - rev: 7.1.1 - hooks: - - id: flake8 - args: ['--per-file-ignores=_nx_cugraph/__init__.py:E501', '--extend-ignore=B020,SIM105'] # Why is this necessary? - additional_dependencies: &flake8_dependencies - # These versions need updated manually - - flake8==7.1.1 - - flake8-bugbear==24.8.19 - - flake8-simplify==0.21.0 - - repo: https://github.com/asottile/yesqa - rev: v1.5.0 - hooks: - - id: yesqa - additional_dependencies: *flake8_dependencies - - repo: https://github.com/codespell-project/codespell - rev: v2.3.0 - hooks: - - id: codespell - types_or: [python, rst, markdown] - additional_dependencies: [tomli] - files: ^(nx_cugraph|docs)/ - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.7 - hooks: - - id: ruff - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 - hooks: - - id: no-commit-to-branch - args: [-p, "^branch-2....$"] diff --git a/python/run_nx_tests.sh b/run_nx_tests.sh similarity index 100% rename from python/run_nx_tests.sh rename to run_nx_tests.sh diff --git a/python/scripts/update_readme.py b/scripts/update_readme.py similarity index 100% rename from python/scripts/update_readme.py rename to scripts/update_readme.py