1818# absolute, like shown here.
1919# sys.path.append(os.path.abspath('some/directory'))
2020
21-
2221import os
23- import sys
2422import pytensor
2523
26- pytensor_path = os .path .join (os .path .dirname (__file__ ), os .pardir )
27- sys .path .append (os .path .abspath (pytensor_path ))
28- import versioneer
29-
3024# General configuration
3125# ---------------------
3226
3832 "sphinx.ext.doctest" ,
3933 "sphinx.ext.napoleon" ,
4034 "sphinx.ext.linkcode" ,
35+ "sphinx.ext.mathjax" ,
4136]
4237
38+ needs_sphinx = "3"
39+
4340todo_include_todos = True
4441napoleon_google_docstring = False
4542napoleon_include_special_with_doc = False
4643
47- # We do it like this to support multiple sphinx version without having warning.
48- # Our buildbot consider warning as error.
49- try :
50- from sphinx .ext import imgmath
51-
52- extensions .append ("sphinx.ext.imgmath" )
53- except ImportError :
54- try :
55- from sphinx .ext import pngmath
56-
57- extensions .append ("sphinx.ext.pngmath" )
58- except ImportError :
59- pass
60-
61-
6244# Add any paths that contain templates here, relative to this directory.
6345templates_path = [".templates" ]
6446
7052
7153# General substitutions.
7254project = "PyTensor"
73- copyright = "PyTensor Developers, 2021; PyMC Developers, 2020- 2021; 2008--2019, LISA lab "
55+ copyright = "PyMC Team 2022-present,2020- 2021; Aesara Developers, 2021-2022; LISA Lab, 2008--2019"
7456
7557# The default replacements for |version| and |release|, also used in various
7658# other places throughout the built documents.
7759#
7860
79- # We need this hokey-pokey because versioneer needs the current
80- # directory to be the root of the project to work.
81- _curpath = os .getcwd ()
82- os .chdir (os .path .dirname (os .path .dirname (__file__ )))
61+ version = pytensor .__version__
62+ if os .environ .get ("READTHEDOCS" , False ):
63+ rtd_version = os .environ .get ("READTHEDOCS_VERSION" , "" )
64+ if rtd_version .lower () == "stable" :
65+ version = pymc .__version__ .split ("+" )[0 ]
66+ elif rtd_version .lower () == "latest" :
67+ version = "dev"
68+ else :
69+ version = rtd_version
70+ else :
71+ rtd_version = "local"
8372# The full version, including alpha/beta/rc tags.
84- release = versioneer .get_version ()
85- # The short X.Y version.
86- version = "." .join (release .split ("." )[:2 ])
87- os .chdir (_curpath )
88- del _curpath
73+ release = version
8974
9075# There are two options for replacing |today|: either, you set today to some
9176# non-false value, then it is used:
132117# https://github.com/readthedocs/sphinx_rtd_theme/issues/766#issuecomment-513852197
133118html4_writer = True
134119
135- # Read the docs style:
136- if os .environ .get ("READTHEDOCS" ) != "True" :
137- try :
138- import sphinx_rtd_theme
139- except ImportError :
140- pass # assume we have sphinx >= 1.3
141- else :
142- html_theme_path = [sphinx_rtd_theme .get_html_theme_path ()]
143- html_theme = "sphinx_rtd_theme"
144-
145-
146- def setup (app ):
147- app .add_css_file ("fix_rtd.css" )
120+ html_logo = "images/pytensor_logo.svg"
121+ html_theme = "pymc_sphinx_theme"
122+ html_theme_options = {
123+ "use_search_override" : False ,
124+ }
125+ html_context = {
126+ "github_user" : "pymc-devs" ,
127+ "github_repo" : "pytensor" ,
128+ "github_version" : "main" ,
129+ "doc_path" : "doc" ,
130+ "default_mode" : "light" ,
131+ }
148132
149133
150134# The name for this set of Sphinx documents. If None, it defaults to
@@ -166,7 +150,7 @@ def setup(app):
166150# Add any paths that contain custom static files (such as style sheets) here,
167151# relative to this directory. They are copied after the builtin static files,
168152# so a file named "default.css" will overwrite the builtin "default.css".
169- html_static_path = [".static" , " images" , "library/d3viz/examples" ]
153+ html_static_path = ["images" , "library/d3viz/examples" ]
170154
171155# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
172156# using the given strftime format.
0 commit comments