Skip to content

Commit

Permalink
Merge pull request #476 from mperrin/release_cleanup_1.0.1
Browse files Browse the repository at this point in the history
Fix documentation formatting issues, Release 1.0.1...
  • Loading branch information
mperrin authored Dec 8, 2021
2 parents 0546997 + c3ac229 commit 7d3e3bf
Show file tree
Hide file tree
Showing 9 changed files with 211 additions and 157 deletions.
3 changes: 3 additions & 0 deletions docs/_static/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.classifier:before {
content: "\00A0:\00A0" !important;
}
3 changes: 3 additions & 0 deletions docs/_templates/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% extends "!page.html" %}

{% set css_files = css_files + ["_static/style.css"] %}
280 changes: 157 additions & 123 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.md
#
# POPPY documentation build configuration file
# Configuration file for the Sphinx documentation builder.
# created by sphinx-quickstart
#
# 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 file.
#
# All configuration values have a default. Some values are defined in
# the global Astropy configuration which is loaded here before anything else.
# See astropy.sphinx.conf for which values are set there.
# 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
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('..'))
# IMPORTANT: the above commented section was generated by sphinx-quickstart, but
# is *NOT* appropriate for astropy or Astropy affiliated packages. It is left
# commented out with this explanation to make it clear why this should not be
# done. If the sys.path entry above is added, when the astropy.sphinx.conf
# import occurs, it will import the *source* version of astropy instead of the
# version installed (if invoked as "make html" or directly with sphinx), or the
# version in the build directory (if "python setup.py build_sphinx" is used).
# Thus, any C-extensions that are needed to build the documentation will *not*
# be accessible, and the documentation will not build correctly.

import datetime
#
import os
import sys
import datetime
import stsci_rtd_theme

try:
Expand All @@ -35,85 +24,20 @@
print('ERROR: the documentation requires the sphinx-astropy package to be installed')
sys.exit(1)

# -- Project information -----------------------------------------------------
# Get configuration information from setup.cfg
from configparser import ConfigParser
conf = ConfigParser()


def setup(app):
app.add_css_file("stsci.css")

conf.read([os.path.join(os.path.dirname(__file__), '..', 'setup.cfg')])
setup_cfg = dict(conf.items('metadata'))

# 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.
sys.path.insert(0, os.path.abspath('../'))
sys.path.insert(0, os.path.abspath('../poppy/'))
sys.path.insert(0, os.path.abspath('exts/'))
extensions = [
'numfig',
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.inheritance_diagram',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'sphinx_automodapi.automodapi',
'sphinx_issues'
]
numpydoc_show_class_members = False

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

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


extensions.append('nbsphinx')
extensions.append('sphinx.ext.mathjax')

suppress_warnings = ["ref.keyword"]
# By default, highlight as Python 3.
highlight_language = 'python3'

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

# To perform a Sphinx version check that needs to be more specific than
# major.minor, call `check_sphinx_version("x.y.z")` here.
# check_sphinx_version("1.2.1")

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns.append('_templates')
exclude_patterns.append('_build')
exclude_patterns.append('**.ipynb_checkpoints')

# This is added to the end of RST files - a good place to put substitutions to
# be used globally.
rst_epilog += """
"""

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


# Github integration via sphinx-issues plugin
# See https://github.com/sloria/sphinx-issues

# Github repo
issues_github_path = "spacetelescope/poppy"


# This does not *have* to match the package name, but typically does
project = setup_cfg['name']
author = setup_cfg['author']
copyright = '{0}, {1}'.format(
datetime.datetime.now().year, author)

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# Also read version and release from the setup_cfg, for use throughout the
# built documents.

__import__(setup_cfg['name'])
Expand All @@ -128,66 +52,168 @@ def setup(app):
version = 'dev'
release = 'dev'

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

# A NOTE ON HTML THEMES
# The global astropy configuration uses a custom theme, 'bootstrap-astropy',
# which is installed along with astropy. A different theme can be used or
# the options for this theme can be modified by overriding some of the
# variables set in the global configuration. The variables set in the
# global configuration are listed below, commented out.
# -- General configuration ---------------------------------------------------

