Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Automatic Code Documentation (#698)
* docs: automatic generation of code documentation Signed-off-by: Victor Garcia Reolid <victor@seita.nl> * docs: class and module templates Signed-off-by: Victor Garcia Reolid <victor@seita.nl> * fix: simplify generated docs Signed-off-by: Victor Garcia Reolid <victor@seita.nl> * feat: switch on/off generation of code docs via the parameter gen_code_docs of the makefile command update-docs and update-docs-pdf Signed-off-by: Victor Garcia Reolid <victor@seita.nl> * add docstrings for main modules Signed-off-by: Nicolas Höning <nicolas@seita.nl> * Add docstrings to API modules Signed-off-by: Nicolas Höning <nicolas@seita.nl> * fix: add autodoc and autosmmary when GEN_CODE_DOCS=True Signed-off-by: Victor Garcia Reolid <victor@seita.nl> * fix: set gen_code_docs default to True and False for devs (calling update-docs using make) Signed-off-by: Victor Garcia Reolid <victor@seita.nl> * move single test from config package into new tests package Signed-off-by: Nicolas Höning <nicolas@seita.nl> * fix: show main modules Signed-off-by: Victor Garcia Reolid <victor@seita.nl> * fix: remove documentation/_autosummary when gen_code_docs=False Signed-off-by: Victor Garcia Reolid <victor@seita.nl> * fix: make generated rst to live under _autosummary/ folder Signed-off-by: Victor Garcia Reolid <victor@seita.nl> * add autosummary folder to .gitignore Signed-off-by: Nicolas Höning <nicolas@seita.nl> * add some spellright words Signed-off-by: Nicolas Höning <nicolas@seita.nl> * try setting FLASK_ENV during RTD building Signed-off-by: Nicolas Höning <nicolas@seita.nl> * fix: set a fake SQLALCHEMY_DATABASE_URI Signed-off-by: Victor Garcia Reolid <victor@seita.nl> * no need to look for config file when building documentation Signed-off-by: Nicolas Höning <nicolas@seita.nl> * also export SECRET_KEY in RTD Signed-off-by: Nicolas Höning <nicolas@seita.nl> * test add SECRET_KEY Signed-off-by: Victor Garcia Reolid <victor@seita.nl> * docs: add private methods Signed-off-by: Victor Garcia Reolid <victor@seita.nl> * test only with env variables set in conf.py Signed-off-by: Victor Garcia Reolid <victor@seita.nl> * test Signed-off-by: Victor Garcia Reolid <victor@seita.nl> * fix: remove exports Signed-off-by: Victor Garcia Reolid <victor@seita.nl> * re-do a change to a comment that is by now inaccurate and improve the comment, as well Signed-off-by: Nicolas Höning <nicolas@seita.nl> --------- Signed-off-by: Victor Garcia Reolid <victor@seita.nl> Signed-off-by: Nicolas Höning <nicolas@seita.nl> Co-authored-by: Nicolas Höning <nicolas@seita.nl>
- Loading branch information
1 parent
726cd32
commit a02c9cd
Showing
25 changed files
with
182 additions
and
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -251,3 +251,8 @@ Changelog | |
Bugfixes | ||
Dockerfile | ||
nt | ||
Backoffice | ||
eval | ||
dataframe | ||
dataframes | ||
args |
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,67 @@ | ||
.. Adapted from https://stackoverflow.com/a/62613202 | ||
{{ fullname | escape | underline}} | ||
|
||
{% block modules %} | ||
{% if modules %} | ||
.. rubric:: Modules | ||
|
||
.. autosummary:: | ||
:toctree: | ||
:template: custom-module-template.rst | ||
:recursive: | ||
{% for item in modules %} | ||
{% if "test" not in item %} | ||
{{ item }} | ||
{% endif %} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
.. automodule:: {{ fullname }} | ||
|
||
{% block attributes %} | ||
{% if attributes %} | ||
.. rubric:: Module Attributes | ||
|
||
|
||
{% for item in attributes %} | ||
.. autoattribute:: | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block functions %} | ||
{% if functions %} | ||
.. rubric:: {{ _('Functions') }} | ||
|
||
{% for item in functions %} | ||
.. autofunction:: | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block classes %} | ||
{% if classes %} | ||
.. rubric:: {{ _('Classes') }} | ||
|
||
{% for item in classes %} | ||
.. autoclass:: {{ item }} | ||
:members: | ||
:special-members: __init__ | ||
:private-members: | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block exceptions %} | ||
{% if exceptions %} | ||
.. rubric:: {{ _('Exceptions') }} | ||
|
||
{% for item in exceptions %} | ||
.. autoexception:: | ||
{{ 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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
""" | ||
Endpoints under development. Use at your own risk. | ||
""" | ||
|
||
from flask import Flask | ||
|
||
|
||
|
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
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
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,3 +1,7 @@ | ||
""" | ||
Starting point of the Flask application. | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
import time | ||
|
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
""" | ||
CLI functions for FlexMeasures hosts. | ||
""" | ||
|
||
import sys | ||
|
||
from flask import Flask, current_app | ||
|
Empty file.
Empty file.
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,3 +1,7 @@ | ||
""" | ||
Models & schemata, as well as business logic (queries & services). | ||
""" | ||
|
||
import os | ||
|
||
from flask import Flask | ||
|
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 @@ | ||
""" Higher-level tests """ |
File renamed without changes.
Oops, something went wrong.