Skip to content

Commit

Permalink
Use nbsphinx for now
Browse files Browse the repository at this point in the history
  • Loading branch information
tribal-tec committed Jul 24, 2018
1 parent d3fc8bf commit 9cddddd
Show file tree
Hide file tree
Showing 7 changed files with 168 additions and 115 deletions.
9 changes: 3 additions & 6 deletions python/doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

# If your documentation needs a minimal Sphinx version, state it here.
#
needs_sphinx = '1.6.1'
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Expand All @@ -44,7 +44,7 @@
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.viewcode',
'RunNotebook.notebook_sphinxext'
'nbsphinx'
]

# Add any paths that contain templates here, relative to this directory.
Expand All @@ -69,7 +69,7 @@
# 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', '**.ipynb_checkpoints']
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
Expand Down Expand Up @@ -166,6 +166,3 @@
autosummary_generate = True
autodoc_default_flags = ['show-inheritance']
autoclass_content = 'both'

run_notebook_export_template = 'basic'
run_notebook_display_source_links = False
11 changes: 2 additions & 9 deletions python/doc/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,5 @@ Find some common use-cases as examples below how to interact with Brayns from py
.. toctree::
:maxdepth: 2

Take a snapshot
---------------

.. notebook:: ../../examples/snapshot.ipynb

Load a new model
----------------

.. notebook:: ../../examples/load_model.ipynb
snapshot.ipynb
load_model.ipynb
97 changes: 97 additions & 0 deletions python/doc/source/load_model.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Load model"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"from brayns import Client\n",
"brayns = Client('localhost:8200')"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{u'bounding_box': False,\n",
" u'bounds': {u'max': [6.835937976837158, 4.257812023162842, 4.921875],\n",
" u'min': [-6.835937976837158, -4.257812023162842, -4.921875]},\n",
" u'id': 2,\n",
" u'metadata': {},\n",
" u'name': u'monkey',\n",
" u'path': u'/home/nachbaur/dev/viz.stable/Brayns/python/doc/source/../../../tests/files/monkey.xyz',\n",
" u'transformation': {u'rotation': [0.0, 0.0, 0.0, 1.0],\n",
" u'scale': [1.0, 1.0, 1.0],\n",
" u'translation': [0.0, 0.0, 0.0]},\n",
" u'visible': True}"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import os \n",
"brayns.add_model(os.getcwd() + '/../../../tests/files/monkey.xyz')"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e47e6ef0d2f14c4fa4441c9cf1783e09",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"SW1hZ2UodmFsdWU9J1x4ZmZceGQ4XHhmZlx4ZTBceDAwXHgxMEpGSUZceDAwXHgwMVx4MDFceDAxXHgwMEhceDAwSFx4MDBceDAwXHhmZlx4ZGJceDAwQ1x4MDBceDAzXHgwMlx4MDJceDAzXHjigKY=\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"brayns.show()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.12"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
63 changes: 63 additions & 0 deletions python/doc/source/snapshot.ipynb

Large diffs are not rendered by default.

54 changes: 0 additions & 54 deletions python/examples/load_model.ipynb

This file was deleted.

44 changes: 0 additions & 44 deletions python/examples/snapshot.ipynb

This file was deleted.

5 changes: 3 additions & 2 deletions python/requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ coverage~=4.5.1
nosexcover~=1.0.11
tox~=3.1.2
mock~=2.0.0
Sphinx~=1.6.1
Sphinx~=1.7.6
sphinx_rtd_theme~=0.4.0
RunNotebook~=0.2.1
nbsphinx~=0.3.3
pandoc~=1.0.2

0 comments on commit 9cddddd

Please sign in to comment.