Skip to content

Model Builder refactoring #119

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

Closed
Closed
Show file tree
Hide file tree
Changes from 4 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
5 changes: 5 additions & 0 deletions docs/_templates/autosummary/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ objname | escape | underline }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we made it worse :P, this hsouldn't show up here. Maybe start with a fresh PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I'll try to just copy the changes to new branch, branched from fresh main and see if it helps


.. currentmodule:: {{ module }}

.. auto{{ objtype }}:: {{ objname }}
29 changes: 29 additions & 0 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{ objname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}

{% block methods %}
.. automethod:: __init__

{% if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
{% for item in methods %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
51 changes: 39 additions & 12 deletions docs/api_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,50 @@ API Reference
This reference provides detailed documentation for all modules, classes, and
methods in the current release of PyMC experimental.

.. currentmodule:: pymc_experimental
.. autosummary::
:toctree: generated/

.. toctree::
:maxdepth: 2
marginal_model.MarginalModel
model_builder.ModelBuilder

Inference
=========

:mod:`pymc_experimental.distributions`
=============================
.. currentmodule:: pymc_experimental.inference
.. autosummary::
:toctree: generated/

.. automodule:: pymc_experimental.distributions.histogram_utils
:members: histogram_approximation
fit


:mod:`pymc_experimental.utils`
=============================
Distributions
=============

.. automodule:: pymc_experimental.utils.spline
:members: bspline_interpolation
.. currentmodule:: pymc_experimental.distributions
.. autosummary::
:toctree: generated/

.. automodule:: pymc_experimental.utils.prior
:members: prior_from_idata
GenExtreme
histogram_utils.histogram_approximation


Gaussian Processess
===================

.. currentmodule:: pymc_experimental.gp
.. autosummary::
:toctree: generated/

latent_approx.HSGP


Utils
=====

.. currentmodule:: pymc_experimental.utils
.. autosummary::
:toctree: generated/

spline.bspline_interpolation
prior.prior_from_idata
25 changes: 15 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,18 @@
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx.ext.mathjax",
"nbsphinx",
"matplotlib.sphinxext.plot_directive",
]

nbsphinx_execute = "never"

# Add any paths that contain templates here, relative to this directory.
# templates_path = ["_templates"]
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
Expand All @@ -81,7 +83,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -97,7 +99,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "pydata_sphinx_theme"
html_theme = "pymc_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
Expand All @@ -110,14 +112,17 @@
"show_toc_level": 2,
"navigation_depth": 4,
"search_bar_text": "Search the docs...",
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/pymc-devs/pymc-experimental",
"icon": "fab fa-github-square",
},
],
"use_search_override": False,
"logo": {"text": project},
}
html_context = {
"github_user": "pymc-devs",
"github_repo": "pymc-experimental",
"github_version": "main",
"doc_path": "docs",
"default_mode": "light",
}


# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
11 changes: 1 addition & 10 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,7 @@ Contributors
============
See the `GitHub contributor page <https://github.com/pymc-devs/pymc-experimental/graphs/contributors>`_.

Contents
========

.. toctree::
:maxdepth: 4
:hidden:

api_reference

Indices
=======

* :ref:`genindex`
* :ref:`modindex`
10 changes: 5 additions & 5 deletions pymc_experimental/distributions/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def rng_fn(

class GenExtreme(Continuous):
r"""
Univariate Generalized Extreme Value log-likelihood
Univariate Generalized Extreme Value log-likelihood

The cdf of this distribution is

Expand Down Expand Up @@ -119,13 +119,13 @@ class GenExtreme(Continuous):

Parameters
----------
mu: float
mu : float
Location parameter.
sigma: float
sigma : float
Scale parameter (sigma > 0).
xi: float
xi : float
Shape parameter
scipy: bool
scipy : bool
Whether or not to use the Scipy interpretation of the shape parameter
(defaults to `False`).

Expand Down
1 change: 1 addition & 0 deletions pymc_experimental/marginal_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class MarginalModel(Model):
Marginalize over a single variable

.. code-block:: python

import pymc as pm
from pymc_experimental import MarginalModel

Expand Down
1 change: 1 addition & 0 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
nbsphinx>=0.4.2
pydata-sphinx-theme>=0.6.3
sphinx>=4
git+https://github.com/pymc-devs/pymc-sphinx-theme