-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOCS: improved documentation using citet and citep for references, ma…
…kefiles for unix and windows to avoid having to use tox, use pydata theme rather than read the docs and improve docstrings for classes SIES and ES. Add badges for project visibility.
- Loading branch information
1 parent
f616c88
commit 35730bf
Showing
18 changed files
with
427 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. | ||
Template for the html base rendering | ||
{{ fullname | escape | underline}} | ||
|
||
.. currentmodule:: {{ module }} | ||
|
||
.. auto{{ objtype }}:: {{ objname }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.. | ||
Template for the html class rendering | ||
{{ fullname | escape | underline}} | ||
|
||
.. currentmodule:: {{ module }} | ||
|
||
.. autoclass:: {{ objname }} | ||
:members: | ||
:private-members: | ||
:show-inheritance: | ||
:inherited-members: | ||
|
||
{% block methods %} | ||
.. automethod:: __init__ | ||
{% endblock %} | ||
|
||
.. rubric:: {{ _('Methods definition') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
.. | ||
Template for the html module rendering | ||
{{ fullname | escape | underline}} | ||
|
||
.. automodule:: {{ fullname }} | ||
|
||
{% block attributes %} | ||
{% if attributes %} | ||
.. rubric:: {{ _('Module Attributes') }} | ||
|
||
.. autosummary:: | ||
{% for item in attributes %} | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block functions %} | ||
{% if functions %} | ||
.. rubric:: {{ _('Functions') }} | ||
|
||
.. autosummary:: | ||
{% for item in functions %} | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block classes %} | ||
{% if classes %} | ||
.. rubric:: {{ _('Classes') }} | ||
|
||
.. autosummary:: | ||
{% for item in classes %} | ||
:template: class.rst | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block exceptions %} | ||
{% if exceptions %} | ||
.. rubric:: {{ _('Exceptions') }} | ||
|
||
.. autosummary:: | ||
{% for item in exceptions %} | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block modules %} | ||
{% if modules %} | ||
.. rubric:: Modules | ||
|
||
.. autosummary:: | ||
:toctree: | ||
:recursive: | ||
{% for item in modules %} | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
API reference | ||
.. _api_ref: | ||
|
||
============= | ||
API Reference | ||
============= | ||
|
||
.. currentmodule:: iterative_ensemble_smoother | ||
.. automodule:: iterative_ensemble_smoother | ||
|
||
.. autoclass:: iterative_ensemble_smoother.SIES | ||
:members: | ||
.. raw:: latex | ||
|
||
.. autoclass:: iterative_ensemble_smoother.ESMDA | ||
:members: | ||
\clearpage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ Bibliography | |
============ | ||
|
||
.. bibliography:: | ||
:all: | ||
:labelprefix: Bib- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,168 @@ | ||
""" | ||
iterative_ensemble_smoother documentation build configuration file. | ||
""" | ||
import datetime | ||
import os | ||
import re | ||
import sys | ||
from subprocess import check_output | ||
|
||
import iterative_ensemble_smoother as ies | ||
|
||
package_path = os.path.abspath("..") | ||
sys.path.insert(0, package_path) | ||
|
||
project = "iterative_ensemble_smoother" | ||
copyright = "2022, Equinor" | ||
author = "Equinor" | ||
release = "0.1.1" | ||
|
||
copyright = f"2022-{datetime.datetime.today().year}, {author}" | ||
# The default replacements for |version| and |release|, also used in various | ||
# other places throughout the built documents. | ||
version = re.sub(r"\.dev.*$", r".dev", ies.__version__) | ||
release = version | ||
|
||
# convert the python file to a notebook | ||
check_output(["jupytext", "Polynomial.py", "-o", "Polynomial.ipynb"]) | ||
|
||
# Do the same for this file | ||
check_output(["jupytext", "Oscillator.py", "-o", "Oscillator.ipynb"]) | ||
|
||
|
||
# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. | ||
extensions = [ | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.doctest", | ||
"nbsphinx", | ||
"sphinx.ext.napoleon", # autodoc understands numpy docstrings | ||
"sphinx.ext.autodoc", # Core library for html generation from docstrings | ||
"sphinx.ext.autosummary", # Create neat summary tables | ||
"sphinx.ext.doctest", # Test snippets in the documentation | ||
"sphinx.ext.viewcode", # Add links to highlighted source code | ||
"sphinx.ext.intersphinx", # Link to other projects’ documentation | ||
"sphinx.ext.autosectionlabel", # Allow reference sections using its title | ||
# allows BibTeX citations to be inserted into documentation generated by Sphinx | ||
"sphinxcontrib.bibtex", | ||
"jupyter_sphinx", | ||
"numpydoc", | ||
"m2r2", # compatibility with markdown | ||
"myst_nb", # to include jupyter notebooks | ||
] | ||
bibtex_bibfiles = ["refs.bib"] | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Autosummary | ||
# ----------------------------------------------------------------------------- | ||
|
||
# autosummaries from source-files | ||
autosummary_generate = True | ||
# dont show __init__ docstring | ||
autoclass_content = "class" | ||
# sort class members | ||
autodoc_member_order = "groupwise" | ||
# autodoc_member_order = 'bysource' | ||
|
||
autosummary_generate = True # Turn on sphinx.ext.autosummary | ||
# This is because numpydoc screew up with autosummary | ||
# numpydoc_show_class_members=False | ||
|
||
# Napoleon settings | ||
napoleon_google_docstring = True | ||
napoleon_numpy_docstring = True | ||
napoleon_include_init_with_doc = False | ||
napoleon_include_private_with_doc = True | ||
napoleon_include_special_with_doc = False | ||
# napoleon_use_admonition_for_examples = False | ||
# napoleon_use_admonition_for_notes = False | ||
# napoleon_use_admonition_for_references = False | ||
napoleon_use_ivar = True | ||
# napoleon_use_param = True | ||
# napoleon_use_rtype = True | ||
|
||
# Add any paths that contain templates here, relative to this directory. | ||
templates_path = ["_templates"] | ||
|
||
# Add any external modules you want to refer to in the docs here. | ||
intersphinx_mapping = { | ||
"python": ("https://docs.python.org/3", None), | ||
"numpy": ("https://numpy.org/doc/stable/", None), | ||
} | ||
|
||
# The suffix(es) of source filenames. | ||
# You can specify multiple suffix as a list of string: | ||
# source_suffix = ['.rst', '.md'] | ||
source_suffix = [".rst", ".md", ".ipynb"] | ||
|
||
# The encoding of source files. | ||
# source_encoding = 'utf-8-sig' | ||
|
||
# The master toctree document. | ||
master_doc = "index" | ||
|
||
# The language for content autogenerated by Sphinx. Refer to documentation | ||
# for a list of supported languages. | ||
# | ||
# This is also used if you do content translation via gettext catalogs. | ||
# Usually you set "language" from the command line for these cases. | ||
language = "en" | ||
html_theme = "sphinx_rtd_theme" | ||
|
||
# List of patterns, relative to source directory, that match files and | ||
# directories to ignore when looking for source files. | ||
exclude_patterns = ["build", "_templates/*.rst'", "Thumbs.db", ".DS_Store"] | ||
|
||
# The name of the Pygments (syntax highlighting) style to use. | ||
pygments_style = "sphinx" | ||
|
||
# ----------------------------------------------------------------------------- | ||
# HTML output | ||
# ----------------------------------------------------------------------------- | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
# html_theme = "sphinx_rtd_theme" | ||
html_theme = "pydata_sphinx_theme" | ||
|
||
# TODO: when ies gets a nice logo | ||
# html_logo = '_static/logo.svg' | ||
# html_favicon = '_static/favicon.ico' | ||
|
||
# Theme options are theme-specific and customize the look and feel of a theme | ||
# further. For a list of options available for each theme, see the | ||
# documentation. | ||
# | ||
html_theme_options = { | ||
# "google_analytics_id": "UA-140243896-1", | ||
"show_prev_next": False, | ||
"github_url": "https://github.com/equinor/iterative_ensemble_smoother", | ||
"icon_links": [ | ||
{ | ||
"name": "Support", | ||
"url": "https://github.com/equinor/iterative_ensemble_smoother/issues", | ||
"icon": "fa fa-comment fa-fw", | ||
}, | ||
# { | ||
# "name": "The Paper", | ||
# "url": "https://doi.org/10.21105/joss.01450", | ||
# "icon": "fa fa-file-text fa-fw", | ||
# }, | ||
], | ||
} | ||
|
||
# Title displayed on the html page | ||
html_title = "Iterative Ensemble Smoother" | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Bibliography | ||
# ----------------------------------------------------------------------------- | ||
|
||
bibtex_bibfiles = ["./refs.bib"] | ||
bibtex_default_style = "unsrt" | ||
bibtex_reference_style = "author_year" | ||
suppress_warnings = ["bibtex.duplicate_citation", "autosectionlabel.*"] | ||
|
||
numpydoc_class_members_toctree = False | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Myst configuration | ||
# ----------------------------------------------------------------------------- | ||
|
||
# see https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#syntax-mathjax | ||
# for math parsing in jupyter notebooks | ||
myst_enable_extensions = [ | ||
"amsmath", | ||
"dollarmath", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ Example Usage | |
|
||
Polynomial | ||
Oscillator | ||
|
||
* :ref:`genindex` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.