Skip to content

Commit 678c915

Browse files
authored
Merge pull request #207 from pymc-labs/update-docstring
Update docstring to explain `sample_kwargs` + add intersphinx
2 parents 02d2506 + b58c4c2 commit 678c915

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

causalpy/pymc_models.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@
99

1010
class ModelBuilder(pm.Model):
1111
"""
12-
This is a wrapper around pm.Model to give scikit-learn like API
12+
This is a wrapper around pm.Model to give scikit-learn like API.
1313
"""
1414

1515
def __init__(self, sample_kwargs: Optional[Dict[str, Any]] = None):
16+
"""
17+
:param sample_kwargs: A dictionary of kwargs that get unpacked and passed to the
18+
:func:`pymc.sample` function. Defaults to an empty dictionary.
19+
"""
1620
super().__init__()
1721
self.idata = None
1822
self.sample_kwargs = sample_kwargs if sample_kwargs is not None else {}

docs/source/conf.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,25 @@
4646
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
4747

4848
extensions = [
49-
"sphinx.ext.mathjax",
49+
"myst_parser",
50+
"nbsphinx",
5051
"sphinx.ext.autodoc",
52+
"sphinx.ext.intersphinx",
53+
"sphinx.ext.mathjax",
5154
"sphinx_autodoc_typehints",
52-
"nbsphinx",
53-
"myst_parser",
5455
]
5556

5657
source_suffix = [".rst", ".md"]
5758
templates_path = ["_templates"]
5859
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
5960
master_doc = "index"
6061

62+
# -- intersphinx config -------------------------------------------------------
63+
intersphinx_mapping = {
64+
"python": ("https://docs.python.org/3", None),
65+
"pymc": ("https://www.pymc.io/projects/docs/en/stable/", None),
66+
}
67+
6168
# -- nbsphinx config ----------------------------------------------------------
6269
# Opt out of executing the notebooks remotely. This will save time in the remote build
6370
# process on readthedocs. The notebooks in /docs/notebooks will be parsed/converted,

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ docs = ["ipykernel",
6161
"pathlib",
6262
"sphinx",
6363
"sphinx-autodoc-typehints",
64+
"sphinx_autodoc_defaultargs",
6465
"sphinx-design",
6566
"sphinx-rtd-theme",
6667
"statsmodels",

0 commit comments

Comments
 (0)