diff --git a/.gitignore b/.gitignore index 6be4482a6..13e14fe44 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ tmtags tags .DS_Store .cache +_version.py # IntelliJ IDE .idea *.iml diff --git a/.readthedocs.yaml b/.readthedocs.yaml index fd04542aa..304c31290 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -17,3 +17,14 @@ python: sphinx: fail_on_warning: false configuration: docs/conf.py + +search: + ranking: + _sources/*: -10 + _modules/*: -5 + genindex.html: -9 + + ignore: + - 404.html + - search.html + - index.html diff --git a/docs/conf.py b/docs/conf.py index dc6c07f9b..ec966c103 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,12 +26,7 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # -import os -import sys - -import pymc_extras # isort:skip - -sys.path.insert(0, os.path.abspath("../")) +import pymc_extras # -- Project information ----------------------------------------------------- @@ -39,10 +34,10 @@ copyright = "2022, pymc-devs" author = "pymc-devs" -# The short X.Y version -version = pymc_extras.__version__ # The full version, including alpha/beta/rc tags -release = version +release = pymc_extras.__version__ +# The short X.Y version +version = release.split("+")[0] if "+" in release else release # -- General configuration --------------------------------------------------- @@ -112,9 +107,16 @@ "collapse_navigation": True, "show_toc_level": 2, "navigation_depth": 4, - "search_bar_text": "Search the docs...", - "use_search_override": False, + "search_bar_text": "Search within PyMC-extras...", + "use_search_override": True, "logo": {"text": project}, + "icon_links": [ + { + "url": "https://github.com/pymc-devs/pymc-extras", + "icon": "fa-brands fa-github", + "name": "GitHub", + }, + ], } html_context = { "github_user": "pymc-devs", @@ -128,7 +130,7 @@ # 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, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["../_static"] +# html_static_path = ["../_static"] # -- Options for HTMLHelp output --------------------------------------------- diff --git a/docs/index.rst b/docs/index.rst index 580a4b389..a7c6882d6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -21,7 +21,7 @@ Where we grow the next batch of cool PyMC features Installation ============ -To install the latest release on [PyPI](https://pypi.org/project/pymc-extras/), you can use a package manager like pip: +To install the latest release on `PyPI `_, you can use a package manager like pip: .. code-block:: bash diff --git a/pymc_extras/distributions/continuous.py b/pymc_extras/distributions/continuous.py index 41941796f..0264a9e62 100644 --- a/pymc_extras/distributions/continuous.py +++ b/pymc_extras/distributions/continuous.py @@ -81,7 +81,7 @@ class GenExtreme(Continuous): \left\{x: 1 + \xi\left(\frac{x-\mu}{\sigma}\right) > 0 \right\}. - Note that this parametrization is per Coles (2001), and differs from that of + Note that this parametrization is per Coles (2001) [1]_, and differs from that of Scipy in the sign of the shape parameter, :math:`\xi`. .. plot:: @@ -132,7 +132,7 @@ class GenExtreme(Continuous): References ---------- - .. [Coles2001] Coles, S.G. (2001). + .. [1] Coles, S.G. (2001). An Introduction to the Statistical Modeling of Extreme Values Springer-Verlag, London @@ -260,6 +260,7 @@ class Chi: Examples -------- .. code-block:: python + import pymc as pm from pymc_extras.distributions import Chi diff --git a/pymc_extras/distributions/discrete.py b/pymc_extras/distributions/discrete.py index 0bfe8e7c4..fc810c415 100644 --- a/pymc_extras/distributions/discrete.py +++ b/pymc_extras/distributions/discrete.py @@ -116,6 +116,7 @@ class GeneralizedPoisson(pm.distributions.Discrete): .. math:: f(x \mid \mu, \lambda) = \frac{\mu (\mu + \lambda x)^{x-1} e^{-\mu - \lambda x}}{x!} + ======== ====================================== Support :math:`x \in \mathbb{N}_0` Mean :math:`\frac{\mu}{1 - \lambda}` @@ -135,9 +136,10 @@ class GeneralizedPoisson(pm.distributions.Discrete): When lam < 0, the mean is greater than the variance (underdispersion). When lam > 0, the mean is less than the variance (overdispersion). + The PMF is taken from [1]_ and the random generator function is adapted from [2]_. + References ---------- - The PMF is taken from [1] and the random generator function is adapted from [2]. .. [1] Consul, PoC, and Felix Famoye. "Generalized Poisson regression model." Communications in Statistics-Theory and Methods 21.1 (1992): 89-109. .. [2] Famoye, Felix. "Generalized Poisson random variate generation." American diff --git a/pyproject.toml b/pyproject.toml index bf9a34a4c..37c4bc631 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,9 +53,8 @@ dev = [ ] docs = [ "nbsphinx>=0.4.2", - "pydata-sphinx-theme>=0.6.3", "sphinx>=4.0", - "pymc-sphinx-theme@git+https://github.com/pymc-devs/pymc-sphinx-theme", + "pymc-sphinx-theme>=0.16", ] dask_histogram = [ "dask[complete]<2025.1.1",