Skip to content

Commit

Permalink
Merge pull request #37 from QuTech-Delft/fix/qnebe-640/readthedoc
Browse files Browse the repository at this point in the history
[QNEBE-640] Readthedoc fix
  • Loading branch information
QFer authored Jul 27, 2023
2 parents 5bb08ef + b843ed9 commit 72a0a02
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*.log
**/log/*
*.pkl
/docs/build/*
/docs/_build/*
/build/*
/dist/*
/*.egg-info/*
Expand Down
21 changes: 18 additions & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
version: 2

build:
image: latest

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

python:
version: 3.8
setup_py_install: true
pip_install: true
version: "3.8"
install:
- requirements: docs/requirements.txt
- method: pip
path: .

formats:
- pdf
- epub
5 changes: 2 additions & 3 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = .
BUILDDIR = build
PYTHON3 = python3
BUILDDIR = _build
PYTHON3 = python
# TODO handle like this?
export NETQASM_SIMULATOR = debug

Expand All @@ -19,7 +19,6 @@ help:
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)


python-deps:
@${PYTHON3} -m pip install -r requirements.txt

Expand Down
2 changes: 1 addition & 1 deletion docs/api_root.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ netqasm package
netqasm.logging
netqasm.runtime
netqasm.sdk
netqasm.util
netqasm.util
8 changes: 0 additions & 8 deletions docs/api_sdk/netqasm.sdk.compiling.rst

This file was deleted.

13 changes: 8 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,25 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
from importlib.metadata import version as get_release_version
# import os
import re
# import sys

# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = "netqasm"
copyright = "2021, QuTech"
copyright = "2023, QuTech"
author = "QuTech"

# The full version, including alpha/beta/rc tags
from importlib.metadata import version

release = version("netqasm")
release = get_release_version("netqasm")

# The short X.Y version.
version = re.match(r'^(\d+\.\d+)', release).expand(r'\1')

# -- General configuration ---------------------------------------------------

Expand Down Expand Up @@ -84,4 +87,4 @@
# 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_static_path = ["_static"]
4 changes: 3 additions & 1 deletion docs/netqasm.examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ netqasm\.examples
api_examples/netqasm.examples.apps
api_examples/netqasm.examples.lib
api_examples/netqasm.examples.netqasm_files
api_examples/netqasm.examples.sdk_examples
api_examples/netqasm.examples.qne_apps
api_examples/netqasm.examples.sdk_compilation
api_examples/netqasm.examples.sdk_scripts
5 changes: 2 additions & 3 deletions docs/netqasm.sdk.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
netqasm\.sdk
================
============

.. toctree::
:caption: Modules
:maxdepth: 2

api_sdk/netqasm.sdk.builder
api_sdk/netqasm.sdk.classical_communication
api_sdk/netqasm.sdk.compiling
api_sdk/netqasm.sdk.config
api_sdk/netqasm.sdk.connection
api_sdk/netqasm.sdk.epr_socket
Expand All @@ -17,4 +16,4 @@ netqasm\.sdk
api_sdk/netqasm.sdk.progress_bar
api_sdk/netqasm.sdk.qubit
api_sdk/netqasm.sdk.shared_memory
api_sdk/netqasm.sdk.toolbox
api_sdk/netqasm.sdk.toolbox
15 changes: 7 additions & 8 deletions docs/quickstart/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ NetQASM connection
:noindex:
:special-members: __enter__, __exit__
:members:
:undoc-members: app_name, node_name, app_id, flush, block
:undoc-members: app_name, node_name, app_id, flush, block

Qubit
-----
Expand All @@ -61,7 +61,7 @@ Qubit
.. autoclass:: Qubit
:noindex:
:members:
:undoc-members: qubit_id, entanglement_info, remote_entangled_node, measure,
:undoc-members: qubit_id, entanglement_info, remote_entangled_node, measure,
X, Y, Z, H, S, K, T,
rot_X, rot_Y, rot_Z,
cnot, cphase, reset, free
Expand All @@ -74,8 +74,8 @@ EPR socket

.. autoclass:: EPRSocket
:members:
:undoc-members: conn, remote_app_name, remote_node_id, epr_socket_id, remote_epr_socket_id, min_fidelity,
create, recv,
:undoc-members: conn, remote_app_name, remote_node_id, epr_socket_id, remote_epr_socket_id, min_fidelity,
create, recv,
:noindex:

.. automethod:: create_context(number=1, sequential=False)
Expand All @@ -92,20 +92,19 @@ Futures

.. autoclass:: Future
:members:
:undoc-members: add, value
:undoc-members: add, value
:noindex:

.. autoclass:: Array
:members:
:undoc-members: get_future_index, get_future_slice, foreach, enumerate
:undoc-members: get_future_index, get_future_slice, foreach, enumerate
:noindex:

.. autoclass:: RegFuture
:members:
:undoc-members: add, value
:undoc-members: add, value
:noindex:


Classical communication
-----------------------

Expand Down
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
sphinx>=3.5.3,<4.0.0
sphinx-rtd-theme>=0.5.2,<1.0.0
sphinx-autodoc-typehints>=1.11.1,<2.0.0
jinja2<3.0.0
MarkupSafe==2.0.1

0 comments on commit 72a0a02

Please sign in to comment.