Skip to content

Commit

Permalink
DOCS: improved documentation using citet and citep for references, ma…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
antoinecollet5 committed Oct 4, 2023
1 parent 627dc84 commit e019aad
Show file tree
Hide file tree
Showing 18 changed files with 556 additions and 84 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,7 @@ poetry.toml
# LSP config files
pyrightconfig.json

# For the documentation
_autosummary

# End of https://www.toptal.com/developers/gitignore/api/python
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXPROJ = iteratrive_ensemble_smoother
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
36 changes: 36 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=python -msphinx
)
set SOURCEDIR=source
set BUILDDIR=build
set SPHINXPROJ=iterative_ensemble_smoother

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The Sphinx module was not found. Make sure you have Sphinx installed,
echo.then set the SPHINXBUILD environment variable to point to the full
echo.path of the 'sphinx-build' executable. Alternatively you may add the
echo.Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

:end
popd
5 changes: 5 additions & 0 deletions docs/source/_templates/autosummary/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. auto{{ objtype }}:: {{ objname }}
15 changes: 15 additions & 0 deletions docs/source/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:members: <-- add at least this line
:private-members:
:show-inheritance: <-- plus I want to show inheritance...
:inherited-members: <-- ...and inherited members too

{% block methods %}
.. automethod:: __init__
{% endblock %}

.. rubric:: {{ _('Methods definition') }}
61 changes: 61 additions & 0 deletions docs/source/_templates/autosummary/module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{{ 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 %}
16 changes: 7 additions & 9 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
API reference
=============
.. _api_ref:

.. currentmodule:: iterative_ensemble_smoother
=============
API Reference
=============

.. autoclass:: iterative_ensemble_smoother.SIES
:members:
.. automodule:: iterative_ensemble_smoother

.. autoclass:: iterative_ensemble_smoother.ES
:members:
.. raw:: latex

.. autoclass:: iterative_ensemble_smoother.ESMDA
:members:
\clearpage
2 changes: 2 additions & 0 deletions docs/source/bibliography.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ Bibliography
============

.. bibliography::
:all:
:labelprefix: Bib-
Loading

0 comments on commit e019aad

Please sign in to comment.