Skip to content

Commit 0630589

Browse files
committed
get bibtex references working
1 parent 6817574 commit 0630589

16 files changed

+105
-101
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ repos:
3636
- repo: https://github.com/econchick/interrogate
3737
rev: 1.5.0
3838
hooks:
39-
- id: interrogate
40-
# needed to make excludes in pyproject.toml work
41-
# see here https://github.com/econchick/interrogate/issues/60#issuecomment-735436566
42-
pass_filenames: false
39+
- id: interrogate
40+
# needed to make excludes in pyproject.toml work
41+
# see here https://github.com/econchick/interrogate/issues/60#issuecomment-735436566
42+
pass_filenames: false

docs/source/_static/interrogate_badge.svg

Lines changed: 3 additions & 3 deletions
Loading

docs/source/conf.py

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

4848
extensions = [
49-
"myst_parser",
50-
"nbsphinx",
49+
"myst_nb",
50+
"sphinxcontrib.bibtex",
5151
"sphinx.ext.autodoc",
5252
"sphinx.ext.intersphinx",
5353
"sphinx.ext.mathjax",
5454
"sphinx_autodoc_typehints",
5555
]
5656

57-
source_suffix = [".rst", ".md"]
57+
nb_execution_mode = "off"
58+
59+
source_suffix = {
60+
".rst": "restructuredtext",
61+
".ipynb": "myst-nb",
62+
".myst": "myst-nb",
63+
}
5864
templates_path = ["_templates"]
5965
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
6066
master_doc = "index"
6167

68+
# bibtex config
69+
bibtex_bibfiles = ["references.bib"]
70+
bibtex_default_style = "unsrt"
71+
bibtex_reference_style = "author_year"
72+
6273
# -- intersphinx config -------------------------------------------------------
6374
intersphinx_mapping = {
6475
"python": ("https://docs.python.org/3", None),
6576
"pymc": ("https://www.pymc.io/projects/docs/en/stable/", None),
6677
}
6778

