Skip to content

Commit

Permalink
mathajx instead of imgmath in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-phasecraft committed Sep 6, 2021
1 parent 640a218 commit d4a04fa
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 57 deletions.
127 changes: 71 additions & 56 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,31 @@
#
import os
import sys

# from recommonmark.parser import CommonMarkParser
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('../qmla'))
sys.path.insert(0, os.path.abspath(".."))
sys.path.insert(0, os.path.abspath("../qmla"))

html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"
numfig = True


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

project = 'Quantum Model Learning Agent'
copyright = '2021, Brian Flynn, Antonio Andreas Gentile, Raffaele Santagati'
author = 'Brian Flynn, Antonio Andreas Gentile, Raffaele Santagati'
project = "Quantum Model Learning Agent"
copyright = "2021, Brian Flynn, Antonio Andreas Gentile, Raffaele Santagati"
author = "Brian Flynn, Antonio Andreas Gentile, Raffaele Santagati"

# The short X.Y version
version = '1.0'
version = "1.0"
# The full version, including alpha/beta/rc tags
release = '1'
release = "1"

# -- Abstract ---------------------------------------------------

# The LaTeX preamble is placed here so that it can be used both by pngmath
# and by the LaTeX output plugin.
with open('abstract.txt', 'r') as f:
with open("abstract.txt", "r") as f:
abstract = f.read()

preamble = r"""
Expand Down Expand Up @@ -96,7 +97,9 @@
%\gdef\@thanks{}\gdef\@author{}\gdef\@title{}
}
\makeatother
""".replace("ABSTRACT_HERE", abstract)
""".replace(
"ABSTRACT_HERE", abstract
)

# source_parsers = {
# '.md': CommonMarkParser,
Expand All @@ -112,47 +115,48 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.imgmath',
'sphinx.ext.autosectionlabel',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinx.ext.extlinks',
# 'recommonmark'
# 'sphinxcontrib.bibtex', # must install from pip first # also needs python3.6 :(
# 'matplotlib.sphinxext.plot_directive'
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
# 'sphinx.ext.imgmath',
"sphinx.ext.mathjax",
"sphinx.ext.autosectionlabel",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.viewcode",
"sphinx.ext.extlinks",
# 'recommonmark'
# 'sphinxcontrib.bibtex', # must install from pip first # also needs python3.6 :(
# 'matplotlib.sphinxext.plot_directive'
]

autodoc_mock_imports = [
'qutip',
'qinfer',
'Cython',
'fermilib',
'networkx',
'fpdf',
'future',
'autopep8',
'psutil',
'projectq',
'sklearn',
'expm',
'lfig'
"qutip",
"qinfer",
"Cython",
"fermilib",
"networkx",
"fpdf",
"future",
"autopep8",
"psutil",
"projectq",
"sklearn",
"expm",
"lfig",
]
autosectionlabel_prefix_document = True

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

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -164,18 +168,18 @@
# 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']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
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.
#
html_theme = 'alabaster'
html_theme = "alabaster"

# 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
Expand All @@ -186,7 +190,7 @@
# 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_static_path = ["_static"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -202,7 +206,7 @@
# -- Options for HTMLHelp output ---------------------------------------------

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


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -211,15 +215,12 @@
# 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 @@ -229,25 +230,33 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'QuantumModelLearningAgent.tex', 'Quantum Model Learning Agent Documentation',
'Brian Flynn, Antonio Andreas Gentile, Raffaele Santagati', 'manual'),
(
master_doc,
"QuantumModelLearningAgent.tex",
"Quantum Model Learning Agent Documentation",
"Brian Flynn, Antonio Andreas Gentile, Raffaele Santagati",
"manual",
),
]

# Additional stuff for the LaTeX preamble.
latex_preamble = preamble
# In Sphinx 1.5, this now appears as latex_elements, so we pack the
# preamble that way, too.
latex_elements = {
'preamble': preamble
}
latex_elements = {"preamble": preamble}

# -- 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, 'quantummodellearningagent', 'Quantum Model Learning Agent Documentation',
[author], 1)
(
master_doc,
"quantummodellearningagent",
"Quantum Model Learning Agent Documentation",
[author],
1,
)
]


Expand All @@ -257,16 +266,22 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'QuantumModelLearningAgent', 'Quantum Model Learning Agent Documentation',
author, 'QuantumModelLearningAgent', 'Machine learning for identifying models of quantum systems.',
'Miscellaneous'),
(
master_doc,
"QuantumModelLearningAgent",
"Quantum Model Learning Agent Documentation",
author,
"QuantumModelLearningAgent",
"Machine learning for identifying models of quantum systems.",
"Miscellaneous",
),
]

## EXTLINKS CONFIGURATION ######################################################

# allow e.g. arxiv links
extlinks = {
'arxiv': ('https://arxiv.org/abs/2002.06169', 'arXiv:'),
"arxiv": ("https://arxiv.org/abs/2002.06169", "arXiv:"),
# 'doi': ('https://dx.doi.org/%s', 'doi:'),
# 'hdl': ('https://hdl.handle.net/%s', 'hdl:')
}
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,4 @@ def __init__(
}

self.num_processes_to_parallelise_over = 16
self.timing_insurance_factor = 10
self.timing_insurance_factor = 6

0 comments on commit d4a04fa

Please sign in to comment.