Back to home page

MITgcm

 
 

    


File indexing completed on 2022-06-10 05:08:57 UTC

view on githubraw file Latest commit 7ab24328 on 2022-06-09 11:26:48 UTC
e7dabe8aa2 Ed D*0001 # -*- coding: utf-8 -*-
                0002 #
                0003 # MITgcm documentation build configuration file, created by
                0004 # sphinx-quickstart on Tue Jun  6 11:04:04 2017.
                0005 #
                0006 # This file is execfile()d with the current directory set to its
                0007 # containing dir.
                0008 #
                0009 # Note that not all possible configuration values are present in this
                0010 # autogenerated file.
                0011 #
                0012 # All configuration values have a default; values that are commented out
                0013 # serve to show the default.
                0014 
                0015 # If extensions (or modules to document with autodoc) are in another directory,
                0016 # add these directories to sys.path here. If the directory is relative to the
                0017 # documentation root, use os.path.abspath to make it absolute, like shown here.
                0018 #
                0019 import os
                0020 import sys
7621b5d564 Oliv*0021 sys.path.insert(0, os.path.abspath('_extensions'))
                0022 sys.path.insert(0, os.path.abspath('../utils/python/MITgcmutils'))
e7dabe8aa2 Ed D*0023 
                0024 
                0025 # -- General configuration ------------------------------------------------
                0026 
                0027 # If your documentation needs a minimal Sphinx version, state it here.
                0028 #
                0029 # needs_sphinx = '1.0'
                0030 
                0031 # Add any Sphinx extension module names here, as strings. They can be
                0032 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
                0033 # ones.
                0034 extensions = ['sphinx.ext.autodoc',
7621b5d564 Oliv*0035     'sphinx.ext.napoleon',
e7dabe8aa2 Ed D*0036     'sphinx.ext.mathjax',
                0037     'sphinx.ext.viewcode',
                0038     'sphinxcontrib.bibtex',
7621b5d564 Oliv*0039     'sphinxcontrib.programoutput',
e7dabe8aa2 Ed D*0040     'mitgcm']
                0041 
7621b5d564 Oliv*0042 autodoc_mock_imports = ['matplotlib', 'mpl_toolkits']
                0043 
39fa6219cc Oliv*0044 bibtex_bibfiles = ['manual_references.bib']
                0045 
e7dabe8aa2 Ed D*0046 # Add any paths that contain templates here, relative to this directory.
                0047 templates_path = ['_templates']
                0048 
                0049 # The suffix(es) of source filenames.
                0050 # You can specify multiple suffix as a list of string:
                0051 #
                0052 # source_suffix = ['.rst', '.md']
                0053 source_suffix = '.rst'
                0054 
                0055 # The master toctree document.
                0056 master_doc = 'index'
                0057 
                0058 # General information about the project.
                0059 project = u'MITgcm'
                0060 copyright = u'1997-, MITgcm contributors'
                0061 # When updating the list of authors, remember to also
                0062 # change the LaTeX list below and the list in index.rst
                0063 author = u'Alistair Adcroft, Jean-Michel Campin, Ed Doddridge, Stephanie Dutkiewicz, Constantinos Evangelinos, David Ferreira, Mick Follows, Gael Forget, Baylor Fox-Kemper, Patrick Heimbach, Chris Hill, Ed Hill, Helen Hill, Oliver Jahn, Jody Klymak, Martin Losch, John Marshall, Guillaume Maze, Matt Mazloff, Dimitris Menemenlis, Andrea Molod, and Jeff Scott'
                0064 
                0065 # The version info for the project you're documenting, acts as replacement for
                0066 # |version| and |release|, also used in various other places throughout the
                0067 # built documents.
                0068 #
                0069 
96334bef14 Oliv*0070 from subprocess import check_output, CalledProcessError
e7dabe8aa2 Ed D*0071 
                0072 def get_version():
                0073     """
96334bef14 Oliv*0074     Return the latest tag (checkpoint) and, if there have
                0075     been commits since the version was tagged, the commit hash.
e7dabe8aa2 Ed D*0076 
                0077     To get just the release tag use:
                0078     version = version.split('-')[0]
                0079     """
                0080 
96334bef14 Oliv*0081     try:
                0082         version = check_output(['git', 'describe', '--tags', '--always'],
                0083                                universal_newlines=True)
                0084     except CalledProcessError:
                0085         return 'unknown version'
e7dabe8aa2 Ed D*0086 
96334bef14 Oliv*0087     return version.rstrip()
e7dabe8aa2 Ed D*0088 
                0089 # "version" is used for html build
96334bef14 Oliv*0090 version = get_version()
e7dabe8aa2 Ed D*0091 # "release" is used for LaTeX build
                0092 release = version
                0093 
                0094 
                0095 
                0096 # The language for content autogenerated by Sphinx. 
                0097 # Refer to documentation
                0098 # for a list of supported languages.
                0099 #
                0100 # This is also used if you do content translation via gettext catalogs.
                0101 # Usually you set "language" from the command line for these cases.
7ab24328b3 Oliv*0102 language = 'en'
e7dabe8aa2 Ed D*0103 
                0104 # List of patterns, relative to source directory, that match files and
                0105 # directories to ignore when looking for source files.
                0106 # This patterns also effect to html_static_path and html_extra_path
                0107 exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
                0108 
