Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin documentation #155

Merged
merged 5 commits into from
Mar 21, 2023
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
6 changes: 5 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ version: 2
sphinx:
configuration: docs/source/conf.py

build:
os: ubuntu-22.04
tools:
python: "3.11"

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.8
install:
- requirements: docs/requirements.txt
- method: pip
Expand Down
3 changes: 3 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,6 @@ pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

live:
sphinx-autobuild -b dirhtml source/ _build/dirhtml/
3 changes: 2 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sphinx>=3.1
sphinx-autosummary-accessors
sphinx_rtd_theme
sphinx_rtd_theme>=1.0
autodoc_pydantic
32 changes: 29 additions & 3 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Top-level Rest class
====================

The :class:`~xpublish.Rest` class can be used for publishing a
:class:`xarray.Dataset` object or a collection of Dataset objects.
a collection of :class:`xarray.Dataset` objects.

.. autosummary::
:toctree: generated/
Expand All @@ -18,12 +18,19 @@ The :class:`~xpublish.Rest` class can be used for publishing a
Rest.cache
Rest.serve

For serving a single dataset the :class:`~xpublish.SingleDatasetRest` is used instead.

.. autosummary::
:toctree: generated/

SingleDatasetRest

Dataset.rest (xarray accessor)
==============================

This accessor extends :py:class:`xarray.Dataset` with the same interface than
:class:`~xpublish.Rest`. It is a convenient method for publishing one single
dataset. Proper use of this accessor should be like:
:class:`~xpublish.Rest` or :class:`~xpublish.SingleDatasetRest`. It is a convenient
method for publishing one single dataset. Proper use of this accessor should be like:

.. code-block:: python

Expand Down Expand Up @@ -77,3 +84,22 @@ when creating custom API endpoints.
get_cache
get_zvariables
get_zmetadata

Plugins
=======

Plugins are inherit from the :class:`~xpublish.Plugin` class, and implement various hooks.

.. currentmodule:: xpublish

.. autosummary::
:toctree: generated/

Plugin
hookimpl
hookspec
Dependencies
plugins.hooks.PluginSpec
plugins.manage.find_default_plugins
plugins.manage.load_default_plugins
plugins.manage.configure_plugins
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
'sphinx.ext.intersphinx',
'sphinx.ext.extlinks',
'sphinx.ext.napoleon',
'sphinxcontrib.autodoc_pydantic',
'sphinx_autosummary_accessors',
]

Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ API with the following endpoints:

installation
tutorial
plugins
api
contributing

Expand Down
Loading