Skip to content

Commit 4ce929e

Browse files
Docs: Add example notebooks (#13)
1 parent de2ceb3 commit 4ce929e

File tree

10 files changed

+1569
-26
lines changed

10 files changed

+1569
-26
lines changed

.github/workflows/test.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
key: poetry-${{ hashFiles('poetry.lock') }}
2424
- name: Check style
2525
run: |
26-
sudo apt update
2726
. scripts/ci_install_deps
2827
poetry run make check-style
2928
@@ -42,7 +41,6 @@ jobs:
4241
key: poetry-${{ hashFiles('poetry.lock') }}
4342
- name: Check types
4443
run: |
45-
sudo apt update
4644
. scripts/ci_install_deps
4745
poetry run make check-types
4846
@@ -64,7 +62,6 @@ jobs:
6462
key: poetry-${{ hashFiles('poetry.lock') }}
6563
- name: Test (Python ${{ matrix.python-version }})
6664
run: |
67-
sudo apt update
6865
. scripts/ci_install_deps
6966
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"
7067
docker run --rm -itd -p 5000:5000 rigetti/qvm -S
@@ -88,6 +85,7 @@ jobs:
8885
SPHINXOPTS: "-W"
8986
run: |
9087
sudo apt update
88+
sudo apt install pandoc
9189
. scripts/ci_install_deps "-E docs"
9290
poetry run make docs
9391
@@ -107,6 +105,5 @@ jobs:
107105
- name: Check Licenses
108106
# This is an exact match list, new dependencies will likely require their own entries
109107
run: |
110-
sudo apt update
111108
. scripts/ci_install_deps
112109
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)"

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ share/python-wheels/
3535
.installed.cfg
3636
*.egg
3737
MANIFEST
38+
README.rst
3839

3940
# PyInstaller
4041
# Usually these files are written by a python script from a template

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,4 @@ Dependencies are managed with [Poetry](https://python-poetry.org/) so you need t
170170
1. Check style only: `make check-style`
171171
1. Check types only: `make check-types`
172172
1. Reformat all code (to make `check-style` pass): `make format`
173-
1. Build documentation, serve locally, and watch for changes: `make watch-docs`
173+
1. Build documentation, serve locally, and watch for changes: `make watch-docs` (requires `docs` extra: `poetry install -E docs`)

docs/conf.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
"autoapi.extension",
1818
"sphinx.ext.napoleon",
1919
"myst_parser",
20+
"nbsphinx",
21+
"sphinx.ext.mathjax",
2022
]
2123

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

49+
myst_update_mathjax = False
4750

4851
# -- Options for HTML output -------------------------------------------------
4952
html_theme = "furo"

docs/examples/qaoa_pyquil.ipynb

+336
Large diffs are not rendered by default.

docs/examples/qaoa_qiskit.ipynb

+714
Large diffs are not rendered by default.

docs/index.md

+8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ This documentation supports light ☀️ and dark 🌙 modes and will automatica
99
:end-before: Development
1010
```
1111

12+
```{toctree}
13+
:maxdepth: 1
14+
:caption: Examples
15+
16+
examples/qaoa_qiskit.ipynb
17+
examples/qaoa_pyquil.ipynb
18+
```
19+
1220
```{toctree}
1321
:maxdepth: 2
1422
:caption: API Reference

0 commit comments

Comments
 (0)