Skip to content

Commit d19879f

Browse files
committed
Merge branch 'main' into multi-cell-geolift
2 parents 21dd051 + 2916688 commit d19879f

34 files changed

+7586
-730
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ["3.10", "3.11"]
14+
python-version: ["3.10", "3.11", "3.12"]
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
- name: Set up Python
19-
uses: actions/setup-python@v3
19+
uses: actions/setup-python@v5
2020
with:
2121
python-version: ${{ matrix.python-version }}
22+
- name: Update pip and setuptools
23+
run: pip install --upgrade pip setuptools
24+
- name: Setup environment
25+
run: pip install -e .[test]
2226
- name: Run doctests
23-
run: |
24-
pip install -e .[test]
25-
pytest --doctest-modules --ignore=causalpy/tests/ causalpy/
27+
run: pytest --doctest-modules --ignore=causalpy/tests/ causalpy/
2628
- name: Run tests
27-
run: |
28-
pip install -e .[test]
29-
pytest --cov-report=xml --no-cov-on-fail
29+
run: pytest --cov-report=xml --no-cov-on-fail
3030
- name: Upload coverage to Codecov
31-
uses: codecov/codecov-action@v3
31+
uses: codecov/codecov-action@v4
3232
with:
3333
token: ${{ secrets.CODECOV_TOKEN }} # use token for more robust uploads
3434
name: ${{ matrix.python-version }}

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
name: Build source distribution
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 0
18-
- uses: actions/setup-python@v4
18+
- uses: actions/setup-python@v5
1919
with:
2020
python-version: 3.11
2121
- name: Build the sdist and the wheel
@@ -60,7 +60,7 @@ jobs:
6060
user: __token__
6161
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
6262
repository_url: https://test.pypi.org/legacy/
63-
- uses: actions/setup-python@v4
63+
- uses: actions/setup-python@v5
6464
with:
6565
python-version: 3.11
6666
- name: Test pip install from test.pypi
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

.pre-commit-config.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,18 @@ repos:
2222
exclude_types: [svg]
2323
- id: check-yaml
2424
- id: check-added-large-files
25+
exclude: &exclude_pattern 'iv_weak_instruments.ipynb'
2526
args: ["--maxkb=1500"]
2627
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: v0.4.3
28+
rev: v0.4.9
2829
hooks:
30+
# Run the linter
2931
- id: ruff
30-
args: ["--fix", "--output-format=full"]
32+
types_or: [ python, pyi, jupyter ]
33+
args: [ --fix ]
34+
# Run the formatter
3135
- id: ruff-format
32-
- repo: https://github.com/nbQA-dev/nbQA
33-
rev: 1.8.5
34-
hooks:
35-
- id: nbqa-ruff
36+
types_or: [ python, pyi, jupyter ]
3637
- repo: https://github.com/econchick/interrogate
3738
rev: 1.7.0
3839
hooks:

.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"

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ lint:
1010
check_lint:
1111
ruff check .
1212
ruff format --diff --check .
13-
nbqa black --check .
14-
nbqa ruff .
1513
interrogate .
1614

1715
doctest:

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

causalpy/data/datasets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"geolift_multi_cell": {"filename": "geolift_multi_cell.csv"},
3737
"risk": {"filename": "AJR2001.csv"},
3838
"nhefs": {"filename": "nhefs.csv"},
39+
"schoolReturns": {"filename": "schoolingReturns.csv"},
3940
}
4041

4142

causalpy/data/schoolingReturns.csv

Lines changed: 3011 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)