Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.11"
jobs:
pre_build:
- bash docs/scripts/api_build.sh

sphinx:
configuration: docs/conf.py
Expand Down
1 change: 1 addition & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
bash $(SOURCEDIR)/scripts/api_build.sh
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
55 changes: 55 additions & 0 deletions docs/_templates/apidoc/package.rst.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{%- macro automodule(modname, options) -%}
.. automodule:: {{ modname }}
{%- for option in options %}
:{{ option }}:
{%- endfor %}
{%- endmacro %}

{%- macro toctree(docnames) -%}
.. toctree::
:maxdepth: {{ maxdepth }}
{% for docname in docnames %}
{{ docname }}
{%- endfor %}
{%- endmacro %}

{%- if is_namespace %}
{{- pkgname.split(".")[1:] | join(".") | e | heading }}
{% else %}
{{- pkgname.split(".")[1:] | join(" ") | e | heading }}
{% endif %}

{%- if is_namespace %}
.. py:module:: {{ pkgname }}
{% endif %}

{%- if modulefirst and not is_namespace %}
{{ automodule(["anemoi", pkgname] | join("."), [""]) }}
{% endif %}

{%- if subpackages %}
Subpackages
-----------

{{ toctree(subpackages) }}
{% endif %}

{%- if submodules %}
{% if separatemodules %}
{{ toctree(submodules) }}
{% else %}
{%- for submodule in submodules %}
{% if show_headings %}
{{- submodule.split(".")[2:] | join(".") | e | heading(2) }}
{% endif %}
{{ automodule(["anemoi", submodule] | join("."), automodule_options) }}
{% endfor %}
{%- endif %}
{%- endif %}

{%- if not modulefirst and not is_namespace %}
Module contents
---------------

{{ automodule(pkgname, automodule_options) }}
{% endif %}
4 changes: 4 additions & 0 deletions docs/modules/create.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Create
########

This module contains the neccessary functions to create a dataset. It
interfaces with the data on disk, and provides methods to prepare it for
use in Anemoi.

.. automodule:: anemoi.datasets.create
:members:
:no-undoc-members:
Expand Down
10 changes: 1 addition & 9 deletions docs/modules/data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,4 @@
Data
######

.. automodule:: anemoi.datasets.data.__init__
:members:
:no-undoc-members:
:show-inheritance:

.. automodule:: anemoi.datasets.data.dataset
:members:
:no-undoc-members:
:show-inheritance:
.. include:: ../_api/datasets.data.rst
5 changes: 5 additions & 0 deletions docs/modules/filters.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#########
Filters
#########

.. include:: ../_api/datasets.create.filters.rst
5 changes: 5 additions & 0 deletions docs/modules/sources.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#########
Sources
#########

.. include:: ../_api/datasets.create.sources.rst
6 changes: 6 additions & 0 deletions docs/scripts/api_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

script_dir=$(dirname "${BASH_SOURCE[0]}")
docs_dir="$script_dir/.."
source_dir="$script_dir/../../src/"

sphinx-apidoc -M -f -o "$docs_dir/_api" "$source_dir/anemoi" -t "$docs_dir/_templates/apidoc"
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ optional-dependencies.dev = [
]

optional-dependencies.docs = [
"anemoi-datasets[all]",
"nbsphinx",
"pandoc",
"sphinx",
Expand Down
Loading