Skip to content

Commit

Permalink
Complete overhaul of Python API documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
paulromano committed Apr 14, 2016
1 parent a7c4554 commit 14dc134
Show file tree
Hide file tree
Showing 49 changed files with 557 additions and 662 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ examples/python/**/*.xml
docs/build
docs/source/_images/*.pdf
docs/source/_images/*.aux
docs/source/pythonapi/generated/

# Source build
build
Expand Down
7 changes: 7 additions & 0 deletions docs/source/_templates/myclass.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{ fullname }}
{{ underline }}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:members:
41 changes: 19 additions & 22 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@
from mock import Mock as MagicMock


class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return Mock()

MOCK_MODULES = ['numpy', 'h5py', 'pandas', 'opencg']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
sys.modules.update((mod_name, MagicMock()) for mod_name in MOCK_MODULES)


# If extensions (or modules to document with autodoc) are in another directory,
Expand All @@ -48,6 +43,7 @@ def __getattr__(cls, name):
'sphinx.ext.napoleon',
'sphinx.ext.mathjax',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
'sphinx_numfig',
'notebook_sphinxext']

Expand All @@ -65,7 +61,7 @@ def __getattr__(cls, name):

# General information about the project.
project = u'OpenMC'
copyright = u'2011-2015, Massachusetts Institute of Technology'
copyright = u'2011-2016, Massachusetts Institute of Technology'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -122,20 +118,13 @@ def __getattr__(cls, name):

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

# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
if on_rtd:
html_theme = 'default'
html_logo = '_images/openmc200px.png'
else:
html_theme = 'haiku'
html_theme_options = {'full_logo': True,
'linkcolor': '#0c3762',
'visitedlinkcolor': '#0c3762'}
html_logo = '_images/openmc.png'

# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = ["_theme"]
# The theme to use for HTML and HTML Help pages
if not on_rtd:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

html_logo = '_images/openmc200px.png'

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
Expand Down Expand Up @@ -248,4 +237,12 @@ def setup(app):
#Autodocumentation Flags
#autodoc_member_order = "groupwise"
#autoclass_content = "both"
#autosummary_generate = []
autosummary_generate = True

napoleon_use_ivar = True

intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
'numpy': ('http://docs.scipy.org/doc/numpy/', None),
'pandas': ('http://pandas.pydata.org/pandas-docs/stable/', None)
}
8 changes: 0 additions & 8 deletions docs/source/pythonapi/ace.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/source/pythonapi/cmfd.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/source/pythonapi/element.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/source/pythonapi/executor.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/source/pythonapi/filter.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/source/pythonapi/geometry.rst

This file was deleted.

Loading

0 comments on commit 14dc134

Please sign in to comment.