# Add any paths that contain custom themes here, relative to this directory.
# To use a different custom theme, add the directory containing the theme.
html_theme_path = [stsci_rtd_theme.get_html_theme_path()]
# 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.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.inheritance_diagram',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'sphinx.ext.mathjax',
'sphinx_automodapi.automodapi',
'sphinx_issues',
'nbsphinx',
'numpydoc'

]

# 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', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# 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 pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '_templates', '**.ipynb_checkpoints']

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


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

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. To override the custom theme, set this to the
# name of a builtin theme or the name of a custom theme in html_theme_path.
# a list of builtin themes.
html_theme = 'stsci_rtd_theme'
html_theme_path = [stsci_rtd_theme.get_html_theme_path()]

# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# 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 = {}

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = ''
# 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']
html_css_files = ['_static/style.css', 'stsci.css']

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = ''
# 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 = {}

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
html_title = '{0} v{1}'.format(project, release)


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

# Output file base name for HTML help builder.
htmlhelp_basename = project + 'doc'
htmlhelp_basename = 'poppydoc'


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

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

# -- Options for LaTeX output --------------------------------------------------
# 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]).
latex_documents = [('index', project + '.tex', project + u' Documentation',
author, 'manual')]
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'poppy.tex', 'poppy Documentation',
'Space Telescope Science Institute', 'manual'),
]


# -- 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).
man_pages = [('index', project.lower(), project + u' Documentation',
[author], 1)]
man_pages = [
(master_doc, 'poppy', 'poppy 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, 'poppy', 'poppy Documentation',
author, 'poppy', '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']

# -- Options for inheritance diagram ------------------------------------------------
# See http://sphinx-doc.org/ext/inheritance.html
# and http://stackoverflow.com/questions/2151711/how-can-i-make-sphinxs-inheritance-diagram-readable
#inheritance_graph_attrs = dict(rankdir="LR", size='"12.0, 5.0"',
# fontsize=36, ratio='compress')

# -- Extension configuration -------------------------------------------------
## -- Options for the edit_on_github extension ----------------------------------------

if eval(setup_cfg.get('edit_on_github')):
Expand All @@ -198,10 +224,18 @@ def setup(app):
if versionmod.version.release:
edit_on_github_branch = "v" + versionmod.version.version
else:
edit_on_github_branch = "master"
edit_on_github_branch = "stable"

edit_on_github_source_root = ""
edit_on_github_doc_root = "docs"

# -- Resolving issue number to links in changelog -----------------------------
# Github integration via sphinx-issues plugin
# See https://github.com/sloria/sphinx-issues

# Github repo
issues_github_path = "spacetelescope/poppy"

github_issues_url = 'https://github.com/{0}/issues/'.format(setup_cfg['github_project'])


9 changes: 4 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ imaging simulations.
Summary
------------


**What this software does:**

* Allows users to define an optical system consisting of multiple planes, such as pupils and images.
Expand All @@ -28,13 +27,13 @@ Summary
selection of broad- and narrow-band filters, selectable optical components such as pupil stops, models of
optical aberrations defined by Zernike polynomials, etc.

That said, Poppy does not implement full Rayleigh-Sommerfeld electromagnetic propagation, vector electromagnetic field propagation
such as would be needed for modeling polarization effects, nor modelling of any kind of detector noise or imperfections.

**What this software does not do:**

* Full Rayleigh-Sommerfeld electromagnetic propagation.
* Vector electromagnetic field propagation such as would be needed for modeling polarization effects.
* Modelling of any kind of detector noise or imperfections.
**Getting Started:**

See `Example Code and Getting Started <https://poppy-optics.readthedocs.io/en/latest/examples.html>`_

.. admonition:: Quickstart IPython Notebook

Expand Down
Loading

0 comments on commit 7d3e3bf

Please sign in to comment.