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

Update Sphinx documentation #54

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
1 change: 0 additions & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = Trollflow2
SOURCEDIR = source
BUILDDIR = build

Expand Down
1 change: 0 additions & 1 deletion doc/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ if "%SPHINXBUILD%" == "" (
)
set SOURCEDIR=source
set BUILDDIR=build
set SPHINXPROJ=Trollflow2

if "%1" == "" goto help

Expand Down
171 changes: 129 additions & 42 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# -*- coding: utf-8 -*-
#
# Trollflow2 documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 19 23:01:42 2019.
# Configuration file for the Sphinx documentation builder.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- 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
Expand All @@ -19,27 +15,87 @@
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import pyspectral.version as current_version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy-paste typo? Maybe this should be from trollflow2 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, baad, thx @pnuu !
Will fix...

import sys
import os

# PYTHONPATH = docs/source
DOC_SOURCES_DIR = os.path.dirname(os.path.abspath(__file__))
PROJECT_ROOT_DIR = os.path.dirname(DOC_SOURCES_DIR)
sys.path.insert(0, DOC_SOURCES_DIR)

# -- General configuration ------------------------------------------------
# If runs on ReadTheDocs environment
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

project = 'Trollflow2'
copyright = '2019, Panu Lahtinen, Martin Raspaud'
author = 'Panu Lahtinen, Martin Raspaud'

# The full version, including alpha/beta/rc tags
release = '0.5.0'
# -- Project information -----------------------------------------------------

project = u'Trollflow2'
copyright = u'2019, Pytroll'
author = u'Pytroll'


sys.path.insert(0, os.path.abspath('../'))
sys.path.insert(0, os.path.abspath('../trollflow2'))


class Mock(object):

"""Mock class for doc/unit testing (on Travis)"""

__all__ = []

def __init__(self, *args, **kwargs):
pass

def __call__(self, *args, **kwargs):
return Mock()

@classmethod
def __getattr__(cls, name):
if name in ('__file__', '__path__'):
return '/dev/null'
elif name[0] == name[0].upper():
mockType = type(name, (), {})
mockType.__module__ = __name__
return mockType
elif name == "inf":
return 0
else:
return Mock()


MOCK_MODULES = ['numpy', 'numpy.core',
'numpy.distutils.core', 'numpy.core.multiarray',
'dask', 'dask.array',
'satpy', 'satpy.dataset', 'satpy.resample', 'satpy.writers',
'posttroll', 'posttroll.message', 'posttroll.publisher',
'rasterio', 'rasterio.enums', 'gdal',
'pyresample', 'pyresample.boundary',
'trollsift', 'trollsift.parser',
'h5py', 'tqdm']

for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock()

# Master file
master_doc = 'index'

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

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# 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.todo']
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.imgmath',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand All @@ -53,19 +109,12 @@
# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'Trollflow2'
copyright = u'2019, Pytroll'
author = u'Pytroll'

# 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 = u'0'
# The full version, including alpha/beta/rc tags.
release = u'1'
release = current_version.get_versions()['version']
# The short X.Y version.
version = ".".join(release.split(".")[: 2])


# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -76,22 +125,19 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = []
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True


# -- Options for HTML output ----------------------------------------------
# -- 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 = 'alabaster'
html_theme = 'default'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -104,14 +150,24 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}


# -- Options for HTMLHelp output ------------------------------------------
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'Trollflow2doc'


# -- Options for LaTeX output ---------------------------------------------
# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
Expand Down Expand Up @@ -140,7 +196,7 @@
]


# -- Options for manual page output ---------------------------------------
# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
Expand All @@ -150,7 +206,7 @@
]


# -- Options for Texinfo output -------------------------------------------
# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
Expand All @@ -160,3 +216,34 @@
author, 'Trollflow2', 'One line description of project.',
'Miscellaneous'),
]


# -- Options for Epub output -------------------------------------------------

# Bibliographic Dublin Core info.
epub_title = project

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''

# A unique identification for the text.
#
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']


# -- Extension configuration -------------------------------------------------

# -- Options for intersphinx extension ---------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}

# -- Options for todo extension ----------------------------------------------

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. Trollflow2 documentation master file, created by
sphinx-quickstart on Thu Sep 19 23:01:42 2019.
sphinx-quickstart on Wed Oct 2 23:07:10 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Expand Down