Skip to content

Commit ee11ee9

Browse files
junpenglaotwiecki
authored andcommitted
fix hyper link
build locally, passed.
1 parent f7cfe9c commit ee11ee9

File tree

7 files changed

+32
-18
lines changed

7 files changed

+32
-18
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/source/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@
7878
<h2 class="ui dividing header">In-Depth Guides</h2>
7979
<div class="ui four stackable cards">
8080

81-
<a class="ui link card" href="/prob_dists.html">
81+
<a class="ui link card" href="/Probability_Distributions.html">
8282
<div class="content">
8383
<div class="header">Probability Distributions</div>
8484
<div class="description">PyMC3 includes a comprehensive set of pre-defined statistical distributions that can be used as model building blocks.
8585
</div>
8686
</div>
8787
</a>
8888

89-
<a class="ui link card" href="/gp.html">
89+
<a class="ui link card" href="/Gaussian_Processes.html">
9090
<div class="content">
9191
<div class="header">Gaussian Processes</div>
9292
<div class="description">Sometimes an unknown parameter or variable in a model is not a scalar value or a fixed-length vector, but a function. A Gaussian process (GP) can be used as a prior probability distribution whose support is over the space of continuous functions. PyMC3 provides rich support for defining and using GPs.
@@ -102,9 +102,9 @@
102102
</div>
103103
</a>
104104

105-
<a class="ui link card" href="/theano.html">
105+
<a class="ui link card" href="/PyMC3_and_Theano.html">
106106
<div class="content">
107-
<div class="header">Theano</div>
107+
<div class="header">PyMC3 and Theano</div>
108108
<div class="description">Theano is the deep-learning library PyMC3 uses to construct probability distributions and then access the gradient in order to implement cutting edge inference algorithms. More advanced models may be built by understanding this layer.
109109
</div>
110110
</div>

docs/source/notebooks/table_of_contents_tutorials.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
Gallery.contents = {
22
"api_quickstart": "Basics",
33
"variational_api_quickstart": "Basics",
4-
"theano": "Basics",
5-
"prob_dists": "Basics",
6-
"gp": "Basics",
4+
"PyMC3_and_Theano.rst": "Basics",
5+
"Probability_Distributions.rst": "Basics",
6+
"Gaussian_Processes.rst": "Basics",
77
"sampling_compound_step": "Deep dives",
88
"sampler-stats": "Deep dives",
99
"Diagnosing_biased_Inference_with_Divergences": "Deep dives",
10-
"advanced_theano": "Deep dives",
10+
"Advanced_usage_of_Theano_in_PyMC3.rst": "Deep dives",
1111
"getting_started": "Deep dives",
1212
"PyMC3_tips_and_heuristic": "How-To",
1313
"blackbox_external_likelihood": "How-To",

docs/source/sphinxext/gallery_generator.py

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
from matplotlib import image
1919

2020
DOC_SRC = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
21+
DEFAULT_IMG_LOC = os.path.join(
22+
os.path.dirname(DOC_SRC), "logos", "PyMC3.png"
23+
)
2124
TABLE_OF_CONTENTS_FILENAME = "table_of_contents_{}.js"
2225

2326
INDEX_TEMPLATE = """
@@ -76,9 +79,7 @@ def __init__(self, filename, target_dir):
7679
with open(filename, "r") as fid:
7780
self.json_source = json.load(fid)
7881
self.pagetitle = self.extract_title()
79-
self.default_image_loc = os.path.join(
80-
os.path.dirname(DOC_SRC), "logos", "PyMC3.png"
81-
)
82+
self.default_image_loc = DEFAULT_IMG_LOC
8283

8384
# Only actually run it if the output RST file doesn't
8485
# exist or it was modified less recently than the example
@@ -156,17 +157,30 @@ def build_gallery(srcdir, gallery):
156157

157158
if not os.path.exists(source_dir):
158159
os.makedirs(source_dir)
160+
161+
# Create default image
162+
png_path = os.path.join(os.path.join(target_dir, "_images"), "default.png")
163+
shutil.copy(DEFAULT_IMG_LOC, png_path)
164+
create_thumbnail(png_path)
159165

160166
# Write individual example files
161167
data = {}
162168
for basename in sorted(tocjs.contents):
163-
filename = os.path.join(source_dir, basename + ".ipynb")
164-
ex = NotebookGenerator(filename, target_dir)
165-
data[ex.stripped_name] = {
166-
"title": ex.pagetitle,
167-
"url": os.path.join(os.sep, gallery, ex.output_html),
168-
"thumb": os.path.basename(ex.png_path),
169-
}
169+
if basename.find(".rst") < 1:
170+
filename = os.path.join(source_dir, basename + ".ipynb")
171+
ex = NotebookGenerator(filename, target_dir)
172+
data[ex.stripped_name] = {
173+
"title": ex.pagetitle,
174+
"url": os.path.join(os.sep, gallery, ex.output_html),
175+
"thumb": os.path.basename(ex.png_path),
176+
}
177+
else:
178+
filename = basename.split(".")[0]
179+
data[basename] = {
180+
"title": " ".join(filename.split("_")),
181+
"url": os.path.join(os.sep, gallery, "../"+filename+".html"),
182+
"thumb": png_path,
183+
}
170184

171185
js_file = os.path.join(image_dir, "gallery_{}_contents.js".format(gallery))
172186
with open(table_of_contents_file, "r") as toc:

0 commit comments

Comments
 (0)