Skip to content

Commit 965788a

Browse files
author
Valentin Sulzer
committed
configure docs and doctest
1 parent fa83144 commit 965788a

File tree

5 files changed

+47
-47
lines changed

5 files changed

+47
-47
lines changed

.travis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ matrix:
3838
# - PINTS_UNIT=true
3939
# if: type != cron
4040
# Docs, style and cover checking, latest Python version only
41-
# - python: "3.6"
42-
# env:
43-
# - PINTS_DOCS=true
44-
# if: type != cron
41+
- python: "3.6"
42+
env:
43+
- PINTS_DOCS=true
44+
if: type != cron
4545
- python: "3.6"
4646
env:
4747
- PINTS_STYLE=true

docs/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ help:
1616
# Catch-all target: route all unknown targets to Sphinx using the new
1717
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1818
%: Makefile
19-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
19+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

+39-33
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,20 @@
1414
#
1515
import os
1616
import sys
17-
sys.path.insert(0, os.path.abspath('../'))
17+
18+
sys.path.insert(0, os.path.abspath("../"))
1819

1920

2021
# -- Project information -----------------------------------------------------
2122

22-
project = 'PyBaMM'
23-
copyright = '2018, Valentin Sulzer'
24-
author = 'Valentin Sulzer'
23+
project = "PyBaMM"
24+
copyright = "2018, Valentin Sulzer"
25+
author = "Valentin Sulzer"
2526

2627
# The short X.Y version
27-
version = ''
28+
version = ""
2829
# The full version, including alpha/beta/rc tags
29-
release = ''
30+
release = ""
3031

3132

3233
# -- General configuration ---------------------------------------------------
@@ -39,12 +40,12 @@
3940
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4041
# ones.
4142
extensions = [
42-
'sphinx.ext.autodoc',
43-
'sphinx.ext.doctest',
44-
'sphinx.ext.intersphinx',
45-
'sphinx.ext.mathjax',
46-
'sphinx.ext.viewcode',
47-
'sphinx.ext.napoleon',
43+
"sphinx.ext.autodoc",
44+
"sphinx.ext.doctest",
45+
"sphinx.ext.intersphinx",
46+
"sphinx.ext.mathjax",
47+
"sphinx.ext.viewcode",
48+
"sphinx.ext.napoleon",
4849
]
4950

