Skip to content

Various improvements to documentation infrastructure #354

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

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 16 additions & 0 deletions .github/workflows/rtd-link-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Read the Docs Pull Request Preview
on:
pull_request_target:
types:
- opened

permissions:
pull-requests: write

jobs:
documentation-links:
runs-on: ubuntu-latest
steps:
- uses: readthedocs/actions/preview@v1
with:
project-slug: "causalpy"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ _build
build/
dist/
docs/_build/
docs/build/
docs/jupyter_execute/
*.vscode
.coverage
*.jupyterlab-workspace
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-20.04
os: ubuntu-lts-latest
tools:
python: "3.10"
python: "3.11"
# You can also specify other tool versions:
# nodejs: "16"
# rust: "1.55"
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pip install git+https://github.com/pymc-labs/CausalPy.git

```python
import causalpy as cp

import matplotlib.pyplot as plt

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

# Get a results summary
result.summary()

plt.show()
```

## Roadmap
Expand Down
16 changes: 15 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,18 @@
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"sphinx_autodoc_typehints",
"sphinx_copybutton",
]

nb_execution_mode = "off"

# configure copy button to avoid copying sphinx or console characters
copybutton_exclude = ".linenos, .gp"
copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
copybutton_prompt_is_regexp = True

source_suffix = {
".rst": "restructuredtext",
".ipynb": "myst-nb",
Expand All @@ -72,8 +79,15 @@

# -- intersphinx config -------------------------------------------------------
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"examples": ("https://www.pymc.io/projects/examples/en/latest/", None),
"mpl": ("https://matplotlib.org/stable", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
"pymc": ("https://www.pymc.io/projects/docs/en/stable/", None),
"python": ("https://docs.python.org/3", None),
"scikit-learn": ("https://scikit-learn.org/stable/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
"xarray": ("https://docs.xarray.dev/en/stable/", None),
}

# MyST options for working with markdown files.
Expand Down
11 changes: 10 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ A Python package focussing on causal inference for quasi-experiments. The packag
Installation
------------

To get the latest release:
To get the latest release you can use pip:

.. code-block:: sh

pip install CausalPy

or conda:

.. code-block:: sh

conda install causalpy -c conda-forge

Alternatively, if you want the very latest version of the package you can install from GitHub:

.. code-block:: sh
Expand All @@ -31,6 +37,7 @@ Quickstart
.. code-block:: python

import causalpy as cp
import matplotlib.pyplot as plt


# Import and process data
Expand All @@ -55,6 +62,8 @@ Quickstart
# Get a results summary
result.summary()

plt.show()


Videos
------
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ docs = [
"ipykernel",
"daft",
"linkify-it-py",
"myst-nb<=1.0.0",
"myst-nb!=1.1.0",
"pathlib",
"sphinx",
"sphinx-autodoc-typehints",
"sphinx_autodoc_defaultargs",
"sphinx-design",
"sphinx-copybutton",
"sphinx-rtd-theme",
"statsmodels",
"sphinxcontrib-bibtex",
Expand Down
Loading