From b5f124d6272b1de1fc172a871b415144b93f047f Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Thu, 19 Aug 2021 23:37:13 -0500 Subject: [PATCH 1/9] Initial pydata theme changes. --- conda/environments/cugraph_dev_cuda11.0.yml | 2 +- conda/environments/cugraph_dev_cuda11.2.yml | 2 +- docs/cugraph/source/_static/params.css | 21 +++++++++++++++++++ docs/cugraph/source/{ => api_docs}/api.rst | 2 +- .../source/{ => api_docs}/dask-cugraph.rst | 0 .../source/{ => basics}/cugraph_blogs.rst | 0 .../source/{ => basics}/cugraph_intro.md | 0 .../source/{ => basics}/cugraph_ref.rst | 0 .../source/{ => basics}/nx_transition.rst | 0 docs/cugraph/source/conf.py | 20 ++++++++++++------ docs/cugraph/source/index.rst | 10 +++------ 11 files changed, 41 insertions(+), 16 deletions(-) rename docs/cugraph/source/{ => api_docs}/api.rst (99%) rename docs/cugraph/source/{ => api_docs}/dask-cugraph.rst (100%) rename docs/cugraph/source/{ => basics}/cugraph_blogs.rst (100%) rename docs/cugraph/source/{ => basics}/cugraph_intro.md (100%) rename docs/cugraph/source/{ => basics}/cugraph_ref.rst (100%) rename docs/cugraph/source/{ => basics}/nx_transition.rst (100%) diff --git a/conda/environments/cugraph_dev_cuda11.0.yml b/conda/environments/cugraph_dev_cuda11.0.yml index ac47a8256d2..78e1efecafb 100644 --- a/conda/environments/cugraph_dev_cuda11.0.yml +++ b/conda/environments/cugraph_dev_cuda11.0.yml @@ -31,7 +31,7 @@ dependencies: - faiss-proc=*=cuda - scikit-learn>=0.23.1 - sphinx -- sphinx_rtd_theme +- pydata-sphinx-theme - sphinxcontrib-websupport - sphinx-markdown-tables - sphinx-copybutton diff --git a/conda/environments/cugraph_dev_cuda11.2.yml b/conda/environments/cugraph_dev_cuda11.2.yml index 34742edb2d7..1941aa22b76 100644 --- a/conda/environments/cugraph_dev_cuda11.2.yml +++ b/conda/environments/cugraph_dev_cuda11.2.yml @@ -31,7 +31,7 @@ dependencies: - faiss-proc=*=cuda - scikit-learn>=0.23.1 - sphinx -- sphinx_rtd_theme +- pydata-sphinx-theme - sphinxcontrib-websupport - sphinx-markdown-tables - sphinx-copybutton diff --git a/docs/cugraph/source/_static/params.css b/docs/cugraph/source/_static/params.css index dc5cb96406b..b57bcdb7c7c 100644 --- a/docs/cugraph/source/_static/params.css +++ b/docs/cugraph/source/_static/params.css @@ -7,3 +7,24 @@ margin: 0.5em; content: ":"; } + +:root { + + --pst-color-active-navigation: 114, 83, 237; + --pst-color-navbar-link: 77, 77, 77; + --pst-color-navbar-link-hover: var(--pst-color-active-navigation); + --pst-color-navbar-link-active: var(--pst-color-active-navigation); + --pst-color-sidebar-link: 77, 77, 77; + --pst-color-sidebar-link-hover: var(--pst-color-active-navigation); + --pst-color-sidebar-link-active: var(--pst-color-active-navigation); + --pst-color-sidebar-expander-background-hover: 244, 244, 244; + --pst-color-sidebar-caption: 77, 77, 77; + --pst-color-toc-link: 119, 117, 122; + --pst-color-toc-link-hover: var(--pst-color-active-navigation); + --pst-color-toc-link-active: var(--pst-color-active-navigation); + +} + +.special-table td, .special-table th { + border: 1px solid #dee2e6; +} \ No newline at end of file diff --git a/docs/cugraph/source/api.rst b/docs/cugraph/source/api_docs/api.rst similarity index 99% rename from docs/cugraph/source/api.rst rename to docs/cugraph/source/api_docs/api.rst index 81c5e3e4ee2..31348a9b83b 100644 --- a/docs/cugraph/source/api.rst +++ b/docs/cugraph/source/api_docs/api.rst @@ -134,7 +134,7 @@ Connected Components :undoc-members: Connected Components (MG) --------------------- +------------------------- .. automodule:: cugraph.dask.components.connectivity :members: diff --git a/docs/cugraph/source/dask-cugraph.rst b/docs/cugraph/source/api_docs/dask-cugraph.rst similarity index 100% rename from docs/cugraph/source/dask-cugraph.rst rename to docs/cugraph/source/api_docs/dask-cugraph.rst diff --git a/docs/cugraph/source/cugraph_blogs.rst b/docs/cugraph/source/basics/cugraph_blogs.rst similarity index 100% rename from docs/cugraph/source/cugraph_blogs.rst rename to docs/cugraph/source/basics/cugraph_blogs.rst diff --git a/docs/cugraph/source/cugraph_intro.md b/docs/cugraph/source/basics/cugraph_intro.md similarity index 100% rename from docs/cugraph/source/cugraph_intro.md rename to docs/cugraph/source/basics/cugraph_intro.md diff --git a/docs/cugraph/source/cugraph_ref.rst b/docs/cugraph/source/basics/cugraph_ref.rst similarity index 100% rename from docs/cugraph/source/cugraph_ref.rst rename to docs/cugraph/source/basics/cugraph_ref.rst diff --git a/docs/cugraph/source/nx_transition.rst b/docs/cugraph/source/basics/nx_transition.rst similarity index 100% rename from docs/cugraph/source/nx_transition.rst rename to docs/cugraph/source/basics/nx_transition.rst diff --git a/docs/cugraph/source/conf.py b/docs/cugraph/source/conf.py index f2d60f53bb8..abf6f985e06 100644 --- a/docs/cugraph/source/conf.py +++ b/docs/cugraph/source/conf.py @@ -109,7 +109,7 @@ # a list of builtin themes. # -html_theme = 'sphinx_rtd_theme' +html_theme = 'pydata_sphinx_theme' # on_rtd is whether we are on readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' @@ -118,16 +118,24 @@ # only import and set the theme if we're building docs locally # otherwise, readthedocs.org uses their theme by default, # so no need to specify it - import sphinx_rtd_theme - html_theme = 'sphinx_rtd_theme' - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] + import pydata_sphinx_theme + html_theme = 'pydata_sphinx_theme' + html_theme_path = pydata_sphinx_theme.get_html_theme_path() +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = False # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # -# html_theme_options = {} +html_theme_options = { + "external_links": [], + "github_url": "https://github.com/rapidsai/cugraph", + "twitter_url": "https://twitter.com/rapidsai", + "show_toc_level": 1, + "navbar_align": "right", +} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, @@ -202,9 +210,9 @@ def setup(app): - app.add_css_file('copybutton.css') app.add_css_file('params.css') app.add_css_file('references.css') + # pass source_suffix = ['.rst', '.md'] diff --git a/docs/cugraph/source/index.rst b/docs/cugraph/source/index.rst index 93184f40be1..6eae4ceedf6 100644 --- a/docs/cugraph/source/index.rst +++ b/docs/cugraph/source/index.rst @@ -2,15 +2,11 @@ Welcome to cugraph's documentation! =================================== .. toctree:: - :maxdepth: 4 + :maxdepth: 2 :caption: Contents: - cugraph_intro.md - api.rst - dask-cugraph.rst - cugraph_blogs.rst - cugraph_ref.rst - nx_transition.rst + basics/index + api_docs/index Indices and tables ================== From 59ae89655dfcbccda8ad0db956f0daf14372a6c2 Mon Sep 17 00:00:00 2001 From: BradReesWork Date: Fri, 20 Aug 2021 10:01:44 -0400 Subject: [PATCH 2/9] updating doc make section --- docs/cugraph/Makefile | 5 ++--- docs/cugraph/README.md | 21 ++++++++++++--------- docs/cugraph/requirement.txt | 4 ---- 3 files changed, 14 insertions(+), 16 deletions(-) delete mode 100644 docs/cugraph/requirement.txt diff --git a/docs/cugraph/Makefile b/docs/cugraph/Makefile index 9c35aa6fc8d..330c06bedca 100644 --- a/docs/cugraph/Makefile +++ b/docs/cugraph/Makefile @@ -4,7 +4,7 @@ # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build -SPHINXPROJ = cuGraph +SPHINXPROJ = cugraph SOURCEDIR = source BUILDDIR = build IMGDIR = images @@ -18,5 +18,4 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - cp -r $(SOURCEDIR)/$(IMGDIR) $(BUILDDIR)/html + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/docs/cugraph/README.md b/docs/cugraph/README.md index 199e743cd49..734867af965 100644 --- a/docs/cugraph/README.md +++ b/docs/cugraph/README.md @@ -1,25 +1,28 @@ # Building Documentation -A basic python environment with packages listed in `./requirement.txt` is -enough to build the docs. Doc generation does not get run by default +All prerequisite for building docs are in the cugraph development conda environment. +[See build instructions](../../SOURCEBUILD.md) on how to create the development conda environment -## Get additional dependency +## Steps to follow: -```bash -pip install -r requirement.txt -``` +In order to build the docs, we need the conda dev environment from cugraph and we need to build cugraph from source. + +1. Create a conda env and build cugraph from source. The dependencies to build rapids from source are installed in that conda environment, and then rapids is built and installed into the same environment. + +2. Once cugraph is built from source, navigate to `../docs/cugraph/`. If you have your documentation written and want to turn it into HTML, run makefile: -## Run makefile: ```bash +# most be in the /docs/cugraph directory make html ``` -Outputs to `build/html/index.html` +This should run Sphinx in your shell, and outputs to `build/html/index.html` + ## View docs web page by opening HTML in browser: -First navigate to `/build/html/` folder, i.e., `cd build/html` and then run the following command: +First navigate to `/build/html/` folder, and then run the following command: ```bash python -m http.server diff --git a/docs/cugraph/requirement.txt b/docs/cugraph/requirement.txt deleted file mode 100644 index f636fd8799c..00000000000 --- a/docs/cugraph/requirement.txt +++ /dev/null @@ -1,4 +0,0 @@ -sphinx -sphinx_rtd_theme -numpydoc -ipython \ No newline at end of file From 9539ba6d02c19189d121fdaa08d88a5a2864cf34 Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Fri, 20 Aug 2021 16:58:26 -0500 Subject: [PATCH 3/9] Make API related page changes --- docs/cugraph/source/api_docs/api.rst | 324 ------------------ docs/cugraph/source/api_docs/centrality.rst | 29 ++ docs/cugraph/source/api_docs/community.rst | 81 +++++ docs/cugraph/source/api_docs/components.rst | 25 ++ docs/cugraph/source/api_docs/cores.rst | 21 ++ docs/cugraph/source/api_docs/generator.rst | 14 + .../source/api_docs/helper_functions.rst | 16 + docs/cugraph/source/api_docs/index.rst | 27 ++ docs/cugraph/source/api_docs/layout.rst | 14 + .../source/api_docs/linear_assignment.rst | 13 + .../cugraph/source/api_docs/link_analysis.rst | 29 ++ .../source/api_docs/link_prediction.rst | 34 ++ docs/cugraph/source/api_docs/sampling.rst | 13 + docs/cugraph/source/api_docs/structure.rst | 68 ++++ docs/cugraph/source/api_docs/traversal.rst | 49 +++ docs/cugraph/source/api_docs/tree.rst | 22 ++ docs/cugraph/source/basics/index.rst | 12 + 17 files changed, 467 insertions(+), 324 deletions(-) delete mode 100644 docs/cugraph/source/api_docs/api.rst create mode 100644 docs/cugraph/source/api_docs/centrality.rst create mode 100644 docs/cugraph/source/api_docs/community.rst create mode 100644 docs/cugraph/source/api_docs/components.rst create mode 100644 docs/cugraph/source/api_docs/cores.rst create mode 100644 docs/cugraph/source/api_docs/generator.rst create mode 100644 docs/cugraph/source/api_docs/helper_functions.rst create mode 100644 docs/cugraph/source/api_docs/index.rst create mode 100644 docs/cugraph/source/api_docs/layout.rst create mode 100644 docs/cugraph/source/api_docs/linear_assignment.rst create mode 100644 docs/cugraph/source/api_docs/link_analysis.rst create mode 100644 docs/cugraph/source/api_docs/link_prediction.rst create mode 100644 docs/cugraph/source/api_docs/sampling.rst create mode 100644 docs/cugraph/source/api_docs/structure.rst create mode 100644 docs/cugraph/source/api_docs/traversal.rst create mode 100644 docs/cugraph/source/api_docs/tree.rst create mode 100644 docs/cugraph/source/basics/index.rst diff --git a/docs/cugraph/source/api_docs/api.rst b/docs/cugraph/source/api_docs/api.rst deleted file mode 100644 index 31348a9b83b..00000000000 --- a/docs/cugraph/source/api_docs/api.rst +++ /dev/null @@ -1,324 +0,0 @@ -~~~~~~~~~~~~~~~~~~~~~ -cuGraph API Reference -~~~~~~~~~~~~~~~~~~~~~ - - - -Structure -========= - -Graph ------ - -.. autoclass:: cugraph.structure.graph_classes.Graph - :members: - :undoc-members: - - -Symmetrize ----------- - -.. automodule:: cugraph.structure.symmetrize - :members: - :undoc-members: - -Conversion from Other Formats ------------------------------ - -.. automodule:: cugraph.structure.convert_matrix - :members: - :undoc-members: - - -Centrality -========== - -Betweenness Centrality ----------------------- - -.. automodule:: cugraph.centrality.betweenness_centrality - :members: - :undoc-members: - -Katz Centrality ---------------- - -.. automodule:: cugraph.centrality.katz_centrality - :members: - :undoc-members: - - -Katz Centrality (MG) --------------------- - -.. automodule:: cugraph.dask.centrality.katz_centrality - :members: - :undoc-members: - -Community -========= - -EgoNet ------------------------------------- - -.. automodule:: cugraph.community.egonet - :members: - :undoc-members: - -Ensemble clustering for graphs (ECG) ------------------------------------- - -.. automodule:: cugraph.community.ecg - :members: - :undoc-members: - -K-Truss -------- - -.. automodule:: cugraph.community.ktruss_subgraph - :members: - :undoc-members: - -Leiden -------- - -.. automodule:: cugraph.community.leiden - :members: - :undoc-members: - -Louvain -------- - -.. automodule:: cugraph.community.louvain - :members: - :undoc-members: - -Louvain (MG) ------------- - -.. automodule:: cugraph.dask.community.louvain - :members: - :undoc-members: - - -Spectral Clustering -------------------- - -.. automodule:: cugraph.community.spectral_clustering - :members: - :undoc-members: - -Subgraph Extraction -------------------- - -.. automodule:: cugraph.community.subgraph_extraction - :members: - :undoc-members: - -Triangle Counting ------------------ - -.. automodule:: cugraph.community.triangle_count - :members: - :undoc-members: - - -Components -========== - -Connected Components --------------------- - -.. automodule:: cugraph.components.connectivity - :members: - :undoc-members: - -Connected Components (MG) -------------------------- - -.. automodule:: cugraph.dask.components.connectivity - :members: - :undoc-members: - -Cores -===== - -Core Number ------------ - -.. automodule:: cugraph.cores.core_number - :members: - :undoc-members: - -K-Core ------- - -.. automodule:: cugraph.cores.k_core - :members: - :undoc-members: - - -Layout -====== - -Force Atlas 2 -------------- - -.. automodule:: cugraph.layout.force_atlas2 - :members: - :undoc-members: - - -Linear Assignment -================= - -Hungarian -------------- - -.. automodule:: cugraph.linear_assignment.hungarian - :members: - :undoc-members: - - -Link Analysis -============= - -HITS ---------- - -.. automodule:: cugraph.link_analysis.hits - :members: - :undoc-members: - -Pagerank ---------- - -.. automodule:: cugraph.link_analysis.pagerank - :members: - :undoc-members: - -Pagerank (MG) -------------- - -.. automodule:: cugraph.dask.link_analysis.pagerank - :members: pagerank - :undoc-members: - - -Link Prediction -=============== - -Jaccard Coefficient -------------------- - -.. automodule:: cugraph.link_prediction.jaccard - :members: - :undoc-members: - -.. automodule:: cugraph.link_prediction.wjaccard - :members: - :undoc-members: - -Overlap Coefficient -------------------- - -.. automodule:: cugraph.link_prediction.overlap - :members: - :undoc-members: - -.. automodule:: cugraph.link_prediction.woverlap - :members: - :undoc-members: - - -Sampling -======== - -Random Walks ------------- - -.. automodule:: cugraph.sampling.random_walks - :members: - :undoc-members: - - -Traversal -========= - -Breadth-first-search --------------------- - -.. automodule:: cugraph.traversal.bfs - :members: - :undoc-members: - -Breadth-first-search (MG) -------------------------- - -.. automodule:: cugraph.dask.traversal.bfs - :members: - :undoc-members: - -Single-source-shortest-path ---------------------------- - -.. automodule:: cugraph.traversal.sssp - :members: - :undoc-members: - -Single-source-shortest-path (MG) --------------------------------- - -.. automodule:: cugraph.dask.traversal.sssp - :members: - :undoc-members: - -Traveling-salesperson-problem ------------------------------ - -.. automodule:: cugraph.traversal.traveling_salesperson - :members: - :undoc-members: - - -Tree -========= - -Minimum Spanning Tree ---------------------- - -.. automodule:: cugraph.tree.minimum_spanning_tree - :members: minimum_spanning_tree - :undoc-members: - -Maximum Spanning Tree ---------------------- - -.. automodule:: cugraph.tree.minimum_spanning_tree - :members: maximum_spanning_tree - :undoc-members: - :noindex: - - -Generator -========= - -RMAT ---------------------- - -.. automodule:: cugraph.generators - :members: rmat - :undoc-members: - - -DASK MG Helper functions -=========================== - -.. automodule:: cugraph.comms.comms - :members: initialize, destroy - :undoc-members: - :member-order: bysource - -.. automodule:: cugraph.dask.common.read_utils - :members: get_chunksize - :undoc-members: diff --git a/docs/cugraph/source/api_docs/centrality.rst b/docs/cugraph/source/api_docs/centrality.rst new file mode 100644 index 00000000000..2f43354ea21 --- /dev/null +++ b/docs/cugraph/source/api_docs/centrality.rst @@ -0,0 +1,29 @@ +========== +Centrality +========== +.. currentmodule:: cugraph + + + +Betweenness Centrality +---------------------- +.. autosummary:: + :toctree: api/ + + cugraph.centrality.betweenness_centrality.betweenness_centrality + cugraph.centrality.betweenness_centrality.edge_betweenness_centrality + +Katz Centrality +--------------- +.. autosummary:: + :toctree: api/ + + cugraph.centrality.katz_centrality.katz_centrality + +Katz Centrality (MG) +-------------------- +.. autosummary:: + :toctree: api/ + + cugraph.dask.centrality.katz_centrality.call_katz_centrality + cugraph.dask.centrality.katz_centrality.katz_centrality diff --git a/docs/cugraph/source/api_docs/community.rst b/docs/cugraph/source/api_docs/community.rst new file mode 100644 index 00000000000..7f7752ae425 --- /dev/null +++ b/docs/cugraph/source/api_docs/community.rst @@ -0,0 +1,81 @@ +========= +Community +========= +.. currentmodule:: cugraph + + + +EgoNet +------ +.. autosummary:: + :toctree: api/ + + cugraph.community.egonet.batched_ego_graphs + cugraph.community.egonet.ego_graph + +Ensemble clustering for graphs (ECG) +------------------------------------ +.. autosummary:: + :toctree: api/ + + cugraph.community.ecg.ecg + + +K-Truss +------- +.. autosummary:: + :toctree: api/ + + cugraph.community.ktruss_subgraph.k_truss + cugraph.community.ktruss_subgraph.ktruss_subgraph + +Leiden +------ +.. autosummary:: + :toctree: api/ + + cugraph.community.leiden.leiden + + +Louvain +------- +.. autosummary:: + :toctree: api/ + + cugraph.community.louvain.louvain + + +Louvain (MG) +------------ +.. autosummary:: + :toctree: api/ + + cugraph.dask.community.louvain.call_louvain + cugraph.community.ktruss_subgraph.ktruss_subgraph + +Spectral Clustering +------------------- +.. autosummary:: + :toctree: api/ + + cugraph.community.spectral_clustering.analyzeClustering_edge_cut + cugraph.community.spectral_clustering.analyzeClustering_modularity + cugraph.community.spectral_clustering.analyzeClustering_ratio_cut + cugraph.community.spectral_clustering.spectralBalancedCutClustering + cugraph.community.spectral_clustering.spectralModularityMaximizationClustering + + +Subgraph Extraction +------------------- +.. autosummary:: + :toctree: api/ + + cugraph.community.subgraph_extraction.subgraph + + +Triangle Counting +----------------- +.. autosummary:: + :toctree: api/ + + cugraph.community.triangle_count.triangles diff --git a/docs/cugraph/source/api_docs/components.rst b/docs/cugraph/source/api_docs/components.rst new file mode 100644 index 00000000000..0f7d3a9c2cb --- /dev/null +++ b/docs/cugraph/source/api_docs/components.rst @@ -0,0 +1,25 @@ +========== +Components +========== +.. currentmodule:: cugraph + + + +Connected Components +-------------------- +.. autosummary:: + :toctree: api/ + + cugraph.components.connectivity.connected_components + cugraph.components.connectivity.strongly_connected_components + cugraph.components.connectivity.weakly_connected_components + + +Connected Components (MG) +------------------------- +.. autosummary:: + :toctree: api/ + + cugraph.dask.components.connectivity.call_wcc + cugraph.dask.components.connectivity.weakly_connected_components + diff --git a/docs/cugraph/source/api_docs/cores.rst b/docs/cugraph/source/api_docs/cores.rst new file mode 100644 index 00000000000..344725914ed --- /dev/null +++ b/docs/cugraph/source/api_docs/cores.rst @@ -0,0 +1,21 @@ +===== +Cores +===== +.. currentmodule:: cugraph + + + +Core Number +----------- +.. autosummary:: + :toctree: api/ + + cugraph.cores.core_number.core_number + + +K-Core +------ +.. autosummary:: + :toctree: api/ + + cugraph.centrality.katz_centrality.katz_centrality diff --git a/docs/cugraph/source/api_docs/generator.rst b/docs/cugraph/source/api_docs/generator.rst new file mode 100644 index 00000000000..e89fe25e867 --- /dev/null +++ b/docs/cugraph/source/api_docs/generator.rst @@ -0,0 +1,14 @@ +========= +Generator +========= +.. currentmodule:: cugraph + + + +RMAT +---- +.. autosummary:: + :toctree: api/ + + cugraph.generators.rmat + diff --git a/docs/cugraph/source/api_docs/helper_functions.rst b/docs/cugraph/source/api_docs/helper_functions.rst new file mode 100644 index 00000000000..f8a3f049525 --- /dev/null +++ b/docs/cugraph/source/api_docs/helper_functions.rst @@ -0,0 +1,16 @@ +======================== +DASK MG Helper functions +======================== +.. currentmodule:: cugraph + + + +Methods +------- +.. autosummary:: + :toctree: api/ + + cugraph.comms.comms.initialize + cugraph.comms.comms.destroy + cugraph.dask.common.read_utils.get_chunksize + diff --git a/docs/cugraph/source/api_docs/index.rst b/docs/cugraph/source/api_docs/index.rst new file mode 100644 index 00000000000..974217dfe69 --- /dev/null +++ b/docs/cugraph/source/api_docs/index.rst @@ -0,0 +1,27 @@ +============= +API reference +============= + +This page provides a list of all publicly accessible modules, methods and classes through +``cugraph.*`` namespace. + +.. toctree:: + :maxdepth: 2 + :caption: API Documentation + + structure + centrality + community + components + cores + layout + linear_assignment + link_analysis + link_prediction + sampling + traversal + tree + generator + helper_functions + dask-cugraph.rst + diff --git a/docs/cugraph/source/api_docs/layout.rst b/docs/cugraph/source/api_docs/layout.rst new file mode 100644 index 00000000000..fc81df72221 --- /dev/null +++ b/docs/cugraph/source/api_docs/layout.rst @@ -0,0 +1,14 @@ +====== +Layout +====== +.. currentmodule:: cugraph + + + +Force Atlas 2 +------------- +.. autosummary:: + :toctree: api/ + + cugraph.layout.force_atlas2.force_atlas2 + diff --git a/docs/cugraph/source/api_docs/linear_assignment.rst b/docs/cugraph/source/api_docs/linear_assignment.rst new file mode 100644 index 00000000000..147597879d9 --- /dev/null +++ b/docs/cugraph/source/api_docs/linear_assignment.rst @@ -0,0 +1,13 @@ +================= +Linear Assignment +================= +.. currentmodule:: cugraph + + + +Hungarian +--------- +.. autosummary:: + :toctree: api/ + + cugraph.linear_assignment.hungarian diff --git a/docs/cugraph/source/api_docs/link_analysis.rst b/docs/cugraph/source/api_docs/link_analysis.rst new file mode 100644 index 00000000000..809fd364728 --- /dev/null +++ b/docs/cugraph/source/api_docs/link_analysis.rst @@ -0,0 +1,29 @@ +============= +Link Analysis +============= +.. currentmodule:: cugraph + + + +HITS +---- +.. autosummary:: + :toctree: api/ + + cugraph.link_analysis.hits.hits + + +Pagerank +-------- +.. autosummary:: + :toctree: api/ + + cugraph.centrality.katz_centrality.katz_centrality + +Pagerank (MG) +------------- +.. autosummary:: + :toctree: api/ + + cugraph.dask.link_analysis.pagerank.pagerank + diff --git a/docs/cugraph/source/api_docs/link_prediction.rst b/docs/cugraph/source/api_docs/link_prediction.rst new file mode 100644 index 00000000000..0ecfde58d50 --- /dev/null +++ b/docs/cugraph/source/api_docs/link_prediction.rst @@ -0,0 +1,34 @@ +=============== +Link Prediction +=============== +.. currentmodule:: cugraph + + + +Jaccard Coefficient +------------------- +.. autosummary:: + :toctree: api/ + + cugraph.link_prediction.jaccard.jaccard + cugraph.link_prediction.jaccard.jaccard_coefficient + cugraph.link_prediction.wjaccard.jaccard_w + + +Overlap Coefficient +------------------- +.. autosummary:: + :toctree: api/ + + cugraph.link_prediction.overlap.overlap + cugraph.link_prediction.overlap.overlap_coefficient + cugraph.link_prediction.woverlap.overlap_w + + +Pagerank (MG) +------------- +.. autosummary:: + :toctree: api/ + + cugraph.dask.link_analysis.pagerank.pagerank + diff --git a/docs/cugraph/source/api_docs/sampling.rst b/docs/cugraph/source/api_docs/sampling.rst new file mode 100644 index 00000000000..de7f707fb5f --- /dev/null +++ b/docs/cugraph/source/api_docs/sampling.rst @@ -0,0 +1,13 @@ +======== +Sampling +======== +.. currentmodule:: cugraph + + + +Random Walks +------------ +.. autosummary:: + :toctree: api/ + + cugraph.sampling.random_walks.random_walks diff --git a/docs/cugraph/source/api_docs/structure.rst b/docs/cugraph/source/api_docs/structure.rst new file mode 100644 index 00000000000..e1781eda742 --- /dev/null +++ b/docs/cugraph/source/api_docs/structure.rst @@ -0,0 +1,68 @@ +========= +Structure +========= +.. currentmodule:: cugraph.structure.graph_classes + +Constructor +----------- +.. autosummary:: + :toctree: api/ + + Graph + + +Methods +------- +.. autosummary:: + :toctree: api/ + + Graph.add_internal_vertex_id + Graph.add_nodes_from + Graph.clear + Graph.from_cudf_adjlist + Graph.from_cudf_edgelist + Graph.from_dask_cudf_edgelist + Graph.from_numpy_array + Graph.from_numpy_matrix + Graph.from_pandas_adjacency + Graph.from_pandas_edgelist + Graph.has_isolated_vertices + Graph.is_bipartite + Graph.is_directed + Graph.is_multigraph + Graph.is_multipartite + Graph.is_renumbered + Graph.is_weighted + Graph.lookup_internal_vertex_id + Graph.to_directed + Graph.to_undirected + Graph.unrenumber + +.. currentmodule:: cugraph + +Symmetrize +---------- +.. autosummary:: + :toctree: api/ + + cugraph.structure.symmetrize.symmetrize + cugraph.structure.symmetrize.symmetrize_ddf + cugraph.structure.symmetrize.symmetrize_df + + +Conversion from Other Formats +----------------------------- +.. autosummary:: + :toctree: api/ + + cugraph.structure.convert_matrix.from_adjlist + cugraph.structure.convert_matrix.from_cudf_edgelist + cugraph.structure.convert_matrix.from_edgelist + cugraph.structure.convert_matrix.from_numpy_array + cugraph.structure.convert_matrix.from_numpy_matrix + cugraph.structure.convert_matrix.from_pandas_adjacency + cugraph.structure.convert_matrix.from_pandas_edgelist + cugraph.structure.convert_matrix.to_numpy_array + cugraph.structure.convert_matrix.to_numpy_matrix + cugraph.structure.convert_matrix.to_pandas_adjacency + cugraph.structure.convert_matrix.to_pandas_edgelist \ No newline at end of file diff --git a/docs/cugraph/source/api_docs/traversal.rst b/docs/cugraph/source/api_docs/traversal.rst new file mode 100644 index 00000000000..6a11a4a130f --- /dev/null +++ b/docs/cugraph/source/api_docs/traversal.rst @@ -0,0 +1,49 @@ +========= +Traversal +========= +.. currentmodule:: cugraph + + + +Breadth-first-search +-------------------- +.. autosummary:: + :toctree: api/ + + cugraph.traversal.bfs.bfs + cugraph.traversal.bfs.bfs_edges + +Breadth-first-search (MG) +------------------------- +.. autosummary:: + :toctree: api/ + + cugraph.dask.traversal.bfs.bfs + cugraph.dask.traversal.bfs.call_bfs + + +Single-source-shortest-path +--------------------------- +.. autosummary:: + :toctree: api/ + + cugraph.traversal.sssp.filter_unreachable + cugraph.traversal.sssp.shortest_path + cugraph.traversal.sssp.shortest_path_length + cugraph.traversal.sssp.sssp + +Single-source-shortest-path (MG) +-------------------------------- +.. autosummary:: + :toctree: api/ + + cugraph.dask.traversal.sssp.call_sssp + cugraph.dask.traversal.sssp.sssp + + +Traveling-salesperson-problem +----------------------------- +.. autosummary:: + :toctree: api/ + + cugraph.traversal.traveling_salesperson.traveling_salesperson diff --git a/docs/cugraph/source/api_docs/tree.rst b/docs/cugraph/source/api_docs/tree.rst new file mode 100644 index 00000000000..7952c4fa34d --- /dev/null +++ b/docs/cugraph/source/api_docs/tree.rst @@ -0,0 +1,22 @@ +==== +Tree +==== +.. currentmodule:: cugraph + + + +Minimum Spanning Tree +--------------------- +.. autosummary:: + :toctree: api/ + + cugraph.tree.minimum_spanning_tree.minimum_spanning_tree + + +Maximum Spanning Tree +--------------------- +.. autosummary:: + :toctree: api/ + + cugraph.tree.minimum_spanning_tree.maximum_spanning_tree + diff --git a/docs/cugraph/source/basics/index.rst b/docs/cugraph/source/basics/index.rst new file mode 100644 index 00000000000..9260169ee43 --- /dev/null +++ b/docs/cugraph/source/basics/index.rst @@ -0,0 +1,12 @@ +====== +Basics +====== + + +.. toctree:: + :maxdepth: 2 + + cugraph_intro.md + cugraph_blogs.rst + cugraph_ref.rst + nx_transition.rst From 852f88825c8a0a03e3ce162916c704f6eb99abd2 Mon Sep 17 00:00:00 2001 From: BradReesWork Date: Mon, 23 Aug 2021 09:52:05 -0400 Subject: [PATCH 4/9] updated to include 11.4 --- SOURCEBUILD.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SOURCEBUILD.md b/SOURCEBUILD.md index 47b842a0ce6..8e170dc8706 100644 --- a/SOURCEBUILD.md +++ b/SOURCEBUILD.md @@ -49,6 +49,10 @@ conda env create --name cugraph_dev --file conda/environments/cugraph_dev_cuda11 # for CUDA 11.2 conda env create --name cugraph_dev --file conda/environments/cugraph_dev_cuda11.2.yml +# for CUDA 11.4 +conda env create --name cugraph_dev --file conda/environments/cugraph_dev_cuda11.4.yml + + # activate the environment conda activate cugraph_dev From ef42ecc0a63b9dd77e40557461684c8b84712943 Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Mon, 23 Aug 2021 11:10:07 -0500 Subject: [PATCH 5/9] Update gitignore. --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index c2498b35cf1..ab09229e8ab 100644 --- a/.gitignore +++ b/.gitignore @@ -81,3 +81,6 @@ python/_external_repositories/ # created by Dask tests python/dask-worker-space + +# Sphinx docs & build artifacts +docs/cudf/source/api_docs/api/* From 902ea1f2137935ae1ec38ccf5b7678891b5bb7bd Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Mon, 23 Aug 2021 11:12:11 -0500 Subject: [PATCH 6/9] typo --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ab09229e8ab..3afdcbccc4a 100644 --- a/.gitignore +++ b/.gitignore @@ -83,4 +83,4 @@ python/_external_repositories/ python/dask-worker-space # Sphinx docs & build artifacts -docs/cudf/source/api_docs/api/* +docs/cugraph/source/api_docs/api/* From 3963d3aaf9fa0f820a30d62eb60f82b43d4e9c31 Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Mon, 23 Aug 2021 11:15:34 -0500 Subject: [PATCH 7/9] remove copybutton custom code. --- docs/cugraph/source/_static/copybutton.css | 42 ------------ .../source/_static/copybutton_pydocs.js | 65 ------------------- docs/cugraph/source/_static/example_mod.js | 61 ----------------- docs/cugraph/source/conf.py | 1 - 4 files changed, 169 deletions(-) delete mode 100644 docs/cugraph/source/_static/copybutton.css delete mode 100644 docs/cugraph/source/_static/copybutton_pydocs.js delete mode 100644 docs/cugraph/source/_static/example_mod.js diff --git a/docs/cugraph/source/_static/copybutton.css b/docs/cugraph/source/_static/copybutton.css deleted file mode 100644 index 5eef6e366d0..00000000000 --- a/docs/cugraph/source/_static/copybutton.css +++ /dev/null @@ -1,42 +0,0 @@ -/* This contains code with copyright by the scikit-learn project, subject to -the license in /thirdparty/LICENSES/LICENSE.scikit_learn */ - -/* copybutton */ -/* Adds "Show/Hide Output" button to Examples */ - -.copybutton { - cursor: pointer; - position: absolute; - top: 0px; - right: 0px; - border: 1px solid rgb(221, 221, 221); - color: rgb(221, 221, 221); - font-family: monospace; - padding-left: 0.2rem; - padding-right: 0.2rem; -} - -div.highlight:hover span.copybutton::after { - background: #3F556B; - border-radius: 0.25rem; - color: white; - content: attr(title); - padding: 0.25rem; - position: absolute; - z-index: 98; - width: 100px; - font-size: 0.7rem; - top: 0; - right: 0; -} - -/* copy buttonn */ -div.highlight:hover span.copybutton { - background-color: #3F556B; - color: white; -} - -div.highlight:hover span.copybutton:hover { - background-color: #20252B; -} - diff --git a/docs/cugraph/source/_static/copybutton_pydocs.js b/docs/cugraph/source/_static/copybutton_pydocs.js deleted file mode 100644 index cec05777e6b..00000000000 --- a/docs/cugraph/source/_static/copybutton_pydocs.js +++ /dev/null @@ -1,65 +0,0 @@ -$(document).ready(function() { - /* Add a [>>>] button on the top-right corner of code samples to hide - * the >>> and ... prompts and the output and thus make the code - * copyable. */ - var div = $('.highlight-python .highlight,' + - '.highlight-python3 .highlight,' + - '.highlight-pycon .highlight,' + - '.highlight-default .highlight'); - var pre = div.find('pre'); - - // get the styles from the current theme - pre.parent().parent().css('position', 'relative'); - var hide_text = 'Hide the prompts and output'; - var show_text = 'Show the prompts and output'; - var border_width = pre.css('border-top-width'); - var border_style = pre.css('border-top-style'); - var border_color = pre.css('border-top-color'); - var button_styles = { - 'cursor':'pointer', 'position': 'absolute', 'top': '0', 'right': '0', - 'border-color': border_color, 'border-style': border_style, - 'border-width': border_width, 'text-size': '75%', - 'font-family': 'monospace', 'padding-left': '0.2em', 'padding-right': '1.5em', - 'border-radius': '0 3px 0 0', - 'transition': "0.5s" - } - - // create and add the button to all the code blocks that contain >>> - div.each(function(index) { - var jthis = $(this); - if (jthis.find('.gp').length > 0) { - var button = $('>>>'); - button.css(button_styles) - button.attr('title', hide_text); - button.data('hidden', 'false'); - jthis.prepend(button); - } - // tracebacks (.gt) contain bare text elements that need to be - // wrapped in a span to work with .nextUntil() (see later) - jthis.find('pre:has(.gt)').contents().filter(function() { - return ((this.nodeType == 3) && (this.data.trim().length > 0)); - }).wrap(''); - }); - - // define the behavior of the button when it's clicked - $('.copybutton').click(function(e){ - e.preventDefault(); - var button = $(this); - if (button.data('hidden') === 'false') { - // hide the code output - button.parent().find('.go, .gp, .gt').hide(); - button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'hidden'); - button.css('text-decoration', 'line-through'); - button.attr('title', show_text); - button.data('hidden', 'true'); - } else { - // show the code output - button.parent().find('.go, .gp, .gt').show(); - button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'visible'); - button.css('text-decoration', 'none'); - button.attr('title', hide_text); - button.data('hidden', 'false'); - } - }); -}); - diff --git a/docs/cugraph/source/_static/example_mod.js b/docs/cugraph/source/_static/example_mod.js deleted file mode 100644 index 77dc618a82d..00000000000 --- a/docs/cugraph/source/_static/example_mod.js +++ /dev/null @@ -1,61 +0,0 @@ -// This contains code with copyright by the scikit-learn project, subject to -// the license in /thirdparty/LICENSES/LICENSE.scikit_learn - -$(document).ready(function () { - /* Add a [>>>] button on the top-right corner of code samples to hide - * the >>> and ... prompts and the output and thus make the code - * copyable. */ - var div = $('.highlight-python .highlight,' + - '.highlight-python3 .highlight,' + - '.highlight-pycon .highlight,' + - '.highlight-default .highlight') - var pre = div.find('pre'); - - // get the styles from the current theme - pre.parent().parent().css('position', 'relative'); - var hide_text = 'Hide prompts and outputs'; - var show_text = 'Show prompts and outputs'; - - // create and add the button to all the code blocks that contain >>> - div.each(function (index) { - var jthis = $(this); - if (jthis.find('.gp').length > 0) { - var button = $('>>>'); - button.attr('title', hide_text); - button.data('hidden', 'false'); - jthis.prepend(button); - } - // tracebacks (.gt) contain bare text elements that need to be - // wrapped in a span to work with .nextUntil() (see later) - jthis.find('pre:has(.gt)').contents().filter(function () { - return ((this.nodeType == 3) && (this.data.trim().length > 0)); - }).wrap(''); - }); - - // define the behavior of the button when it's clicked - $('.copybutton').click(function (e) { - e.preventDefault(); - var button = $(this); - if (button.data('hidden') === 'false') { - // hide the code output - button.parent().find('.go, .gp, .gt').hide(); - button.next('pre') - .find('.gt') - .nextUntil('.gp, .go') - .css('visibility', 'hidden'); - button.css('text-decoration', 'line-through'); - button.attr('title', show_text); - button.data('hidden', 'true'); - } else { - // show the code output - button.parent().find('.go, .gp, .gt').show(); - button.next('pre') - .find('.gt') - .nextUntil('.gp, .go') - .css('visibility', 'visible'); - button.css('text-decoration', 'none'); - button.attr('title', hide_text); - button.data('hidden', 'false'); - } - }); -}); \ No newline at end of file diff --git a/docs/cugraph/source/conf.py b/docs/cugraph/source/conf.py index abf6f985e06..bd58f7b62f7 100644 --- a/docs/cugraph/source/conf.py +++ b/docs/cugraph/source/conf.py @@ -212,7 +212,6 @@ def setup(app): app.add_css_file('params.css') app.add_css_file('references.css') - # pass source_suffix = ['.rst', '.md'] From 446c367b1e612b90ce48277479eb8002a15993dd Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Mon, 23 Aug 2021 11:28:38 -0500 Subject: [PATCH 8/9] Fix images code-path --- docs/cugraph/source/basics/nx_transition.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cugraph/source/basics/nx_transition.rst b/docs/cugraph/source/basics/nx_transition.rst index 6c57ab89c19..3d116162c09 100644 --- a/docs/cugraph/source/basics/nx_transition.rst +++ b/docs/cugraph/source/basics/nx_transition.rst @@ -40,7 +40,7 @@ While module can be assigned any name can be used, we picked cnx to reduce the amount of text to be changed. The text highlighted in yellow indicates changes. -.. image:: ./images/Nx_Cg_1.png +.. image:: ../images/Nx_Cg_1.png :width: 600 It is that easy. All algorithms in cuGraph support a NetworkX graph object as @@ -191,7 +191,7 @@ If your code follows the above model of inserting one element at a time, the we Now, if your code bulk loads the data from Pandas, then RAPIDS can accelerate that process by orders of magnitude. -.. image:: ./images/Nx_Cg_2.png +.. image:: ../images/Nx_Cg_2.png :width: 600 The above cuGraph code will create cuGraph.Graph object and not a NetworkX.Graph object. From 26776abd2f810759ac8a78559e7c352d634f5c80 Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Mon, 23 Aug 2021 11:36:45 -0500 Subject: [PATCH 9/9] add copybutton --- docs/cugraph/source/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/cugraph/source/conf.py b/docs/cugraph/source/conf.py index bd58f7b62f7..7857a4f0ace 100644 --- a/docs/cugraph/source/conf.py +++ b/docs/cugraph/source/conf.py @@ -53,6 +53,7 @@ "IPython.sphinxext.ipython_directive", "nbsphinx", "recommonmark", + "sphinx_copybutton", ] @@ -72,7 +73,7 @@ # General information about the project. project = 'cugraph' -copyright = '2019-2020, NVIDIA' +copyright = '2019-2021, NVIDIA' author = 'NVIDIA' # The version info for the project you're documenting, acts as replacement for