Commit 54617718 authored by Olivier Cots's avatar Olivier Cots
Browse files

Merge branch 'feature/doc' into 'develop'

Feature/doc

See merge request !241
parents f1744be3 a44b6eea
......@@ -2,9 +2,6 @@
import os
import sys
#import pkg_resources
#sys.path.insert(0, os.path.abspath('../../src'))
# Use sphinx-quickstart to create your own conf.py file!
# After that, you have to edit a few things. See below.
......@@ -13,41 +10,19 @@ import sys
# ----------------------------------------------------------------------------------------
# Select nbsphinx and, if needed, other Sphinx extensions:
extensions = [
# 'matplotlib.sphinxext.plot_directive',
'sphinx.ext.autodoc', # for generation of api documentation
'sphinx.ext.napoleon', # numpy docstrings
'sphinx.ext.intersphinx', # to reference others projects, as numpy.ndarray
# 'sphinx.ext.doctest', # for the presentation of result in api documentation examples
'recommonmark', # for the use of markdown files for the documentation
'nbsphinx',
'nbsphinx_link', # A sphinx extension for including notebook files from outside the sphinx source root.
'sphinx_copybutton', # for "copy to clipboard" buttons
'sphinx.ext.mathjax', # for math equations
'nbsphinx_link', # A sphinx extension for including notebook files from outside the sphinx source root.
'sphinx_copybutton', # for "copy to clipboard" buttons
'sphinx.ext.mathjax', # for math equations
'sphinx.ext.viewcode',
'sphinxcontrib.bibtex', # for bibliographic references
# 'sphinxcontrib.rsvgconverter', # for SVG->PDF conversion in LaTeX output
'sphinx_gallery.load_style', # load CSS for gallery (needs SG >= 0.6)
'sphinxcontrib.bibtex', # for bibliographic references
'sphinx_gallery.load_style', # load CSS for gallery (needs SG >= 0.6)
]
## Napoleon settings
napoleon_google_docstring = False
napoleon_numpy_docstring = True
#napoleon_include_init_with_doc = False
#napoleon_include_private_with_doc = False
#napoleon_include_special_with_doc = True
napoleon_use_admonition_for_examples = True
napoleon_use_admonition_for_notes = True
napoleon_use_admonition_for_references = True
napoleon_use_ivar = True
napoleon_use_param = False
napoleon_use_rtype = False
#napoleon_use_keyword = True
# images for the gallery
nbsphinx_thumbnails = {
'irrigation/irrigation': 'irrigation/image.png',
'irrigation_and_rainfall/irrigation_and_rainfall': 'irrigation_and_rainfall/image.png',
'irrigation/irrigation': 'irrigation/image.jpg',
'irrigation_and_rainfall/irrigation_and_rainfall': 'irrigation_and_rainfall/image.jpg',
'solarsail/solarsail-simple-version': 'solarsail/solarsail.jpeg',
'substrate/depletion': 'substrate/depletion.png',
'bacteria/bacteria': 'bacteria/maintenance.png',
......@@ -66,15 +41,6 @@ nbsphinx_thumbnails = {
'geometry2D/ellipsoid/ellipsoid': 'geometry2D/ellipsoid/ellipsoid.png',
}
#intersphinx_mapping = {
# 'python': ('https://docs.python.org/', None),
# 'numpy': ('http://docs.scipy.org/doc/numpy/', None)
#}
intersphinx_mapping = {'python': ('http://docs.python.org/', None),
'numpy': ('http://docs.scipy.org/doc/numpy', None),
'scipy': ('http://docs.scipy.org/doc/scipy/reference', None),
'matplotlib': ('http://matplotlib.sourceforge.net', None)}
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
......@@ -83,15 +49,6 @@ pygments_style = 'sphinx'
# Exclude build directory and Jupyter backup files:
exclude_patterns = ['_build', '**.ipynb_checkpoints', 'Thumbs.db', '.DS_Store']
# Default language for syntax highlighting in reST and Markdown cells:
highlight_language = 'none'
# Don't add .txt suffix to source files:
#html_sourcelink_suffix = ''
# Work-around until https://github.com/sphinx-doc/sphinx/issues/4229 is solved:
#html_scaled_image_link = False
# List of arguments to be passed to the kernel that executes the notebooks:
# If you use Matplotlib for plots, this setting is recommended:
nbsphinx_execute_arguments = [
......@@ -102,43 +59,10 @@ nbsphinx_execute_arguments = [
nbsphinx_execute = 'never'
# To get a prompt similar to the Classic Notebook, use
nbsphinx_input_prompt = ' In [%s]:'
nbsphinx_output_prompt = ' Out [%s]:'
#nbsphinx_input_prompt = ' In [%s]:'
#nbsphinx_output_prompt = ' Out [%s]:'
#nbsphinx_prompt_width = '10'
# Use a different kernel than stored in the notebook metadata, e.g.:
# nbsphinx_kernel_name = 'python3'
# Environment variables to be passed to the kernel:
#os.environ['MY_DUMMY_VARIABLE'] = 'Hello from conf.py!'
#nbsphinx_thumbnails = {
# 'gallery/thumbnail-from-conf-py': 'gallery/a-local-file.png',
# 'gallery/*-rst': '_static/copy-button.svg',
#}
# --------------------------------------------
# --------------------------------------------
# Debut : Cette partie ne fonctionne pas
# --------------------------------------------
# --------------------------------------------
## This is processed by Jinja2 and inserted before each notebook
#nbsphinx_prolog = """
#{% set docname = env.doc2path(env.docname, base=None) %}
#
#.. only:: html
#
# Mettre ici un lien vers binder, etc. Pour l'instant, je ne sais pas comment faire.
# Il faut peut-être que le projet soit public.
# On peut comme ici mettre un texte automatique pour tous les notebooks. Voir https://github.com/spatialaudio/nbsphinx/tree/0.6.0.
# On peut aussi mettre le lien binder dans le notebook directement.
#
#.. only:: latex
#
# The following section was created from :file:`{{ docname }}`.
#"""
# This is processed by Jinja2 and inserted before each notebook
nbsphinx_prolog = r"""
{% set docname = 'examples/' + env.doc2path(env.docname, base=None) %}
......@@ -150,7 +74,7 @@ nbsphinx_prolog = r"""
<a class="reference external" href="https://gitlab.inria.fr/ct/gallery-env/-/blob/master/{{ docname|e }}">{{ docname|e }}</a>
<br>Run the notebook yourself on binder
<a href="https://mybinder.org/v2/git/https%3A%2F%2Fgitlab.inria.fr%2Fct%2Fgallery-env.git/master?urlpath=lab/tree/{{
docname|e }}"><img alt="Binder badge" src="https://static.mybinder.org/badge_logo.svg" style="vertical-align:text-bottom"></a>
docname|e }}"><img alt="Binder badge" src="https://static.mybinder.org/badge_logo.svg" style="vertical-align:text-bottom"></a>
</p>
</div>
......@@ -161,90 +85,15 @@ nbsphinx_prolog = r"""
\sphinxcode{\sphinxupquote{\strut {{ docname | escape_latex }}}} \dotfill}}
"""
# <script>
# if (document.location.host) {
# var p = document.currentScript.previousSibling.previousSibling;
# var a = document.createElement('a');
# a.innerHTML = 'View in <em>nbviewer</em>';
# a.href = `https://nbviewer.jupyter.org/url${
# (window.location.protocol == 'https:' ? 's/' : '/') +
# window.location.host +
# window.location.pathname.slice(0, -4) }ipynb`;
# a.classList.add('reference');
# a.classList.add('external');
# p.appendChild(a);
# p.appendChild(document.createTextNode('.'));
# }
# </script>
#nbsphinx_prolog = """
#----
#
#Generated by nbsphinx_ from a Jupyter_ notebook.
#
#.. _nbsphinx: https://nbsphinx.readthedocs.io/
#.. _Jupyter: https://jupyter.org/
#"""
#
#nbsphinx_prolog = """
#Go there: https://example.org/notebooks/{{ env.doc2path(env.docname, base=None) }}
#
#----
#"""
#
## This is processed by Jinja2 and inserted after each notebook
#nbsphinx_epilog = r"""
#{% set docname = 'doc/' + env.doc2path(env.docname, base=None) %}
#.. raw:: latex
# \nbsphinxstopnotebook{\scriptsize\noindent\strut
# \textcolor{gray}{\dotfill\ \sphinxcode{\sphinxupquote{\strut
# {{ docname | escape_latex }}}} ends here.}}
#"""
# --------------------------------------------
# --------------------------------------------
# Fin : Cette partie ne fonctionne pas
# --------------------------------------------
# --------------------------------------------
mathjax_config = {
'TeX': {'equationNumbers': {'autoNumber': 'AMS', 'useLabelIds': True}},
}
# Additional files needed for generating LaTeX/PDF output:
#latex_additional_files = ['references.bib']
# Support for notebook formats other than .ipynb
#nbsphinx_custom_formats = {
# '.pct.py': ['jupytext.reads', {'fmt': 'py:percent'}],
#}
# ----------------------------------------------------------------------------------------
# ----------------------------------------------------------------------------------------
# -- The settings below this line are not specific to nbsphinx ------------
#
# where we stop the documentation: when coming to fortran files
#autodoc_mock_imports = ['nutopy.mod_nlesolve',
# 'nutopy.mod_ivpsolve',
# 'nutopy.mod_pathsolve',
# ]
# Default processing flags for sphinx
autoclass_content = 'class'
autodoc_member_order = 'bysource'
autodoc_default_options = {
'members': True,
'undoc-members':True,
'show-inheritance':True
}
#autodoc_member_order = 'alphabetical' #'bysource'
add_module_names = False
add_function_parentheses = False
# The suffix(es) of source filenames.
source_suffix = {
'.rst': 'restructuredtext',
......@@ -252,40 +101,49 @@ source_suffix = {
}
#---sphinx-themes-----
html_theme = 'sphinx_rtd_theme'
html_theme = 'pydata_sphinx_theme'
# options for sphinx_rtd_theme: see https://sphinx-rtd-theme.readthedocs.io/en/stable/configuring.html#
html_theme_options = {
'canonical_url': '',
# 'analytics_id': 'UA-XXXXXXX-1', # Provided by Google in your dashboard
'logo_only': False,
'display_version': False,
'prev_next_buttons_location': 'bottom',
'style_external_links': False,
# 'style_nav_header_background': 'white',
# Toc options
'collapse_navigation': True,
'sticky_navigation': True,
'navigation_depth': 4,
'includehidden': True,
'titles_only': False
"collapse_navigation": True,
"navigation_depth": 2,
"show_toc_level": 2,
"use_edit_page_button": True,
"external_links": [
{"url": "https://ct.gitlabpages.inria.fr/bocop3/", "name": "Bocop Docs"},
{"url": "https://ct.gitlabpages.inria.fr/nutopy/", "name": "Nutopy Docs"}
],
"gitlab_url": "https://gitlab.inria.fr/ct/gallery",
"navbar_align": "left", # [left, content, right] For testing that the navbar items align properly
"navbar_end": ["search-field", "navbar-icon-links"], # Just for testing
"search_bar_text": "Search...",
#"page_sidebar_items": ["page-toc", "edit-this-page"],
#"footer_items": ["copyright", "sphinx-version", ""]
}
html_sidebars = {
"**": ["sidebar-nav-bs", "sidebar-ethical-ads"],
}
html_context = {
"gitlab_url": "https://gitlab.inria.fr", # or your self-hosted GitLab
"gitlab_user": "ct",
"gitlab_repo": "gallery",
"gitlab_version": "master",
"doc_path": "examples",
}
html_logo = 'logo-ct.svg'
author = 'Olivier Cots'
project = u'control toolbox gallery'
import time
copyright = u'%s, ct gallery project.' % time.strftime('%Y') # a changer
copyright = u'%s, ct gallery project' % time.strftime('%Y') # a changer
#version = '0.2' # a voir comment gerer doc et version
#release = '0.2.1'
html_logo = 'logo-ct.svg'
master_doc = 'index'
# Grab the setup entry
#distribution = pkg_resources.require(project)[0]
#linkcheck_ignore = [r'http://localhost:\d+/']
# -- Get version information and date from Git ----------------------------
......@@ -301,50 +159,4 @@ except Exception:
# -- Options for HTML output ----------------------------------------------
html_title = project #+ ' version ' + release
# -- Options for LaTeX output ---------------------------------------------
# See https://www.sphinx-doc.org/en/master/latex.html
#latex_elements = {
# 'papersize': 'a4paper',
# 'printindex': '',
# 'sphinxsetup': r"""
# %verbatimwithframe=false,
# %verbatimwrapslines=false,
# %verbatimhintsturnover=false,
# VerbatimColor={HTML}{F5F5F5},
# VerbatimBorderColor={HTML}{E0E0E0},
# noteBorderColor={HTML}{E0E0E0},
# noteborder=1.5pt,
# warningBorderColor={HTML}{E0E0E0},
# warningborder=1.5pt,
# warningBgColor={HTML}{FBFBFB},
# """,
# 'preamble': r"""
#\usepackage[sc,osf]{mathpazo}
#\linespread{1.05} % see http://www.tug.dk/FontCatalogue/urwpalladio/
#\renewcommand{\sfdefault}{pplj} % Palatino instead of sans serif
#\IfFileExists{zlmtt.sty}{
# \usepackage[light,scaled=1.05]{zlmtt} % light typewriter font from lmodern
#}{
# \renewcommand{\ttdefault}{lmtt} % typewriter font from lmodern
#}
#\usepackage{booktabs} % for Pandas dataframes
#""",
#}
#
#latex_documents = [
# (master_doc, 'nbsphinx.tex', project, author, 'howto'),
#]
#
#latex_show_urls = 'footnote'
#latex_show_pagerefs = True
# -- Options for EPUB output ----------------------------------------------
# These are just defined to avoid Sphinx warnings related to EPUB:
version = release
#suppress_warnings = ['epub.unknown_project_files']
html_title = "ct gallery" #+ ' version ' + release
**********
Dashboards
**********
Bacteria
========
.. image:: bacteria/bacteria-panel.jpeg
:width: 600
:alt: Bacteria
:align: center
:target: https://mybinder.org/v2/git/https%3A%2F%2Fgitlab.inria.fr%2Fct%2Fgallery-env.git/master?urlpath=%2Fproxy%2F5006%2Fbacteria-panel
Swimmer
=======
.. image:: swimmer/swimmer.jpeg
:width: 600
:alt: Swimmer
:align: center
:target: https://mybinder.org/v2/git/https%3A%2F%2Fgitlab.inria.fr%2Fct%2Fgallery-env.git/master?urlpath=%2Fproxy%2F5007%2Fswimmer
*********************
Welcome to ct gallery
#####################
*********************
Examples from the ct (control toolbox) project
using `bocop <https://ct.gitlabpages.inria.fr/bocop3>`_, `nutopy <https://ct.gitlabpages.inria.fr/nutopy>`_ and other packages.
Dashboards
**********
.. toctree::
:maxdepth: 2
.. image:: bacteria/bacteria-panel.jpeg
:height: 100
:target: https://mybinder.org/v2/git/https%3A%2F%2Fgitlab.inria.fr%2Fct%2Fgallery-env.git/master?urlpath=%2Fproxy%2F5006%2Fbacteria-panel
.. image:: swimmer/swimmer.jpeg
:height: 100
:target: https://mybinder.org/v2/git/https%3A%2F%2Fgitlab.inria.fr%2Fct%2Fgallery-env.git/master?urlpath=%2Fproxy%2F5007%2Fswimmer
Notebooks
*********
.. nbgallery::
:caption: Notebooks
:name: ocp-gallery
:glob:
:reversed:
sir/SIR
nlp_indirect/nlp2
nlp_indirect/nlp1
ihm/ihm
geometry2D/ellipsoid/ellipsoid
substrate/depletion
bacteria/bacteria
bistable/bistable
clr/clr
nav/nav-julia-N3
nav/nav
solarsail/solarsail-simple-version
kepler-c/kepler-c
kepler-py/kepler-py
kepler/kepler
regulator/regulator
goddard/goddard
smooth_case/smooth_case
shooting_tutorials/simple_shooting_general
dashboards
notebooks
......@@ -42,7 +42,9 @@
"\n",
"$$max_{u(.)} \\int_0^T \\phi(t)K_S(S(t))$$\n",
"\n",
"where $\\dot V = u(t)$ and $V(0)=0$ and the target : $V(T)=\\bar V=\\frac{\\bar Q}{F_{max}}$\n"
"where $\\dot V = u(t)$ and $V(0)=0$ and the target : $V(T)=\\bar V=\\frac{\\bar Q}{F_{max}}$\n",
"\n",
"[Thumbnail](image.jpg)"
]
},
{
......@@ -569,15 +571,15 @@
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.5.2",
"display_name": "Julia 1.6.0",
"language": "julia",
"name": "julia-1.5"
"name": "julia-1.6"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.5.2"
"version": "1.6.0"
}
},
"nbformat": 4,
......
......@@ -40,7 +40,9 @@
"\n",
"$$max_{u(.)} \\int_0^T \\phi(t)K_S(S(t))$$\n",
"\n",
"where $\\dot V = u(t)$ and $V(0)=0$ and the target : $V(T)=\\bar V=\\frac{\\bar Q}{F_{max}}$ "
"where $\\dot V = u(t)$ and $V(0)=0$ and the target : $V(T)=\\bar V=\\frac{\\bar Q}{F_{max}}$.\n",
"\n",
"[Thumbnail](image.jpg)"
]
},
{
......
Notebooks
=========
.. nbgallery::
shooting_tutorials/simple_shooting_general
smooth_case/smooth_case
goddard/goddard
regulator/regulator
kepler/kepler
kepler-py/kepler-py
kepler-c/kepler-c
solarsail/solarsail-simple-version
nav/nav
nav/nav-julia-N3
clr/clr
bistable/bistable
bacteria/bacteria
substrate/depletion
irrigation/irrigation
irrigation_and_rainfall/irrigation_and_rainfall
geometry2D/ellipsoid/ellipsoid
ihm/ihm
nlp_indirect/nlp1
nlp_indirect/nlp2
sir/SIR
......@@ -614,9 +614,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "ct-gallery",
"display_name": "Python 3",
"language": "python",
"name": "ct-gallery"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
......@@ -628,7 +628,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.10"
"version": "3.7.8"
}
},
"nbformat": 4,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment