Skip to content

Switch to pydata sphinx theme #4761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions conda-envs/environment-dev-py37.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ dependencies:
- numpydoc>=0.9
- pandas=0.24
- pre-commit>=2.8.0
- pydata-sphinx-theme
- pytest-cov>=2.5
- pytest>=3.0
- python-graphviz
- python=3.7
- scipy=1.2
- sphinx-autobuild>=0.7
- sphinx-panels
- sphinx>=1.5
- watermark
2 changes: 2 additions & 0 deletions conda-envs/environment-dev-py38.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ dependencies:
- myst-nb
- numpydoc>=0.9
- pre-commit>=2.8.0
- pydata-sphinx-theme
- pytest-cov>=2.5
- pytest>=3.0
- python-graphviz
- python=3.8
- sphinx-autobuild>=0.7
- sphinx-panels
- sphinx>=1.5
- watermark
2 changes: 2 additions & 0 deletions conda-envs/environment-dev-py39.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ dependencies:
- myst-nb
- numpydoc>=0.9
- pre-commit>=2.8.0
- pydata-sphinx-theme
- pytest-cov>=2.5
- pytest>=3.0
- python-graphviz
- python=3.9
- sphinx-autobuild>=0.7
- sphinx-panels
- sphinx>=1.5
- watermark
26 changes: 26 additions & 0 deletions docs/source/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{% extends "!layout.html" %}

<!-- Hide left sidebar in home page -->
{% block docs_sidebar %}
{% if pagename != 'index' %}
{{ super() }}
{% endif %}
{% endblock %}

<!-- Hide right sidebar in home page -->
{% block docs_toc %}
{% if pagename != 'index' %}
{{ super() }}
{% endif %}
{% endblock %}

<!-- Make body have full width in home page -->
{% block docs_main %}
{% if pagename == 'index' %}
<main class="col-12 py-md-5 pl-md-5 pr-md-4 bd-content" role="main">
{% block body %} {% endblock %}
</main>
{% else %}
{{ super() }}
{% endif %}
{% endblock %}
1 change: 1 addition & 0 deletions docs/source/_templates/navbar-version.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ version }}
52 changes: 37 additions & 15 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"matplotlib.sphinxext.plot_directive",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.viewcode",
"sphinx.ext.mathjax",
"sphinx.ext.intersphinx",
"numpydoc",
Expand All @@ -48,6 +49,7 @@
"sphinx.ext.napoleon",
"gallery_generator",
"myst_nb",
"sphinx_panels",
]

# Don't auto-generate summary for class members.
Expand Down Expand Up @@ -104,7 +106,13 @@
# directories to ignore when looking for source files.
exclude_patterns = ["_build", "**.ipynb_checkpoints"]

# myst and panels config
jupyter_execute_notebooks = "off"
myst_heading_anchors = 3
myst_enable_extensions = [
"colon_fence",
]
panels_add_bootstrap_css = False

# The reST default role (used for this markup: `text`) to use for all
# documents.
Expand Down Expand Up @@ -143,26 +151,40 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme_path = ["."]
html_theme = "semantic_sphinx"
html_theme = "pydata_sphinx_theme"


# 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
# documentation.

html_theme_options = {
"navbar_links": [
("Tutorials", "nb_tutorials/index"),
("Examples", "nb_examples/index"),
("Books + Videos", "learn"),
("API", "api"),
("Developer Guide", "developer_guide"),
("About PyMC3", "about"),
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/pymc-devs/pymc3",
"icon": "fab fa-github-square",
},
{
"name": "Twitter",
"url": "https://twitter.com/pymc_devs",
"icon": "fab fa-twitter-square",
},
],
# "fixed_sidebar": "false",
# "description": "Probabilistic Programming in Python: Bayesian Modeling and Probabilistic Machine Learning with Aesara"
"show_prev_next": False,
"navbar_start": ["navbar-logo", "navbar-version"],
"navbar_end": ["search-field.html", "navbar-icon-links.html"],
"search_bar_text": "Search...",
"use_edit_page_button": False, # TODO: see how to skip of fix for generated pages
"google_analytics_id": "UA-176578023-1",
}
html_context = {
"github_user": "pymc-devs",
"github_repo": "pymc3",
"github_version": "main",
"doc_path": "docs/source/",
}
html_sidebars = {"learn": [], "**": ["sidebar-nav-bs.html", "sidebar-ethical-ads.html"]}

# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
Expand Down Expand Up @@ -202,7 +224,7 @@
# html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
html_sidebars = {"**": ["about.html", "navigation.html", "searchbox.html"]}
# html_sidebars = {"**": ["about.html", "navigation.html", "searchbox.html"]}

# Additional templates that should be rendered to pages, maps page names to
# template names.
Expand Down Expand Up @@ -330,6 +352,6 @@
# texinfo_no_detailmenu = False


def setup(app):
app.add_css_file("https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css")
app.add_css_file("default.css")
# def setup(app):
# app.add_css_file("https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css")
# app.add_css_file("default.css")
11 changes: 11 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
</div>
<div class="eight wide right floated column">

.. toctree::
:maxdepth: 1
:hidden:

Tutorials<nb_tutorials/index>
Examples<nb_examples/index>
Books + Videos<learn>
API<api>
Developer Guide<developer_guide>
About PyMC3<about>

.. code-block:: python

import pymc3 as pm
Expand Down
182 changes: 182 additions & 0 deletions docs/source/learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
# Learn Bayesian statistics

## ...with others!

:::{list-table}
:header-rows: 0
:widths: 10 150

* - {fa}`discourse,fa-2x,style=fab`
- [Discourse Forum](https://discourse.pymc.io/)

The PyMC3 discourse forum is a great place to ask general questions about Bayesian statistics, or more specific ones about PyMC3 usage.
* - {fa}`meetup,fa-2x,style=fab`
- Conferences

PyMC3 talks have been given at a number of conferences, including [PyCon](https://us.pycon.org/),
[PyData](https://pydata.org/events/), and [ODSC](https://odsc.com/) events.
* - {fa}`python,fa-2x,style=fab`
- [Meetup Groups](https://www.meetup.com/)

Many areas have an local Bayesian, PyData, or Stan meetup.
:::

## ...with a video!

:::{list-table}
:header-rows: 0
:widths: 10 150

* - {fa}`youtube,fa-2x,style=fab`
- [YouTube Playlist](https://www.youtube.com/playlist?list=PL1Ma_1DBbE82OVW8Fz_6Ts1oOeyOAiovy)

There is an actively curated playlist of PyMC3 talks on YouTube.
* - {fa}`youtube,fa-2x,style=fab`
- [Advance Bayesian Modelling with PyMC3](https://github.com/junpenglao/advance-bayesian-modelling-with-PyMC3)

A two days advance workshop in May 2018 @CEAi in the Czech Republic.
:::

## ...with a book!

::::{panels}
:column: col-lg-4 col-md-4

---
:img-top: https://camo.githubusercontent.com/4a0aca82ca82efab71747d00db30f3a68de98e82/687474703a2f2f692e696d6775722e636f6d2f36444b596250622e706e673f31

Bayesian Methods for Hackers

*Cameron Davidson-Pilon*
^^^^^^^^

Fantastic book with many applied code examples.

:::{list-table}
:header-rows: 0
:widths: 4 60

* - [{fa}`link`][hackers source]
- [Github Repo][hackers source]
* - [{fa}`link`][hackers homepage]
- [Project Homepage][hackers homepage]
:::

---
:img-top: https://lh3.googleusercontent.com/qU5yWpiVSkujyCnRZhQo8cBUrW_3e_7Cx4jEs5yfpmMbEEuDnxTGOELhy2x7F7qkwFwQJ4pFYNszZhNpN1jCSdrdHsVUHtf1Mg6F8qwb3SQe1TDE=w1280

Doing Bayesian Data Analysis

*John Kruschke*
^^^^^^^^

Principled introduction to Bayesian data analysis.

:::{list-table}
:header-rows: 0
:widths: 4 60

* - [{fa}`link`][dbda website]
- [Book Website][dbda website]
* - [{fa}`link`][dbda 1st ed nb]
- [PyMC3 notebooks for *first edition*][dbda 1st ed nb]
* - [{fa}`link`][dbda 2nd ed nb]
- [PyMC3 notebooks for *second edition*][dbda 2nd ed nb]
:::

---
:img-top: http://xcelab.net/rm/wp-content/uploads/2012/01/9781482253443-191x300.jpg

Statistical Rethingking

*Richard McElreath*
^^^^^^^^

A Bayesian Course with Examples in R and Stan.

:::{list-table}
:header-rows: 0
:widths: 4 60

* - [{fa}`link`][rethinking website]
- [Book Website][rethinking website]
* - [{fa}`link`][rethinking port]
- [PyMC3 port of the code][rethinking port]
:::

---
:img-top: https://raw.githubusercontent.com/aloctavodia/BAP/master/Cover.png

Bayesian Analysis with Python

*Osvaldo Martin*
^^^^^^^^

A great introductory book written by a maintainer of PyMC3.

:::{list-table}
:header-rows: 0
:widths: 4 60

* - [{fa}`link`][bap website]
- [Book Website][bap website]
* - [{fa}`link`][bap code]
- [Code and errata in PyMC3][bap code]
:::

---
:img-top: https://images-na.ssl-images-amazon.com/images/I/51K33XI2I8L._SX330_BO1,204,203,200_.jpg

Bayesian Cognitive Modeling: A Practical Course

*Michael Lee and Eric-Jan Wagenmakers*
^^^^^^^^

Focused on using Bayesian statistics in cognitive modeling.

:::{list-table}
:header-rows: 0
:widths: 4 60

* - [{fa}`link`][bcm website]
- [Book Website][bcm website]
* - [{fa}`link`][bcm code]
- [PyMC3 implementation][bcm code]
:::

---
:img-top: http://www.stat.columbia.edu/~gelman/book/bda_cover.png

Bayesian Data Analysis

*Andrew Gelman, John Carlin, Hal Stern, David Dunson, Aki Vehtari, and Donald Rubin*
^^^^^^^^

A comprehensive, standard, and wonderful textbook on Bayesian methods.

:::{list-table}
:header-rows: 0
:widths: 4 60

* - [{fa}`link`][bda3 website]
- [Book Website][bda3 website]
* - [{fa}`link`][bda3 port]
- [Examples and exercises implemented in PyMC3][bda3 port]
:::

::::


[hackers source]: https://github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
[hackers homepage]: http://camdavidsonpilon.github.io/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/
[dbda website]: https://sites.google.com/site/doingbayesiandataanalysis/home
[dbda 1st ed nb]: https://github.com/aloctavodia/Doing_bayesian_data_analysis
[dbda 2nd ed nb]: https://github.com/JWarmenhoven/DBDA-python
[rethinking website]: http://xcelab.net/rm/statistical-rethinking/
[rethinking port]: https://github.com/pymc-devs/resources/tree/master/Rethinking
[bap website]: https://www.packtpub.com/big-data-and-business-intelligence/bayesian-analysis-python-second-edition
[bap code]: https://github.com/aloctavodia/BAP
[bcm website]: https://bayesmodels.com/
[bcm code]: https://github.com/pymc-devs/resources/tree/master/BCM
[bda3 website]: https://www.stat.columbia.edu/~gelman/book/
[bda3 port]: https://github.com/pymc-devs/resources/tree/master/BDA3
Loading