Skip to content

Commit 4c65c01

Browse files
committed
Merge branch 'main' into some-devops
2 parents abab314 + 15b5756 commit 4c65c01

31 files changed

+943
-46
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,16 @@ on:
77
branches: [main]
88

99
jobs:
10-
lint:
11-
runs-on: ubuntu-latest
12-
strategy:
13-
matrix:
14-
python-version: ["3.8", "3.9", "3.10"]
15-
16-
steps:
17-
- uses: actions/checkout@v4
18-
- name: Set up Python
19-
uses: actions/setup-python@v5
20-
with:
21-
python-version: ${{ matrix.python-version }}
22-
- name: Run lint
23-
uses: pre-commit/action@v3.0.0
24-
2510
test:
2611
runs-on: ubuntu-latest
2712
strategy:
2813
matrix:
29-
python-version: ["3.8", "3.9", "3.10"]
14+
python-version: ["3.10", "3.11"]
3015

3116
steps:
32-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v3
3318
- name: Set up Python
34-
uses: actions/setup-python@v5
19+
uses: actions/setup-python@v3
3520
with:
3621
python-version: ${{ matrix.python-version }}
3722
- name: Run doctests

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
name: Build source distribution
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v3
1616
with:
1717
fetch-depth: 0
18-
- uses: actions/setup-python@v5
18+
- uses: actions/setup-python@v4
1919
with:
20-
python-version: 3.8
20+
python-version: 3.11
2121
- name: Build the sdist and the wheel
2222
run: |
2323
pip install build
@@ -27,7 +27,7 @@ jobs:
2727
mkdir -p test-sdist
2828
cd test-sdist
2929
python -m venv venv-sdist
30-
venv-sdist/bin/python -m pip install ../dist/CausalPy*.tar.gz
30+
venv-sdist/bin/python -m pip install ../dist/causalpy*.tar.gz
3131
echo "Checking import and version number (on release)"
3232
venv-sdist/bin/python -c "import causalpy; assert causalpy.__version__ == '${{ github.ref_name }}' if '${{ github.ref_type }}' == 'tag' else causalpy.__version__; print(causalpy.__version__)"
3333
cd ..
@@ -40,7 +40,7 @@ jobs:
4040
echo "Checking import and version number (on release)"
4141
venv-bdist/bin/python -c "import causalpy; assert causalpy.__version__ == '${{ github.ref_name }}' if '${{ github.ref_type }}' == 'tag' else causalpy.__version__; print(causalpy.__version__)"
4242
cd ..
43-
- uses: actions/upload-artifact@v4
43+
- uses: actions/upload-artifact@v3
4444
with:
4545
name: artifact
4646
path: dist/*
@@ -60,9 +60,9 @@ jobs:
6060
user: __token__
6161
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
6262
repository_url: https://test.pypi.org/legacy/
63-
- uses: actions/setup-python@v5
63+
- uses: actions/setup-python@v4
6464
with:
65-
python-version: 3.8
65+
python-version: 3.11
6666
- name: Test pip install from test.pypi
6767
run: |
6868
# Give time to test.pypi to update its index. If we don't wait,

.pre-commit-config.yaml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,36 @@
1+
ci:
2+
autofix_prs: false
3+
14
# See https://pre-commit.com for more information
25
# See https://pre-commit.com/hooks.html for more hooks
36
repos:
7+
- repo: https://github.com/lucianopaz/head_of_apache
8+
rev: "0.0.3"
9+
hooks:
10+
- id: head_of_apache
11+
args:
12+
- --author=The PyMC Labs Developers
13+
- --exclude=docs/
14+
- --exclude=scripts/
415
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.4.0
16+
rev: v4.6.0
617
hooks:
18+
- id: debug-statements
719
- id: trailing-whitespace
820
exclude_types: [svg]
921
- id: end-of-file-fixer
1022
exclude_types: [svg]
1123
- id: check-yaml
1224
- id: check-added-large-files
13-
args: ['--maxkb=1500']
14-
- repo: https://github.com/charliermarsh/ruff-pre-commit
15-
rev: v0.1.4
25+
args: ["--maxkb=1500"]
26+
- repo: https://github.com/astral-sh/ruff-pre-commit
27+
rev: v0.4.3
1628
hooks:
1729
- id: ruff
30+
args: ["--fix", "--output-format=full"]
1831
- id: ruff-format
1932
- repo: https://github.com/nbQA-dev/nbQA
20-
rev: 1.7.0
33+
rev: 1.8.5
2134
hooks:
2235
- id: nbqa-ruff
2336
- repo: https://github.com/econchick/interrogate

causalpy/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# Copyright 2024 The PyMC Labs Developers
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
114
import arviz as az
215

316
from causalpy import pymc_experiments, pymc_models, skl_experiments, skl_models

causalpy/custom_exceptions.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# Copyright 2024 The PyMC Labs Developers
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
114
"""
215
Custom Exceptions for CausalPy.
316
"""

causalpy/data/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1+
# Copyright 2024 The PyMC Labs Developers
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
114
"""Code for loading datasets."""
15+
216
from .datasets import load_data
317

418
__all__ = ["load_data"]

causalpy/data/datasets.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1+
# Copyright 2024 The PyMC Labs Developers
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
114
"""
215
Functions to load example datasets
316
"""
17+
418
import pathlib
519

620
import pandas as pd

causalpy/data/simulate_data.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1+
# Copyright 2024 The PyMC Labs Developers
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
114
"""
215
Functions that generate data sets used in examples
316
"""
17+
418
import numpy as np
519
import pandas as pd
620
from scipy.stats import dirichlet, gamma, norm, uniform

causalpy/data_validation.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# Copyright 2024 The PyMC Labs Developers
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
114
import warnings # noqa: I001
215

316
import pandas as pd

causalpy/plot_utils.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# Copyright 2024 The PyMC Labs Developers
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
114
"""
215
Plotting utility functions.
316
"""

0 commit comments

Comments
 (0)