Skip to content

Commit

Permalink
[docs] Convert Examples to Gallery (ray-project#5414)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardliaw authored Sep 24, 2019
1 parent ea9376c commit 10f21fa
Show file tree
Hide file tree
Showing 28 changed files with 966 additions and 885 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ matrix:
- export PATH="$HOME/miniconda/bin:$PATH"
- cd doc
- pip install -q -r requirements-doc.txt
- pip install -q yapf==0.23.0
- pip install -q yapf==0.23.0 sphinx-gallery
- sphinx-build -W -b html -d _build/doctrees source _build/html
- cd ..
# Run Python linting, ignore dict vs {} (C408), others are defaults
Expand Down
11 changes: 11 additions & 0 deletions ci/jenkins_tests/run_multi_node_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ DOCKER_SHA=$($ROOT_DIR/../../build-docker.sh --output-sha --no-cache)
SUPPRESS_OUTPUT=$ROOT_DIR/../suppress_output
echo "Using Docker image" $DOCKER_SHA

######################## EXAMPLE TESTS #################################

$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} $DOCKER_SHA \
python /ray/doc/examples/plot_pong_example.py

$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} $DOCKER_SHA \
python /ray/doc/examples/plot_parameter_server.py

$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} $DOCKER_SHA \
python /ray/doc/examples/plot_hyperparameter.py

######################## RLLIB TESTS #################################

source $ROOT_DIR/run_rllib_tests.sh
Expand Down
1 change: 1 addition & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto_examples/
3 changes: 2 additions & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
AUTOGALLERYDIR= source/auto_examples

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
Expand Down Expand Up @@ -49,7 +50,7 @@ help:
@echo " coverage to run coverage check of the documentation (if enabled)"

clean:
rm -rf $(BUILDDIR)/*
rm -rf $(BUILDDIR)/* $(AUTOGALLERYDIR)

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
Expand Down
Empty file added doc/examples/README.rst
Empty file.
19 changes: 4 additions & 15 deletions doc/examples/cython/cython_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,12 @@ def example8():
"""Cython with blas. NOTE: requires scipy"""

# See cython_blas.pyx for argument documentation
mat = np.array([[[2.0, 2.0], [2.0, 2.0]], [[2.0, 2.0], [2.0, 2.0]]],
dtype=np.float32)
mat = np.array(
[[[2.0, 2.0], [2.0, 2.0]], [[2.0, 2.0], [2.0, 2.0]]], dtype=np.float32)
result = np.zeros((2, 2), np.float32, order="C")

run_func(cyth.compute_kernel_matrix,
"L",
"T",
2,
2,
1.0,
mat,
0,
2,
1.0,
result,
2
)
run_func(cyth.compute_kernel_matrix, "L", "T", 2, 2, 1.0, mat, 0, 2, 1.0,
result, 2)


if __name__ == "__main__":
Expand Down
15 changes: 7 additions & 8 deletions doc/examples/cython/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@
modules = [os.path.join(pkg_dir, module) for module in modules]

setup(
name=pkg_dir,
version="0.0.1",
description="Cython examples for Ray",
packages=[pkg_dir],
ext_modules=cythonize(modules),
install_requires=install_requires,
include_dirs=include_dirs
)
name=pkg_dir,
version="0.0.1",
description="Cython examples for Ray",
packages=[pkg_dir],
ext_modules=cythonize(modules),
install_requires=install_requires,
include_dirs=include_dirs)
154 changes: 0 additions & 154 deletions doc/examples/hyperopt/hyperopt_adaptive.py

This file was deleted.

100 changes: 0 additions & 100 deletions doc/examples/hyperopt/hyperopt_simple.py

This file was deleted.

Loading

0 comments on commit 10f21fa

Please sign in to comment.