68-
# -- nbsphinx config ----------------------------------------------------------
69-
# Opt out of executing the notebooks remotely. This will save time in the remote build
70-
# process on readthedocs. The notebooks in /docs/notebooks will be parsed/converted,
71-
# but not re-executed.
72-
nbsphinx_execute = "never"
73-
7479
# MyST options for working with markdown files.
7580
# Info about extensions here https://myst-parser.readthedocs.io/en/latest/syntax/optional.html?highlight=math#admonition-directives # noqa: E501
7681
myst_enable_extensions = [

docs/source/glossary.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# Glossary
22

3-
<div class="admonition note" name="html-admonition">
4-
<p class="title">Note:</p>
5-
Some of the definitions have been copied from (or inspired by) various resources, including Reichardt (2019).
6-
</div>
7-
3+
:::{note}
4+
Some of the definitions have been copied from (or inspired by) various resources, including {cite:t}`reichardt2019quasi`.
5+
:::
86

97
**ANCOVA:** Analysis of covariance is a simple linear model, typically with one continuous predictor (the covariate) and a catgeorical variable (which may correspond to treatment or control group). In the context of this package, ANCOVA could be useful in pre-post treatment designs, either with or without random assignment. This is similar to the approach of difference in differences, but only applicable with a single pre and post treatment measure.
108

@@ -63,4 +61,6 @@ Data from pretest-posttest NEGD could be analysed using change score analysis or
6361
**Treatment effect:** The difference in outcomes between what happened after a treatment is implemented and what would have happened (see Counterfactual) if the treatment had not been implemented, assuming everything else had been the same.
6462

6563
## References
66-
* Reichardt, C. S. (2019). Quasi-experimentation: A guide to design and analysis. Guilford Publications.
64+
:::{bibliography}
65+
:filter: docname in docnames
66+
:::

docs/source/notebooks/ancova_pymc.ipynb

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,9 @@
77
"source": [
88
"# ANCOVA for pre/post treatment nonequivalent group designs\n",
99
"\n",
10-
"<div class=\"alert alert-warning\">\n",
11-
"\n",
12-
"Warning\n",
13-
"\n",
10+
":::{note}\n",
1411
"This is a preliminary example based on synthetic data. It will hopefully soon be updated with data from a real study.\n",
15-
"\n",
16-
"</div>\n",
12+
":::\n",
1713
"\n",
1814
"In cases where there is just one pre and one post treatment measurement, it we can analyse data from NEGD experiments using an ANCOVA type approach. The basic model is:\n",
1915
"\n",
@@ -56,6 +52,7 @@
5652
]
5753
},
5854
{
55+
"attachments": {},
5956
"cell_type": "markdown",
6057
"metadata": {},
6158
"source": [
@@ -219,13 +216,9 @@
219216
"source": [
220217
"## Run the analysis\n",
221218
"\n",
222-
"<div class=\"alert alert-info\">\n",
223-
"\n",
224-
"Note:\n",
225-
"\n",
219+
":::{note}\n",
226220
"The `random_seed` keyword argument for the PyMC sampler is not neccessary. We use it here so that the results are reproducible.\n",
227-
"\n",
228-
"</div>"
221+
":::"
229222
]
230223
},
231224
{

docs/source/notebooks/did_pymc.ipynb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,9 @@
77
"source": [
88
"# Difference in Differences with `pymc` models\n",
99
"\n",
10-
"<div class=\"alert alert-warning\">\n",
11-
"\n",
12-
"Warning\n",
13-
"\n",
10+
":::{note}\n",
1411
"This example is in-progress! Further elaboration and explanation will follow soon.\n",
15-
"\n",
16-
"</div>"
12+
":::"
1713
]
1814
},
1915
{
@@ -40,6 +36,7 @@
4036
]
4137
},
4238
{
39+
"attachments": {},
4340
"cell_type": "markdown",
4441
"metadata": {},
4542
"source": [

docs/source/notebooks/did_pymc_banks.ipynb

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,9 @@
77
"source": [
88
"# Banking dataset with a `pymc` model\n",
99
"\n",
10-
"<div class=\"alert alert-warning\">\n",
11-
"\n",
12-
"Warning\n",
13-
"\n",
10+
":::{note}\n",
1411
"This example is in-progress! Further elaboration and explanation will follow soon.\n",
15-
"\n",
16-
"</div>\n",
12+
":::\n",
1713
"\n",
1814
"This notebook analyses historic data on banking closures from [Richardson & Troost (2009)](http://masteringmetrics.com/wp-content/uploads/2015/02/Richardson_Troost_2009_JPE.pdf) and used as a case study for a difference in differences analysis in the [Mastering Metrics](http://www.masteringmetrics.com) book. Here, we replicate this analysis, but using Bayesian inference."
1915
]
@@ -395,13 +391,9 @@
395391
"cell_type": "markdown",
396392
"metadata": {},
397393
"source": [
398-
"<div class=\"alert alert-info\">\n",
399-
"\n",
400-
"Note:\n",
401-
"\n",
394+
":::{note}\n",
402395
"The `random_seed` keyword argument for the PyMC sampler is not neccessary. We use it here so that the results are reproducible.\n",
403-
"\n",
404-
"</div>"
396+
":::"
405397
]
406398
},
407399
{

docs/source/notebooks/geolift1.ipynb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,9 @@
268268
"\n",
269269
"We can use `CausalPy`'s API to run this procedure, but using Bayesian inference methods as follows:\n",
270270
"\n",
271-
"<div class=\"alert alert-info\">\n",
272-
"\n",
273-
"Note:\n",
274-
"\n",
271+
":::{note}\n",
275272
"The `random_seed` keyword argument for the PyMC sampler is not neccessary. We use it here so that the results are reproducible.\n",
276-
"\n",
277-
"</div>"
273+
":::"
278274
]
279275
},
280276
{

docs/source/notebooks/its_covid.ipynb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,9 @@
181181
"\n",
182182
"In this example we are going to standardize the data. So we have to be careful in how we interpret the inferred regression coefficients, and the posterior predictions will be in this standardized space.\n",
183183
"\n",
184-
"<div class=\"alert alert-info\">\n",
185-
"\n",
186-
"Note:\n",
187-
"\n",
184+
":::{note}\n",
188185
"The `random_seed` keyword argument for the PyMC sampler is not neccessary. We use it here so that the results are reproducible.\n",
189-
"\n",
190-
"</div>"
186+
":::"
191187
]
192188
},
193189
{

docs/source/notebooks/its_pymc.ipynb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,9 @@
162162
"source": [
163163
"Run the analysis\n",
164164
"\n",
165-
"<div class=\"alert alert-info\">\n",
166-
"\n",
167-
"Note:\n",
168-
"\n",
165+
":::{note}\n",
169166
"The `random_seed` keyword argument for the PyMC sampler is not neccessary. We use it here so that the results are reproducible.\n",
170-
"\n",
171-
"</div>"
167+
":::"
172168
]
173169
},
174170
{

0 commit comments

Comments
 (0)