Skip to content

Commit

Permalink
Add a starting point for MPAS mesh-tool documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
xylar committed Mar 18, 2019
1 parent 0a82ab7 commit d4ccb90
Show file tree
Hide file tree
Showing 5 changed files with 266 additions and 0 deletions.
24 changes: 24 additions & 0 deletions mesh_tools/docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = mpas_mesh_tools
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

clean:
rm -rf *obs_table.rst generated obs
@$(SPHINXBUILD) -M clean "$(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)
32 changes: 32 additions & 0 deletions mesh_tools/docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#############
API reference
#############

This page provides an auto-generated summary of the MPAS mesh-tools API. For
more details and examples, refer to the relevant chapters in the main part of
the documentation.

Python package
==============

.. currentmodule:: mpas_mesh_tools.planar_hex

.. autosummary::
:toctree: generated/

make_periodic_planar_hex_mesh

.. currentmodule:: mpas_mesh_tools.translate

.. autosummary::
:toctree: generated/

translate

.. currentmodule:: mpas_mesh_tools.io

.. autosummary::
:toctree: generated/

write_netcdf

180 changes: 180 additions & 0 deletions mesh_tools/docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
# -*- coding: utf-8 -*-
#
# mpas_mesh_tools documentation build configuration file, created by
# sphinx-quickstart on Sat Mar 25 14:39:11 2017.
#
# 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.

import os
import mpas_mesh_tools

# -- 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.autosummary',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'numpydoc']

autosummary_generate = True

numpydoc_class_members_toctree = True
numpydoc_show_class_members = False

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

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = ['.rst']
# source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'mpas_mesh_tools'
copyright = u'This software is open source software available under the BSD-3' \
u'license. Copyright (c) 2019 Triad National Security, LLC. ' \
u'All rights reserved. Copyright (c) 2018 Lawrence Livermore ' \
u'National Security, LLC. All rights reserved. Copyright (c) ' \
u'2018 UT-Battelle, LLC. All rights reserved.'
author = u'Xylar Asay-Davis, Doug Jacobsen, Michael Duda, Mark Petersen, ' \
u'Adridan Turner'

# 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.0.1'
# The full version, including alpha/beta/rc tags.
release = u'0.0.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# 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 = ['_build', 'Thumbs.db', '.DS_Store',
'design_docs/template.md']

# 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 = False


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

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

# on_rtd is whether we are on readthedocs.org, this line of code grabbed from
# docs.readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# 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
# documentation.
#
# html_theme_options = {}

# 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']


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

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


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

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'mpas_mesh_tools.tex', u'mpas_mesh_tools Documentation',
author, 'manual'),
]


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

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'mpas_mesh_tools', u'mpas_mesh_tools Documentation',
[author], 1)
]


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

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'mpas_mesh_tools', u'mpas_mesh_tools Documentation',
author, 'mpas_mesh_tools', 'One line description of project.',
'Miscellaneous'),
]

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
'python': ('https://docs.python.org/', None),
'numpy': ('http://docs.scipy.org/doc/numpy/', None),
'xarray': ('http://xarray.pydata.org/en/stable/', None)}


github_doc_root = 'https://github.com/rtfd/recommonmark/tree/master/doc/'
15 changes: 15 additions & 0 deletions mesh_tools/docs/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: mpas_mesh_tools_docs
channels:
- conda-forge
dependencies:
- python=3.7
- pytest
- netcdf4
- hdf5
- libnetcdf
- numpy
- scipy
- xarray
- sphinx
- sphinx_rtd_theme
- numpydoc
15 changes: 15 additions & 0 deletions mesh_tools/docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
mpas_mesh_tools
==================

This repository houses geometric features relevant for climate science.

.. toctree::
:maxdepth: 2

api

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

* :ref:`genindex`

0 comments on commit d4ccb90

Please sign in to comment.