Skip to content

Commit

Permalink
Change raft docs theme to pydata-sphinx-theme (#1026)
Browse files Browse the repository at this point in the history
Similar to rapidsai/cuml#4985, this PR changes the docs theme for `raft` to be in-line with rest of the rapids docs theme.

Authors:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)
  - AJ Schmidt (https://github.com/ajschmidt8)

URL: #1026
  • Loading branch information
galipremsagar authored Nov 18, 2022
1 parent f6e5226 commit 5a00013
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 265 deletions.
10 changes: 5 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ARGS=$*
# script, and that this script resides in the repo dir!
REPODIR=$(cd $(dirname $0); pwd)

VALIDARGS="clean libraft pylibraft raft-dask docs tests bench clean -v -g --install --compile-libs --compile-nn --compile-dist --allgpuarch --no-nvtx --show_depr_warn -h --buildfaiss --minimal-deps"
VALIDARGS="clean libraft pylibraft raft-dask docs tests bench clean -v -g -n --compile-libs --compile-nn --compile-dist --allgpuarch --no-nvtx --show_depr_warn -h --buildfaiss --minimal-deps"
HELP="$0 [<target> ...] [<flag> ...] [--cmake-args=\"<args>\"] [--cache-tool=<tool>] [--limit-tests=<targets>] [--limit-bench=<targets>]
where <target> is:
clean - remove all existing build artifacts and configuration (start over)
Expand All @@ -33,6 +33,7 @@ HELP="$0 [<target> ...] [<flag> ...] [--cmake-args=\"<args>\"] [--cache-tool=<to
and <flag> is:
-v - verbose build mode
-g - build for debug
-n - no install step
--compile-libs - compile shared libraries for all components
--compile-nn - compile shared library for nn component
--compile-dist - compile shared library for distance and current random components
Expand All @@ -44,7 +45,6 @@ HELP="$0 [<target> ...] [<flag> ...] [--cmake-args=\"<args>\"] [--cache-tool=<to
--limit-bench - semicolon-separated list of benchmark executables to compute (e.g. NEIGHBORS_BENCH;CLUSTER_BENCH)
--allgpuarch - build for all supported GPU architectures
--buildfaiss - build faiss statically into raft
--install - install cmake targets
--no-nvtx - disable nvtx (profiling markers), but allow enabling it in downstream projects
--show_depr_warn - show cmake deprecation warnings
--cmake-args=\\\"<args>\\\" - pass arbitrary list of CMake configuration options (escape all quotes in argument)
Expand Down Expand Up @@ -72,6 +72,7 @@ COMPILE_LIBRARIES=OFF
COMPILE_NN_LIBRARY=OFF
COMPILE_DIST_LIBRARY=OFF
ENABLE_NN_DEPENDENCIES=OFF
INSTALL_TARGET=install

TEST_TARGETS="CLUSTER_TEST;CORE_TEST;DISTANCE_TEST;LABEL_TEST;LINALG_TEST;MATRIX_TEST;RANDOM_TEST;SOLVERS_TEST;SPARSE_TEST;SPARSE_DIST_TEST;SPARSE_NEIGHBORS_TEST;NEIGHBORS_TEST;STATS_TEST;UTILS_TEST"
BENCH_TARGETS="CLUSTER_BENCH;NEIGHBORS_BENCH;DISTANCE_BENCH;LINALG_BENCH;MATRIX_BENCH;SPARSE_BENCH;RANDOM_BENCH"
Expand All @@ -83,7 +84,6 @@ CLEAN=0
UNINSTALL=0
DISABLE_DEPRECATION_WARNINGS=ON
CMAKE_TARGET=""
INSTALL_TARGET=""

# Set defaults for vars that may not have been defined externally
# FIXME: if INSTALL_PREFIX is not set, check PREFIX, then check
Expand Down Expand Up @@ -191,8 +191,8 @@ if (( ${NUMARGS} != 0 )); then
fi

# Process flags
if hasArg --install; then
INSTALL_TARGET="install"
if hasArg -n; then
INSTALL_TARGET=""
fi

if hasArg --minimal-deps; then
Expand Down
2 changes: 1 addition & 1 deletion ci/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,5 @@ pytest --cache-clear --junitxml="$WORKSPACE/junit-raft-dask.xml" -v -s
if [ "$(arch)" = "x86_64" ]; then
gpuci_logger "Building docs"
gpuci_mamba_retry install "rapids-doc-env=${MINOR_VERSION}.*"
"$WORKSPACE/build.sh" docs -v
"$WORKSPACE/build.sh" docs -v -n
fi
2 changes: 1 addition & 1 deletion conda/recipes/libraft/build_libraft_distance.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
# Copyright (c) 2022, NVIDIA CORPORATION.

./build.sh libraft --install -v --allgpuarch --compile-dist --no-nvtx
./build.sh libraft -v --allgpuarch --compile-dist --no-nvtx
2 changes: 1 addition & 1 deletion conda/recipes/libraft/build_libraft_headers.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
# Copyright (c) 2022, NVIDIA CORPORATION.

./build.sh libraft --install -v --allgpuarch --no-nvtx
./build.sh libraft -v --allgpuarch --no-nvtx
2 changes: 1 addition & 1 deletion conda/recipes/libraft/build_libraft_nn.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
# Copyright (c) 2022, NVIDIA CORPORATION.

./build.sh libraft --install -v --allgpuarch --compile-nn --no-nvtx
./build.sh libraft -v --allgpuarch --compile-nn --no-nvtx
2 changes: 1 addition & 1 deletion conda/recipes/pylibraft/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#!/usr/bin/env bash

# This assumes the script is executed from the root of the repo directory
./build.sh pylibraft --install --no-nvtx
./build.sh pylibraft --no-nvtx
3 changes: 1 addition & 2 deletions conda/recipes/raft-dask/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright (c) 2022, NVIDIA CORPORATION.
#!/usr/bin/env bash
# Copyright (c) 2022, NVIDIA CORPORATION.

# This assumes the script is executed from the root of the repo directory
./build.sh raft-dask --install --no-nvtx
./build.sh raft-dask --no-nvtx
42 changes: 0 additions & 42 deletions docs/source/_static/copybutton.css

This file was deleted.

61 changes: 0 additions & 61 deletions docs/source/_static/example_mod.js

This file was deleted.

87 changes: 0 additions & 87 deletions docs/source/_static/infoboxes.css

This file was deleted.

17 changes: 11 additions & 6 deletions docs/source/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,14 @@ The recommended way to build and install RAFT is to use the `build.sh` script in

`build.sh` uses [rapids-cmake](https://github.com/rapidsai/rapids-cmake), which will automatically download any dependencies which are not already installed. It's important to note that while all the headers will be installed and available, some parts of the RAFT API depend on libraries like `FAISS`, which will need to be explicitly enabled in `build.sh`.

The following example will download the needed dependencies and install the RAFT headers into `$INSTALL_PREFIX/include/raft`. The `--install` flag can be omitted to just have the build download the needed dependencies. Since RAFT is primarily used at build-time, the dependencies will never be installed by the RAFT build, with the exception of building FAISS statically into the shared libraries.
The following example will download the needed dependencies and install the RAFT headers into `$INSTALL_PREFIX/include/raft`.
```bash
./build.sh libraft --install
./build.sh libraft

```
The `-n` flag can be passed to just have the build download the needed dependencies. Since RAFT is primarily used at build-time, the dependencies will never be installed by the RAFT build, with the exception of building FAISS statically into the shared libraries.
```bash
./build.sh libraft -n
```

### C++ Shared Libraries (optional)
Expand All @@ -53,7 +58,7 @@ Individual shared libraries have their own flags and multiple can be used (thoug
./build.sh libraft --compile-nn --compile-dist
```

Add the `--install` flag to the above example to also install the shared libraries into `$INSTALL_PREFIX/lib`.
In above example the shared libraries are installed by default into `$INSTALL_PREFIX/lib`. To disable this, pass `-n` flag.

### ccache and sccache

Expand Down Expand Up @@ -148,9 +153,9 @@ The Python APIs can be built and installed using the `build.sh` script:

```bash
# to build pylibraft
./build.sh libraft pylibraft --install --compile-libs
./build.sh libraft pylibraft --compile-libs
# to build raft-dask
./build.sh libraft raft-dask --install --compile-libs
./build.sh libraft raft-dask --compile-libs
```

`setup.py` can also be used to build the Python APIs manually:
Expand Down Expand Up @@ -181,7 +186,7 @@ The documentation requires that the C++ headers and python packages have been bu
The following will build the docs along with the C++ and Python packages:

```
./build.sh libraft pylibraft raft-dask docs --compile-libs --install
./build.sh libraft pylibraft raft-dask docs --compile-libs
```


Expand Down
26 changes: 10 additions & 16 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"breathe",
"recommonmark",
"sphinx_markdown_tables",
"sphinx_copybutton"
]

breathe_default_project = "RAFT"
Expand Down Expand Up @@ -112,32 +113,27 @@
# 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"

if not on_rtd:
# 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()]

# 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/raft",
"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,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

html_js_files = ["example_mod.js"]
html_js_files = []

# -- Options for HTMLHelp output ------------------------------------------

Expand Down Expand Up @@ -203,8 +199,6 @@


def setup(app):
app.add_css_file("copybutton.css")
app.add_css_file("infoboxes.css")
app.add_css_file("references.css")
app.add_css_file("https://docs.rapids.ai/assets/css/custom.css")
app.add_js_file(
Expand Down
Loading

0 comments on commit 5a00013

Please sign in to comment.