Skip to content

Commit 4af4af6

Browse files
authored
Merge pull request #354 from OriolAbril/docs
Documentation infrastructure
2 parents ca8c4f2 + 7a23593 commit 4af4af6

File tree

7 files changed

+50
-7
lines changed

7 files changed

+50
-7
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Read the Docs Pull Request Preview
2+
on:
3+
pull_request_target:
4+
types:
5+
- opened
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
documentation-links:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: readthedocs/actions/preview@v1
15+
with:
16+
project-slug: "causalpy"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ _build
77
build/
88
dist/
99
docs/_build/
10+
docs/build/
11+
docs/jupyter_execute/
1012
*.vscode
1113
.coverage
1214
*.jupyterlab-workspace

.readthedocs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ version: 2
77

88
# Set the version of Python and other tools you might need
99
build:
10-
os: ubuntu-20.04
10+
os: ubuntu-lts-latest
1111
tools:
12-
python: "3.10"
12+
python: "3.11"
1313
# You can also specify other tool versions:
1414
# nodejs: "16"
1515
# rust: "1.55"

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pip install git+https://github.com/pymc-labs/CausalPy.git
3434

3535
```python
3636
import causalpy as cp
37-
37+
import matplotlib.pyplot as plt
3838

3939
# Import and process data
4040
df = (
@@ -57,6 +57,8 @@ fig, ax = result.plot();
5757

5858
# Get a results summary
5959
result.summary()
60+
61+
plt.show()
6062
```
6163

6264
## Roadmap

docs/source/conf.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,18 @@
5151
"sphinx.ext.autodoc",
5252
"sphinx.ext.intersphinx",
5353
"sphinx.ext.mathjax",
54+
"sphinx.ext.viewcode",
5455
"sphinx_autodoc_typehints",
56+
"sphinx_copybutton",
5557
]
5658

5759
nb_execution_mode = "off"
5860

61+
# configure copy button to avoid copying sphinx or console characters
62+
copybutton_exclude = ".linenos, .gp"
63+
copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
64+
copybutton_prompt_is_regexp = True
65+
5966
source_suffix = {
6067
".rst": "restructuredtext",
6168
".ipynb": "myst-nb",
@@ -72,8 +79,15 @@
7279

7380
# -- intersphinx config -------------------------------------------------------
7481
intersphinx_mapping = {
75-
"python": ("https://docs.python.org/3", None),
82+
"examples": ("https://www.pymc.io/projects/examples/en/latest/", None),
83+
"mpl": ("https://matplotlib.org/stable", None),
84+
"numpy": ("https://numpy.org/doc/stable/", None),
85+
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
7686
"pymc": ("https://www.pymc.io/projects/docs/en/stable/", None),
87+
"python": ("https://docs.python.org/3", None),
88+
"scikit-learn": ("https://scikit-learn.org/stable/", None),
89+
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
90+
"xarray": ("https://docs.xarray.dev/en/stable/", None),
7791
}
7892

7993
# MyST options for working with markdown files.

docs/source/index.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,18 @@ A Python package focussing on causal inference for quasi-experiments. The packag
1212
Installation
1313
------------
1414

15-
To get the latest release:
15+
To get the latest release you can use pip:
1616

1717
.. code-block:: sh
1818
1919
pip install CausalPy
2020
21+
or conda:
22+
23+
.. code-block:: sh
24+
25+
conda install causalpy -c conda-forge
26+
2127
Alternatively, if you want the very latest version of the package you can install from GitHub:
2228

2329
.. code-block:: sh
@@ -31,6 +37,7 @@ Quickstart
3137
.. code-block:: python
3238
3339
import causalpy as cp
40+
import matplotlib.pyplot as plt
3441
3542
3643
# Import and process data
@@ -55,6 +62,8 @@ Quickstart
5562
# Get a results summary
5663
result.summary()
5764
65+
plt.show()
66+
5867
5968
Videos
6069
------

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ docs = [
5454
"ipykernel",
5555
"daft",
5656
"linkify-it-py",
57-
"myst-nb<=1.0.0",
57+
"myst-nb!=1.1.0",
5858
"pathlib",
5959
"sphinx",
6060
"sphinx-autodoc-typehints",
6161
"sphinx_autodoc_defaultargs",
62-
"sphinx-design",
62+
"sphinx-copybutton",
6363
"sphinx-rtd-theme",
6464
"statsmodels",
6565
"sphinxcontrib-bibtex",

0 commit comments

Comments
 (0)