Skip to content

Commit

Permalink
Docs: Add example notebooks (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
ameyer-rigetti authored Jul 26, 2021
1 parent de2ceb3 commit 4ce929e
Show file tree
Hide file tree
Showing 10 changed files with 1,569 additions and 26 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
key: poetry-${{ hashFiles('poetry.lock') }}
- name: Check style
run: |
sudo apt update
. scripts/ci_install_deps
poetry run make check-style
Expand All @@ -42,7 +41,6 @@ jobs:
key: poetry-${{ hashFiles('poetry.lock') }}
- name: Check types
run: |
sudo apt update
. scripts/ci_install_deps
poetry run make check-types
Expand All @@ -64,7 +62,6 @@ jobs:
key: poetry-${{ hashFiles('poetry.lock') }}
- name: Test (Python ${{ matrix.python-version }})
run: |
sudo apt update
. scripts/ci_install_deps
docker run --rm -itd -p 5555:5555 --entrypoint bash rigetti/quilc -c "curl -L -o qelib1.inc https://raw.githubusercontent.com/Qiskit/qiskit-terra/0.16.2/qiskit/qasm/libs/qelib1.inc && ./quilc -S -P"
docker run --rm -itd -p 5000:5000 rigetti/qvm -S
Expand All @@ -88,6 +85,7 @@ jobs:
SPHINXOPTS: "-W"
run: |
sudo apt update
sudo apt install pandoc
. scripts/ci_install_deps "-E docs"
poetry run make docs
Expand All @@ -107,6 +105,5 @@ jobs:
- name: Check Licenses
# This is an exact match list, new dependencies will likely require their own entries
run: |
sudo apt update
. scripts/ci_install_deps
poetry run pip-licenses --allow-only="MIT License;Apache Software License;BSD License;GNU Lesser General Public License v2 or later (LGPLv2+);Python Software Foundation License;Apache License 2.0;new BSD;Apache-2.0;ISCL;ISC License (ISCL);BSD;Mozilla Public License 2.0 (MPL 2.0)"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
README.rst

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,4 @@ Dependencies are managed with [Poetry](https://python-poetry.org/) so you need t
1. Check style only: `make check-style`
1. Check types only: `make check-types`
1. Reformat all code (to make `check-style` pass): `make format`
1. Build documentation, serve locally, and watch for changes: `make watch-docs`
1. Build documentation, serve locally, and watch for changes: `make watch-docs` (requires `docs` extra: `poetry install -E docs`)
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"autoapi.extension",
"sphinx.ext.napoleon",
"myst_parser",
"nbsphinx",
"sphinx.ext.mathjax",
]

source_suffix = {
Expand All @@ -42,8 +44,9 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "**.ipynb_checkpoints"]

myst_update_mathjax = False

# -- Options for HTML output -------------------------------------------------
html_theme = "furo"
Expand Down
336 changes: 336 additions & 0 deletions docs/examples/qaoa_pyquil.ipynb

Large diffs are not rendered by default.

714 changes: 714 additions & 0 deletions docs/examples/qaoa_qiskit.ipynb

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ This documentation supports light ☀️ and dark 🌙 modes and will automatica
:end-before: Development
```

```{toctree}
:maxdepth: 1
:caption: Examples
examples/qaoa_qiskit.ipynb
examples/qaoa_pyquil.ipynb
```

```{toctree}
:maxdepth: 2
:caption: API Reference
Expand Down
Loading

0 comments on commit 4ce929e

Please sign in to comment.