Skip to content

Commit

Permalink
Apply black code formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzo committed Jul 2, 2021
1 parent 2447fc1 commit e2429dc
Show file tree
Hide file tree
Showing 500 changed files with 30,385 additions and 17,202 deletions.
99 changes: 54 additions & 45 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# 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("../.."))

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

Expand All @@ -38,15 +38,15 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.intersphinx', #
'sphinx.ext.todo', #
'sphinx.ext.mathjax', #
'sphinx.ext.ifconfig', #
'sphinx.ext.viewcode', #
'sphinx.ext.githubpages', #
'sphinx.ext.graphviz', #
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
"sphinx.ext.intersphinx", #
"sphinx.ext.todo", #
"sphinx.ext.mathjax", #
"sphinx.ext.ifconfig", #
"sphinx.ext.viewcode", #
"sphinx.ext.githubpages", #
"sphinx.ext.graphviz", #
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
]

# Disable documentation inheritance so as to avoid inheriting
Expand All @@ -56,31 +56,32 @@
autodoc_inherit_docstrings = False

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
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'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = u'Pyro'
copyright = u'2017-2018, Uber Technologies, Inc'
author = u'Uber AI Labs'
project = u"Pyro"
copyright = u"2017-2018, Uber Technologies, Inc"
author = u"Uber AI Labs"

# 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.

version = ''
version = ""

if 'READTHEDOCS' not in os.environ:
if "READTHEDOCS" not in os.environ:
# if developing locally, use pyro.__version__ as version
from pyro import __version__ # noqaE402

version = __version__

# release version
Expand All @@ -99,7 +100,7 @@
exclude_patterns = []

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

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
Expand All @@ -110,10 +111,10 @@
# -- Options for HTML output ----------------------------------------------

# logo
html_logo = '_static/img/pyro_logo_wide.png'
html_logo = "_static/img/pyro_logo_wide.png"

# logo
html_favicon = '_static/img/favicon/favicon.ico'
html_favicon = "_static/img/favicon/favicon.ico"

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
Expand All @@ -126,36 +127,33 @@
# documentation.

html_theme_options = {
'navigation_depth': 3,
'logo_only': True,
"navigation_depth": 3,
"logo_only": True,
}

# 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_style = 'css/pyro.css'
html_static_path = ["_static"]
html_style = "css/pyro.css"

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

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

# -- 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',
Expand All @@ -165,34 +163,41 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'Pyro.tex', u'Pyro Documentation', u'Uber AI Labs', 'manual'),
(master_doc, "Pyro.tex", u"Pyro Documentation", u"Uber AI Labs", "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, 'pyro', u'Pyro Documentation', [author], 1)]
man_pages = [(master_doc, "pyro", u"Pyro 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, 'Pyro', u'Pyro Documentation', author, 'Pyro',
'Deep Universal Probabilistic Programming.', 'Miscellaneous'),
(
master_doc,
"Pyro",
u"Pyro Documentation",
author,
"Pyro",
"Deep Universal Probabilistic Programming.",
"Miscellaneous",
),
]

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'torch': ('https://pytorch.org/docs/master/', None),
'funsor': ('http://funsor.pyro.ai/en/stable/', None),
'opt_einsum': ('https://optimized-einsum.readthedocs.io/en/stable/', None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
'Bio': ('https://biopython.readthedocs.io/en/latest/', None),
'horovod': ('https://horovod.readthedocs.io/en/stable/', None),
"python": ("https://docs.python.org/3/", None),
"torch": ("https://pytorch.org/docs/master/", None),
"funsor": ("http://funsor.pyro.ai/en/stable/", None),
"opt_einsum": ("https://optimized-einsum.readthedocs.io/en/stable/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
"Bio": ("https://biopython.readthedocs.io/en/latest/", None),
"horovod": ("https://horovod.readthedocs.io/en/stable/", None),
}

# document class constructors (__init__ methods):
Expand All @@ -205,13 +210,17 @@ def skip(app, what, name, obj, skip, options):


def setup(app):
app.add_css_file('css/pyro.css')
app.add_css_file("css/pyro.css")


# app.connect("autodoc-skip-member", skip)


# @jpchen's hack to get rtd builder to install latest pytorch
# See similar line in the install section of .travis.yml
if 'READTHEDOCS' in os.environ:
os.system('pip install numpy')
os.system('pip install torch==1.9.0+cpu torchvision==0.10.0+cpu '
'-f https://download.pytorch.org/whl/torch_stable.html')
if "READTHEDOCS" in os.environ:
os.system("pip install numpy")
os.system(
"pip install torch==1.9.0+cpu torchvision==0.10.0+cpu "
"-f https://download.pytorch.org/whl/torch_stable.html"
)
Loading

0 comments on commit e2429dc

Please sign in to comment.