Skip to content

Commit cb142b4

Browse files
authored
fix website rendering (#540)
* update conf.py to updated versions * update rtd config * Use older versions * fix requirements * try newer versions with older ablog
1 parent f33145a commit cb142b4

8 files changed

+81
-55
lines changed

.readthedocs.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ version: 2
33
sphinx:
44
configuration: examples/conf.py
55

6+
build:
7+
os: ubuntu-22.04
8+
tools:
9+
python: "3.10"
10+
611
python:
7-
version: "3.8"
812
install:
913
- requirements: requirements-docs.txt

_templates/nb-badges.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
{% if pagename in ablog %}
2+
13
<!-- Generate correct links and render github/binder/colab badges -->
24
{% set gh_basepath = github_user + '/' + github_repo + '/blob/' + github_version + '/' %}
35
{% set encoded_base = github_user + '%252F' + github_repo %}
46
{% set gh_binder = github_user + '/' + github_repo + '/' + github_version %}
57
{% set doc_path_aux = doc_path | trim('/') %}
6-
{% set file_path = doc_path_aux + '/' + pagename + page_source_suffix %}
8+
{% set file_path = doc_path_aux + '/' + pagename + ".ipynb" %}
79
{% set encoded_path = file_path | replace("/", "%252F") %}
810

911

@@ -19,3 +21,4 @@
1921
<img src="{{ pathto('_static/colab.svg', 1) }}" alt="Open In Colab"/></a>
2022
</p>
2123
</div>
24+
{% endif %}

_templates/page.html

-26
This file was deleted.

_templates/rendered_citation.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- continuation of examples/page_footer.md -->
2+
{% if pagename in ablog %}
3+
{% set post = ablog[pagename] %}
4+
{% for coll in post.author %}
5+
{% if coll|length %}
6+
{{ coll }}
7+
{% if loop.index < post.author | length %},{% endif %}
8+
{% else %}
9+
{{ coll }}
10+
{% if loop.index < post.author | length %},{% endif %}
11+
{% endif %}
12+
{% endfor %}. "{{ title.split(' — ')[0] }}". In: <i>PyMC Examples</i>. Ed. by PyMC Team. DOI: <a href={{ doi_url }}>{{ doi_code }}</a>
13+
{% endif %}

examples/case_studies/bart_heteroscedasticity.ipynb

+51-23
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"cells": [
33
{
4-
"attachments": {},
54
"cell_type": "markdown",
65
"id": "domestic-remove",
76
"metadata": {},
@@ -10,14 +9,13 @@
109
"# Modeling Heteroscedasticity with BART\n",
1110
"\n",
1211
":::{post} January, 2023\n",
13-
":tags: bart regression \n",
12+
":tags: BART, regression\n",
1413
":category: beginner, reference\n",
15-
":author: [Juan Orduz](https://juanitorduz.github.io/)\n",
14+
":author: Juan Orduz\n",
1615
":::"
1716
]
1817
},
1918
{
20-
"attachments": {},
2119
"cell_type": "markdown",
2220
"id": "72588976-efc3-4adc-bec2-bc5b6ac4b7e1",
2321
"metadata": {},
@@ -60,7 +58,6 @@
6058
]
6159
},
6260
{
63-
"attachments": {},
6461
"cell_type": "markdown",
6562
"id": "4cae4407",
6663
"metadata": {},
@@ -167,7 +164,6 @@
167164
]
168165
},
169166
{
170-
"attachments": {},
171167
"cell_type": "markdown",
172168
"id": "6d6364a9",
173169
"metadata": {},
@@ -206,7 +202,6 @@
206202
]
207203
},
208204
{
209-
"attachments": {},
210205
"cell_type": "markdown",
211206
"id": "5c3971f2",
212207
"metadata": {},
@@ -215,7 +210,6 @@
215210
]
216211
},
217212
{
218-
"attachments": {},
219213
"cell_type": "markdown",
220214
"id": "e8a3ce48",
221215
"metadata": {},
@@ -237,7 +231,6 @@
237231
]
238232
},
239233
{
240-
"attachments": {},
241234
"cell_type": "markdown",
242235
"id": "a29b706c",
243236
"metadata": {},
@@ -253,7 +246,52 @@
253246
"outputs": [
254247
{
255248
"data": {
256-
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Generated by graphviz version 2.50.0 (0)\n -->\n<!-- Pages: 1 -->\n<svg width=\"138pt\" height=\"260pt\"\n viewBox=\"0.00 0.00 138.00 259.91\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 255.91)\">\n<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-255.91 134,-255.91 134,4 -4,4\"/>\n<g id=\"clust1\" class=\"cluster\">\n<title>cluster2 x 200</title>\n<path fill=\"none\" stroke=\"black\" d=\"M20,-129.95C20,-129.95 110,-129.95 110,-129.95 116,-129.95 122,-135.95 122,-141.95 122,-141.95 122,-231.91 122,-231.91 122,-237.91 116,-243.91 110,-243.91 110,-243.91 20,-243.91 20,-243.91 14,-243.91 8,-237.91 8,-231.91 8,-231.91 8,-141.95 8,-141.95 8,-135.95 14,-129.95 20,-129.95\"/>\n<text text-anchor=\"middle\" x=\"93\" y=\"-137.75\" font-family=\"Times,serif\" font-size=\"14.00\">2 x 200</text>\n</g>\n<g id=\"clust2\" class=\"cluster\">\n<title>cluster200</title>\n<path fill=\"none\" stroke=\"black\" d=\"M26,-8C26,-8 104,-8 104,-8 110,-8 116,-14 116,-20 116,-20 116,-109.95 116,-109.95 116,-115.95 110,-121.95 104,-121.95 104,-121.95 26,-121.95 26,-121.95 20,-121.95 14,-115.95 14,-109.95 14,-109.95 14,-20 14,-20 14,-14 20,-8 26,-8\"/>\n<text text-anchor=\"middle\" x=\"97.5\" y=\"-15.8\" font-family=\"Times,serif\" font-size=\"14.00\">200</text>\n</g>\n<!-- w -->\n<g id=\"node1\" class=\"node\">\n<title>w</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"65\" cy=\"-198.43\" rx=\"48.58\" ry=\"37.45\"/>\n<text text-anchor=\"middle\" x=\"65\" y=\"-209.73\" font-family=\"Times,serif\" font-size=\"14.00\">w</text>\n<text text-anchor=\"middle\" x=\"65\" y=\"-194.73\" font-family=\"Times,serif\" font-size=\"14.00\">~</text>\n<text text-anchor=\"middle\" x=\"65\" y=\"-179.73\" font-family=\"Times,serif\" font-size=\"14.00\">BART_w</text>\n</g>\n<!-- y -->\n<g id=\"node2\" class=\"node\">\n<title>y</title>\n<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"65\" cy=\"-76.48\" rx=\"43.27\" ry=\"37.45\"/>\n<text text-anchor=\"middle\" x=\"65\" y=\"-87.78\" font-family=\"Times,serif\" font-size=\"14.00\">y</text>\n<text text-anchor=\"middle\" x=\"65\" y=\"-72.78\" font-family=\"Times,serif\" font-size=\"14.00\">~</text>\n<text text-anchor=\"middle\" x=\"65\" y=\"-57.78\" font-family=\"Times,serif\" font-size=\"14.00\">Gamma</text>\n</g>\n<!-- w&#45;&gt;y -->\n<g id=\"edge1\" class=\"edge\">\n<title>w&#45;&gt;y</title>\n<path fill=\"none\" stroke=\"black\" d=\"M65,-160.79C65,-149.38 65,-136.65 65,-124.63\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"68.5,-124.31 65,-114.31 61.5,-124.31 68.5,-124.31\"/>\n</g>\n</g>\n</svg>\n",
249+
"image/svg+xml": [
250+
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
251+
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
252+
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
253+
"<!-- Generated by graphviz version 2.50.0 (0)\n",
254+
" -->\n",
255+
"<!-- Pages: 1 -->\n",
256+
"<svg width=\"138pt\" height=\"260pt\"\n",
257+
" viewBox=\"0.00 0.00 138.00 259.91\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
258+
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 255.91)\">\n",
259+
"<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-255.91 134,-255.91 134,4 -4,4\"/>\n",
260+
"<g id=\"clust1\" class=\"cluster\">\n",
261+
"<title>cluster2 x 200</title>\n",
262+
"<path fill=\"none\" stroke=\"black\" d=\"M20,-129.95C20,-129.95 110,-129.95 110,-129.95 116,-129.95 122,-135.95 122,-141.95 122,-141.95 122,-231.91 122,-231.91 122,-237.91 116,-243.91 110,-243.91 110,-243.91 20,-243.91 20,-243.91 14,-243.91 8,-237.91 8,-231.91 8,-231.91 8,-141.95 8,-141.95 8,-135.95 14,-129.95 20,-129.95\"/>\n",
263+
"<text text-anchor=\"middle\" x=\"93\" y=\"-137.75\" font-family=\"Times,serif\" font-size=\"14.00\">2 x 200</text>\n",
264+
"</g>\n",
265+
"<g id=\"clust2\" class=\"cluster\">\n",
266+
"<title>cluster200</title>\n",
267+
"<path fill=\"none\" stroke=\"black\" d=\"M26,-8C26,-8 104,-8 104,-8 110,-8 116,-14 116,-20 116,-20 116,-109.95 116,-109.95 116,-115.95 110,-121.95 104,-121.95 104,-121.95 26,-121.95 26,-121.95 20,-121.95 14,-115.95 14,-109.95 14,-109.95 14,-20 14,-20 14,-14 20,-8 26,-8\"/>\n",
268+
"<text text-anchor=\"middle\" x=\"97.5\" y=\"-15.8\" font-family=\"Times,serif\" font-size=\"14.00\">200</text>\n",
269+
"</g>\n",
270+
"<!-- w -->\n",
271+
"<g id=\"node1\" class=\"node\">\n",
272+
"<title>w</title>\n",
273+
"<ellipse fill=\"none\" stroke=\"black\" cx=\"65\" cy=\"-198.43\" rx=\"48.58\" ry=\"37.45\"/>\n",
274+
"<text text-anchor=\"middle\" x=\"65\" y=\"-209.73\" font-family=\"Times,serif\" font-size=\"14.00\">w</text>\n",
275+
"<text text-anchor=\"middle\" x=\"65\" y=\"-194.73\" font-family=\"Times,serif\" font-size=\"14.00\">~</text>\n",
276+
"<text text-anchor=\"middle\" x=\"65\" y=\"-179.73\" font-family=\"Times,serif\" font-size=\"14.00\">BART_w</text>\n",
277+
"</g>\n",
278+
"<!-- y -->\n",
279+
"<g id=\"node2\" class=\"node\">\n",
280+
"<title>y</title>\n",
281+
"<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"65\" cy=\"-76.48\" rx=\"43.27\" ry=\"37.45\"/>\n",
282+
"<text text-anchor=\"middle\" x=\"65\" y=\"-87.78\" font-family=\"Times,serif\" font-size=\"14.00\">y</text>\n",
283+
"<text text-anchor=\"middle\" x=\"65\" y=\"-72.78\" font-family=\"Times,serif\" font-size=\"14.00\">~</text>\n",
284+
"<text text-anchor=\"middle\" x=\"65\" y=\"-57.78\" font-family=\"Times,serif\" font-size=\"14.00\">Gamma</text>\n",
285+
"</g>\n",
286+
"<!-- w&#45;&gt;y -->\n",
287+
"<g id=\"edge1\" class=\"edge\">\n",
288+
"<title>w&#45;&gt;y</title>\n",
289+
"<path fill=\"none\" stroke=\"black\" d=\"M65,-160.79C65,-149.38 65,-136.65 65,-124.63\"/>\n",
290+
"<polygon fill=\"black\" stroke=\"black\" points=\"68.5,-124.31 65,-114.31 61.5,-124.31 68.5,-124.31\"/>\n",
291+
"</g>\n",
292+
"</g>\n",
293+
"</svg>\n"
294+
],
257295
"text/plain": [
258296
"<graphviz.graphs.Digraph at 0x7f31ae9c47f0>"
259297
]
@@ -272,7 +310,6 @@
272310
]
273311
},
274312
{
275-
"attachments": {},
276313
"cell_type": "markdown",
277314
"id": "9aa885a3",
278315
"metadata": {},
@@ -292,13 +329,7 @@
292329
"text": [
293330
"Multiprocess sampling (4 chains in 4 jobs)\n",
294331
"PGBART: [w]\n",
295-
"PGBART: [w]\n"
296-
]
297-
},
298-
{
299-
"name": "stderr",
300-
"output_type": "stream",
301-
"text": [
332+
"PGBART: [w]\n",
302333
"Sampling 4 chains for 1_000 tune and 1_000 draw iterations (4_000 + 4_000 draws total) took 136 seconds.\n",
303334
"The rhat statistic is larger than 1.01 for some parameters. This indicates problems during sampling. See https://arxiv.org/abs/1903.08008 for details\n"
304335
]
@@ -313,7 +344,6 @@
313344
]
314345
},
315346
{
316-
"attachments": {},
317347
"cell_type": "markdown",
318348
"id": "eba7cee5",
319349
"metadata": {},
@@ -392,7 +422,6 @@
392422
]
393423
},
394424
{
395-
"attachments": {},
396425
"cell_type": "markdown",
397426
"id": "d1775acb",
398427
"metadata": {},
@@ -401,7 +430,6 @@
401430
]
402431
},
403432
{
404-
"attachments": {},
405433
"cell_type": "markdown",
406434
"id": "b743d58b-2678-4e17-9947-a8fe4ed03e21",
407435
"metadata": {},
@@ -479,7 +507,7 @@
479507
],
480508
"metadata": {
481509
"kernelspec": {
482-
"display_name": "pymc-examples-env",
510+
"display_name": "Python 3 (ipykernel)",
483511
"language": "python",
484512
"name": "python3"
485513
},
@@ -493,7 +521,7 @@
493521
"name": "python",
494522
"nbconvert_exporter": "python",
495523
"pygments_lexer": "ipython3",
496-
"version": "3.10.9"
524+
"version": "3.10.0"
497525
},
498526
"vscode": {
499527
"interpreter": {

examples/case_studies/bart_heteroscedasticity.myst.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jupytext:
55
format_name: myst
66
format_version: 0.13
77
kernelspec:
8-
display_name: pymc-examples-env
8+
display_name: Python 3 (ipykernel)
99
language: python
1010
name: python3
1111
---
@@ -14,9 +14,9 @@ kernelspec:
1414
# Modeling Heteroscedasticity with BART
1515

1616
:::{post} January, 2023
17-
:tags: bart regression
17+
:tags: BART, regression
1818
:category: beginner, reference
19-
:author: [Juan Orduz](https://juanitorduz.github.io/)
19+
:author: Juan Orduz
2020
:::
2121

2222
+++

examples/conf.py

+4
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ def setup(app: Sphinx):
7575
"logo": {
7676
"link": "https://www.pymc.io",
7777
},
78+
"article_header_end": ["nb-badges"],
79+
"show_prev_next": True,
80+
"article_footer_items": ["rendered_citation.html"],
7881
}
7982
version = os.environ.get("READTHEDOCS_VERSION", "")
8083
version = version if "." in version else "main"
@@ -118,6 +121,7 @@ def setup(app: Sphinx):
118121
"contributors": ("PyMC Contributors", "https://docs.pymc.io"),
119122
}
120123
blog_default_author = "contributors"
124+
post_show_prev_next = False
121125
fontawesome_included = True
122126
# post_redirect_refresh = 1
123127
# post_auto_image = 1

requirements-docs.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pymc-sphinx-theme==0.13
44
sphinx-design
55
sphinx-copybutton
66
sphinxcontrib-bibtex
7-
ablog
7+
ablog<0.11
88
sphinxext-opengraph
99
sphinx-codeautolink
1010
sphinx-notfound-page

0 commit comments

Comments
 (0)