61c5cd3fdd Oliv*0109 # Do not highlight code blocks unless a language is specified explicitly.
                0110 highlight_language = 'none'
                0111 
e7dabe8aa2 Ed D*0112 # The name of the Pygments (syntax highlighting) style to use.
                0113 pygments_style = 'sphinx'
                0114 
                0115 # If true, `todo` and `todoList` produce output, else they produce nothing.
                0116 todo_include_todos = False
                0117 
                0118 
                0119 # number figures
                0120 
                0121 numfig_format = {'figure': 'Figure %s',
                0122                  'table': 'Table %s',
                0123                  'code-block': 'Code %s',
                0124                 }
                0125 
                0126 numfig = True
                0127 
                0128 # number figures within section
                0129 numfig_secnum_depth = 1
                0130 
                0131 #math_number_all = True
                0132 
                0133 numfig_format = {'figure': 'Figure %s', 'table': 'Table %s', 'code-block': 'Listing %s', 'section': 'Section %s'}
                0134 
                0135 # -- Options for HTML output ----------------------------------------------
                0136 
                0137 # The theme to use for HTML and HTML Help pages.  See the documentation for
                0138 # a list of builtin themes.
                0139 #
                0140 #html_theme = 'alabaster'
                0141 
                0142 import sphinx_rtd_theme
                0143 
                0144 html_theme = "sphinx_rtd_theme"
                0145 
                0146 html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
                0147 
                0148 # Theme options are theme-specific and customize the look and feel of a theme
                0149 # further.  For a list of options available for each theme, see the
                0150 # documentation.
                0151 #
                0152 # html_theme_options = {}
                0153 
                0154 # Add any paths that contain custom static files (such as style sheets) here,
                0155 # relative to this directory. They are copied after the builtin static files,
                0156 # so a file named "default.css" will overwrite the builtin "default.css".
                0157 html_static_path = ['_static']
                0158 
4dc99f0888 Oliv*0159 html_css_files = [
                0160     'css/custom.css',
                0161     'css/wrap_tables.css',
                0162 ]
                0163 
e7dabe8aa2 Ed D*0164 
                0165 # -- Options for HTMLHelp output ------------------------------------------
                0166 
                0167 # Output file base name for HTML help builder.
                0168 htmlhelp_basename = 'MITgcmdoc'
                0169 
                0170 
                0171 # -- Options for LaTeX output ---------------------------------------------
                0172 
                0173 latex_elements = {
                0174     # The paper size ('letterpaper' or 'a4paper').
                0175     #
                0176     # 'papersize': 'letterpaper',
                0177 
                0178     # The font size ('10pt', '11pt' or '12pt').
                0179     #
                0180     # 'pointsize': '10pt',
                0181 
                0182     # Additional stuff for the LaTeX preamble.
                0183     #
                0184     # 'preamble': '',
                0185     'preamble': r'''
                0186     \setcounter{secnumdepth}{3}
                0187     \newcommand{\p}[1]{\frac{\partial }{\partial #1}}
                0188     \newcommand{\pp}[2]{\frac{\partial #1}{\partial #2}}
                0189     \newcommand{\dd}[2]{\frac{d #1}{d #2}}
                0190     \newcommand{\h}{\frac{1}{2}}
dcaaa42497 Jeff*0191     \setlength{\tymax}{0.5\textwidth}
e7dabe8aa2 Ed D*0192     ''',
                0193 
                0194     # Latex figure (float) alignment
                0195     #
                0196     # 'figure_align': 'htbp',
                0197 }
                0198 
                0199 # Grouping the document tree into LaTeX files. List of tuples
                0200 # (source start file, target name, title,
                0201 #  author, documentclass [howto, manual, or own class]).
                0202 latex_documents = [
                0203     (master_doc, 'MITgcm.tex', u'MITgcm Documentation',
                0204      u'Alistair Adcroft, Jean-Michel Campin, Ed Doddridge, \\and Stephanie Dutkiewicz, Constantinos Evangelinos, \\and David Ferreira, Mick Follows, Gael Forget, \\and Baylor Fox-Kemper, Patrick Heimbach, Chris Hill, Ed Hill, \\and Helen Hill, Oliver Jahn, Jody Klymak, Martin Losch, \\and John Marshall, Guillaume Maze, Matt Mazloff, \\and Dimitris Menemenlis, Andrea Molod, and Jeff Scott', 'manual'),
                0205 ]
                0206 
                0207 
                0208 # -- Options for manual page output ---------------------------------------
                0209 
                0210 # One entry per manual page. List of tuples
                0211 # (source start file, name, description, authors, manual section).
                0212 man_pages = [
                0213     (master_doc, 'mitgcm', u'MITgcm Documentation',
                0214      [author], 1)
                0215 ]
                0216 
                0217 
                0218 # -- Options for Texinfo output -------------------------------------------
                0219 
                0220 # Grouping the document tree into Texinfo files. List of tuples
                0221 # (source start file, target name, title, author,
                0222 #  dir menu entry, description, category)
                0223 texinfo_documents = [
                0224     (master_doc, 'MITgcm', u'MITgcm Documentation',
                0225      author, 'MITgcm', 'A highly configurable general circulation model.',
                0226      'Miscellaneous'),
                0227 ]