Skip to content

Commit

Permalink
Add Documentation (#86)
Browse files Browse the repository at this point in the history
* Renewed attempt on docs

* pre-commit refactor

* Trigger new build

* Update dependencies

* Forgot the rtd yml

* Buils env from conda-forge
  • Loading branch information
jbusecke committed Jan 13, 2021
1 parent 0c8e42b commit 0f5c75e
Show file tree
Hide file tree
Showing 12 changed files with 171 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ coverage.xml
# Sphinx documentation
docs/_build/
doc/_build/
make.bat

# PyBuilder
target/
Expand Down
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, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
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)
14 changes: 14 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
:mod:`API`
-----------------

.. automodule:: xarrayutils.utils
:members:
:undoc-members:
:show-inheritance:


.. automodule:: xarrayutils.plotting
:members:
:undoc-members:
:show-inheritance:

90 changes: 90 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import sys
import pathlib
import os

print("python exec:", sys.executable)
print("sys.path:", sys.path)
root = pathlib.Path(__file__).parent.parent.absolute()
os.environ["PYTHONPATH"] = str(root)
sys.path.insert(0, str(root))

import xarrayutils

# -- Versioning --------------------------------------------------------------

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = xarrayutils.__version__.split("+")[0]
# The full version, including alpha/beta/rc tags.
release = xarrayutils.__version__

# -- Project information -----------------------------------------------------

project = "xarrayutils"
copyright = "2021, xarrayutils Maintainers"
author = "xarrayutils Maintainers"


# -- General configuration ---------------------------------------------------

# 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.viewcode",
"sphinx.ext.napoleon",
"nbsphinx",
"recommonmark",
"sphinx.ext.mathjax",
"sphinx.ext.autosummary",
"sphinx.ext.extlinks",
"sphinx.ext.intersphinx",
"numpydoc",
"nbsphinx",
"IPython.sphinxext.ipython_directive",
"IPython.sphinxext.ipython_console_highlighting",
"sphinxcontrib.srclinks",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "**.ipynb_checkpoints", "Thumbs.db", ".DS_Store"]


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "pangeo"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

# link to github issues
extlinks = {
"issue": ("https://github.com/jbusecke/xarrayutils/issues/%s", "GH#"),
"pull": ("https://github.com/jbusecke/xarrayutils/issues/%s", "GH#"),
}
File renamed without changes.
14 changes: 10 additions & 4 deletions doc/environment.yml → docs/environment.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
name: xarrayutils-docs
channels:
- conda-forge
- defaults
dependencies:
- python
- future
- pytest
- scipy
- numpy
- xarray
- numpydoc
- pandoc
- recommonmark
- sphinx
- sphinx_rtd_theme
- ipykernel
Expand All @@ -21,8 +26,9 @@ dependencies:
- intake-esm
- gcsfs
#
- pip
- pip:
- docrep
- nbsphinx
- jupyter_client
- jupyter-sphinx
- sphinx_pangeo_theme
- sphinxcontrib-srclinks
26 changes: 26 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.. xarrayutils documentation master file, created by
sphinx-quickstart on Wed Jan 13 12:39:16 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to xarrayutils's documentation!
=======================================

The most bestest introduction ever.

.. toctree::
:maxdepth: 2
:caption: Contents:

utils
plotting
api



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion doc/whats-new.rst → docs/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ v0.2.0 (unreleased)
Breaking changes
~~~~~~~~~~~~~~~~
- Refactored implementation of :py:meth:`utils.xr_linregress`: Scales better and
does not require rechunking the data anymore. No more `nanmask` option available
does not require rechunking the data anymore. No more `nanmask` option available
(:pull:`62`)
By `Julius Busecke <https://github.com/jbusecke>`_

Expand Down
9 changes: 9 additions & 0 deletions readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
conda:
file: docs/environment.yml
python:
version: 3.8
install:
- method: setuptools
path: package
sphinx:
fail_on_warning: true

0 comments on commit 0f5c75e

Please sign in to comment.