5051
napoleon_google_docstring = False
@@ -54,16 +55,16 @@
5455
"""
5556

5657
# Add any paths that contain templates here, relative to this directory.
57-
templates_path = ['_templates']
58+
templates_path = ["_templates"]
5859

5960
# The suffix(es) of source filenames.
6061
# You can specify multiple suffix as a list of string:
6162
#
6263
# source_suffix = ['.rst', '.md']
63-
source_suffix = '.rst'
64+
source_suffix = ".rst"
6465

6566
# The master toctree document.
66-
master_doc = 'index'
67+
master_doc = "index"
6768

6869
# The language for content autogenerated by Sphinx. Refer to documentation
6970
# for a list of supported languages.
@@ -75,7 +76,7 @@
7576
# List of patterns, relative to source directory, that match files and
7677
# directories to ignore when looking for source files.
7778
# This pattern also affects html_static_path and html_extra_path.
78-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
79+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
7980

8081
# The name of the Pygments (syntax highlighting) style to use.
8182
pygments_style = None
@@ -86,7 +87,7 @@
8687
# The theme to use for HTML and HTML Help pages. See the documentation for
8788
# a list of builtin themes.
8889
#
89-
html_theme = 'sphinx_rtd_theme'
90+
html_theme = "sphinxdoc"
9091

9192
# Theme options are theme-specific and customize the look and feel of a theme
9293
# further. For a list of options available for each theme, see the
@@ -97,7 +98,7 @@
9798
# Add any paths that contain custom static files (such as style sheets) here,
9899
# relative to this directory. They are copied after the builtin static files,
99100
# so a file named "default.css" will overwrite the builtin "default.css".
100-
html_static_path = ['_static']
101+
html_static_path = ["_static"]
101102

102103
# Custom sidebar templates, must be a dictionary that maps document names
103104
# to template names.
@@ -113,7 +114,7 @@
113114
# -- Options for HTMLHelp output ---------------------------------------------
114115

115116
# Output file base name for HTML help builder.
116-
htmlhelp_basename = 'PyBaMMdoc'
117+
htmlhelp_basename = "PyBaMMdoc"
117118

118119

119120
# -- Options for LaTeX output ------------------------------------------------
@@ -122,15 +123,12 @@
122123
# The paper size ('letterpaper' or 'a4paper').
123124
#
124125
# 'papersize': 'letterpaper',
125-
126126
# The font size ('10pt', '11pt' or '12pt').
127127
#
128128
# 'pointsize': '10pt',
129-
130129
# Additional stuff for the LaTeX preamble.
131130
#
132131
# 'preamble': '',
133-
134132
# Latex figure (float) alignment
135133
#
136134
# 'figure_align': 'htbp',
@@ -140,19 +138,21 @@
140138
# (source start file, target name, title,
141139
# author, documentclass [howto, manual, or own class]).
142140
latex_documents = [
143-
(master_doc, 'PyBaMM.tex', 'PyBaMM Documentation',
144-
'Valentin Sulzer', 'manual'),
141+
(
142+
master_doc,
143+
"PyBaMM.tex",
144+
"PyBaMM Documentation",
145+
"Valentin Sulzer",
146+
"manual",
147+
)
145148
]
146149

147150

148151
# -- Options for manual page output ------------------------------------------
149152

150153
# One entry per manual page. List of tuples
151154
# (source start file, name, description, authors, manual section).
152-
man_pages = [
153-
(master_doc, 'pybamm', 'PyBaMM Documentation',
154-
[author], 1)
155-
]
155+
man_pages = [(master_doc, "pybamm", "PyBaMM Documentation", [author], 1)]
156156

157157

158158
# -- Options for Texinfo output ----------------------------------------------
@@ -161,9 +161,15 @@
161161
# (source start file, target name, title, author,
162162
# dir menu entry, description, category)
163163
texinfo_documents = [
164-
(master_doc, 'PyBaMM', 'PyBaMM Documentation',
165-
author, 'PyBaMM', 'One line description of project.',
166-
'Miscellaneous'),
164+
(
165+
master_doc,
166+
"PyBaMM",
167+
"PyBaMM Documentation",
168+
author,
169+
"PyBaMM",
170+
"One line description of project.",
171+
"Miscellaneous",
172+
)
167173
]
168174

169175

@@ -182,12 +188,12 @@
182188
# epub_uid = ''
183189

184190
# A list of files that should not be packed into the epub file.
185-
epub_exclude_files = ['search.html']
191+
epub_exclude_files = ["search.html"]
186192

187193

188194
# -- Extension configuration -------------------------------------------------
189195

190196
# -- Options for intersphinx extension ---------------------------------------
191197

192198
# Example configuration for intersphinx: refer to the Python standard library.
193-
intersphinx_mapping = {'https://docs.python.org/': None}
199+
intersphinx_mapping = {"https://docs.python.org/": None}

docs/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Welcome to PyBaMM's documentation!
1010
:maxdepth: 2
1111
:caption: Contents:
1212

13+
source/modules
1314

1415

1516
Indices and tables

run-tests.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,7 @@ def run_doctests():
7575
"""
7676
print("Checking if docs can be built.")
7777
p = subprocess.Popen(
78-
[
79-
"sphinx-build",
80-
"-b",
81-
"doctest",
82-
"docs/source",
83-
"docs/build/html",
84-
"-W",
85-
]
78+
["sphinx-build", "-b", "doctest", "docs", "docs/build/html", "-W"]
8679
)
8780
try:
8881
ret = p.wait()
@@ -335,7 +328,7 @@ def export_notebook(ipath, opath):
335328
if args.quick:
336329
has_run = True
337330
run_flake8()
338-
run_unit_tests("python")
331+
run_unit_tests()
339332
run_doctests()
340333
# Help
341334
if not has_run:

0 commit comments

Comments
 (0)