From 31f76542a86265c03a11528661875dcb68cbd998 Mon Sep 17 00:00:00 2001 From: Dan Foreman-Mackey Date: Tue, 21 Nov 2023 08:07:42 -0500 Subject: [PATCH] Use pydata theme for docs (#163) * Update requirements.txt * Update conf.py * moving things around --- docs/Makefile | 2 +- docs/conf.py | 29 ++++++++++++----------------- docs/index.rst | 25 ++++--------------------- docs/requirements.txt | 1 + docs/tutorials/bayesopt.rst | 3 --- docs/tutorials/first.rst | 3 --- docs/tutorials/hyper.rst | 3 --- docs/tutorials/index.rst | 14 ++++++++++++++ docs/tutorials/mixture.rst | 3 --- docs/tutorials/model.rst | 3 --- docs/tutorials/new-kernel.rst | 3 --- docs/tutorials/scaling.rst | 3 --- docs/tutorials/tutorial_rst.tpl | 2 -- docs/user/index.rst | 12 ++++++++++++ docs/user/kernels.rst.template | 2 +- docs/user/upgrade.rst | 6 ------ 16 files changed, 45 insertions(+), 69 deletions(-) create mode 100644 docs/tutorials/index.rst create mode 100644 docs/user/index.rst delete mode 100644 docs/user/upgrade.rst diff --git a/docs/Makefile b/docs/Makefile index ba8f8920..c61fd499 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -19,7 +19,7 @@ TUTORIALS = tutorials/hyper.rst tutorials/model.rst tutorials/new-kernel.rst \ tutorials/first.rst tutorials/scaling.rst tutorials/mixture.rst \ tutorials/bayesopt.rst -tutorials/%.rst: _static/notebooks/%.ipynb tutorials/tutorial_rst.tpl +tutorials/%.rst: _static/notebooks/%.ipynb jupyter nbconvert --template tutorials/tutorial_rst --to rst $< --output-dir tutorials .PHONY: clean diff --git a/docs/conf.py b/docs/conf.py index 31b22d72..24da9e8b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -44,8 +44,8 @@ master_doc = "index" # General information about the project. -project = u"George" -copyright = u"2012-2021 Dan Foreman-Mackey" +project = "george" +copyright = "2012-2023 Dan Foreman-Mackey" version = george.__version__ release = george.__version__ @@ -54,22 +54,17 @@ pygments_style = "sphinx" # Readthedocs. -on_rtd = os.environ.get("READTHEDOCS", None) == "True" -if not on_rtd: - import sphinx_rtd_theme - - html_theme = "sphinx_rtd_theme" - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] - +html_theme = "pydata_sphinx_theme" +html_title = "george" htmp_theme_options = dict( analytics_id="analytics_id", ) -html_context = dict( - display_github=True, - github_user="dfm", - github_repo="george", - github_version="main", - conf_py_path="/docs/", -) +# html_context = dict( +# display_github=True, +# github_user="dfm", +# github_repo="george", +# github_version="main", +# conf_py_path="/docs/", +# ) html_static_path = ["_static"] -html_show_sourcelink = False +# html_show_sourcelink = False diff --git a/docs/index.rst b/docs/index.rst index f386f41e..3e1c1bea 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -30,26 +30,9 @@ George is being actively developed in `a public repository on GitHub .. toctree:: :maxdepth: 2 - :caption: User Guide - user/quickstart - user/kernels - user/gp - user/solvers - user/modeling - - -.. toctree:: - :maxdepth: 1 - :caption: Tutorials - - tutorials/first - tutorials/model - tutorials/hyper - tutorials/scaling - tutorials/new-kernel - tutorials/mixture - tutorials/bayesopt + user/index + tutorials/index Contributors @@ -61,9 +44,9 @@ Contributors License & Attribution --------------------- -Copyright 2012-2022 Daniel Foreman-Mackey and contributors. +Copyright 2012-2023 Daniel Foreman-Mackey and contributors. -George is being developed by `Dan Foreman-Mackey `_ in a +George is being developed by `Dan Foreman-Mackey `_ in a `public GitHub repository `_. The source code is made available under the terms of the MIT license. diff --git a/docs/requirements.txt b/docs/requirements.txt index c3726e8b..704d01bc 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1 +1,2 @@ pyyaml +pydata-sphinx-theme diff --git a/docs/tutorials/bayesopt.rst b/docs/tutorials/bayesopt.rst index 63a4988c..f19b19a4 100644 --- a/docs/tutorials/bayesopt.rst +++ b/docs/tutorials/bayesopt.rst @@ -1,6 +1,3 @@ - -.. module:: george - .. note:: This tutorial was generated from an IPython notebook that can be downloaded `here <../../_static/notebooks/bayesopt.ipynb>`_. diff --git a/docs/tutorials/first.rst b/docs/tutorials/first.rst index b9fe0a9b..38a88c31 100644 --- a/docs/tutorials/first.rst +++ b/docs/tutorials/first.rst @@ -1,6 +1,3 @@ - -.. module:: george - .. note:: This tutorial was generated from an IPython notebook that can be downloaded `here <../../_static/notebooks/first.ipynb>`_. diff --git a/docs/tutorials/hyper.rst b/docs/tutorials/hyper.rst index ddf8b8fa..c8921233 100644 --- a/docs/tutorials/hyper.rst +++ b/docs/tutorials/hyper.rst @@ -1,6 +1,3 @@ - -.. module:: george - .. note:: This tutorial was generated from an IPython notebook that can be downloaded `here <../../_static/notebooks/hyper.ipynb>`_. diff --git a/docs/tutorials/index.rst b/docs/tutorials/index.rst new file mode 100644 index 00000000..8abd2f31 --- /dev/null +++ b/docs/tutorials/index.rst @@ -0,0 +1,14 @@ +Tutorials +========= + +.. toctree:: + :maxdepth: 2 + + first + model + hyper + scaling + new-kernel + mixture + bayesopt + diff --git a/docs/tutorials/mixture.rst b/docs/tutorials/mixture.rst index e66f4cdd..04106039 100644 --- a/docs/tutorials/mixture.rst +++ b/docs/tutorials/mixture.rst @@ -1,6 +1,3 @@ - -.. module:: george - .. note:: This tutorial was generated from an IPython notebook that can be downloaded `here <../../_static/notebooks/mixture.ipynb>`_. diff --git a/docs/tutorials/model.rst b/docs/tutorials/model.rst index c593d984..4b48b752 100644 --- a/docs/tutorials/model.rst +++ b/docs/tutorials/model.rst @@ -1,6 +1,3 @@ - -.. module:: george - .. note:: This tutorial was generated from an IPython notebook that can be downloaded `here <../../_static/notebooks/model.ipynb>`_. diff --git a/docs/tutorials/new-kernel.rst b/docs/tutorials/new-kernel.rst index 8178d679..946dc096 100644 --- a/docs/tutorials/new-kernel.rst +++ b/docs/tutorials/new-kernel.rst @@ -1,6 +1,3 @@ - -.. module:: george - .. note:: This tutorial was generated from an IPython notebook that can be downloaded `here <../../_static/notebooks/new-kernel.ipynb>`_. diff --git a/docs/tutorials/scaling.rst b/docs/tutorials/scaling.rst index d05a35c9..fcfcfa7d 100644 --- a/docs/tutorials/scaling.rst +++ b/docs/tutorials/scaling.rst @@ -1,6 +1,3 @@ - -.. module:: george - .. note:: This tutorial was generated from an IPython notebook that can be downloaded `here <../../_static/notebooks/scaling.ipynb>`_. diff --git a/docs/tutorials/tutorial_rst.tpl b/docs/tutorials/tutorial_rst.tpl index 0177e7b4..392534d7 100644 --- a/docs/tutorials/tutorial_rst.tpl +++ b/docs/tutorials/tutorial_rst.tpl @@ -1,8 +1,6 @@ {%- extends 'display_priority.tpl' -%} {% block header %} -.. module:: george - .. note:: This tutorial was generated from an IPython notebook that can be downloaded `here <../../_static/notebooks/{{ resources.metadata.name }}.ipynb>`_. diff --git a/docs/user/index.rst b/docs/user/index.rst new file mode 100644 index 00000000..b17185e1 --- /dev/null +++ b/docs/user/index.rst @@ -0,0 +1,12 @@ +User Guide +========== + +.. toctree:: + :maxdepth: 2 + + quickstart + kernels + gp + solvers + modeling + diff --git a/docs/user/kernels.rst.template b/docs/user/kernels.rst.template index 2e1173c2..2c3cdc8f 100644 --- a/docs/user/kernels.rst.template +++ b/docs/user/kernels.rst.template @@ -68,7 +68,7 @@ This makes the code fast and consistent across interfaces but it also means that it isn't currently possible to implement new kernel functions without recompiling the code. Almost every kernel has hyperparameters that you can set to control its -behavior and these are controlled using the :ref:`modeling`. +behavior and these are controlled using the :ref:`modeling-protocol`. .. code-block:: python diff --git a/docs/user/upgrade.rst b/docs/user/upgrade.rst deleted file mode 100644 index f48448a3..00000000 --- a/docs/user/upgrade.rst +++ /dev/null @@ -1,6 +0,0 @@ -.. _upgrade: - -Upgrading from pre-1.0 versions -=============================== - -Blah.