Skip to content

Commit ed6d759

Browse files
committed
Merge branch 'main' of https://github.com/pymc-labs/CausalPy into three_period
2 parents 08ff806 + c1cd88f commit ed6d759

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,14 @@ repos:
2121
- id: end-of-file-fixer
2222
exclude_types: [svg]
2323
- id: check-yaml
24+
- id: check-toml
25+
- id: check-json
2426
- id: check-added-large-files
2527
exclude: &exclude_pattern '(iv_weak_instruments|its_lift_test)\.ipynb'
2628
args: ["--maxkb=1500"]
29+
- id: check-merge-conflict
30+
- id: check-case-conflict
31+
- id: mixed-line-ending
2732
- repo: https://github.com/astral-sh/ruff-pre-commit
2833
rev: v0.14.5
2934
hooks:
@@ -55,3 +60,7 @@ repos:
5560
args: [--ignore-missing-imports]
5661
files: ^causalpy/
5762
additional_dependencies: [numpy>=1.20, pandas-stubs]
63+
- repo: https://github.com/abravalheri/validate-pyproject
64+
rev: v0.23
65+
hooks:
66+
- id: validate-pyproject

AGENTS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@
4141
- **Custom exceptions**: Use project-specific exceptions from `causalpy.custom_exceptions`: `FormulaException`, `DataException`, `BadIndexException`
4242
- **File organization**: Experiments in `causalpy/experiments/`, PyMC models in `causalpy/pymc_models.py`, scikit-learn models in `causalpy/skl_models.py`
4343

44+
## Code quality checks
45+
46+
- **Before committing**: Always run `pre-commit run --all-files` to ensure all checks pass (linting, formatting, type checking)
47+
- **Quick check**: Run `ruff check causalpy/` for fast linting feedback during development
48+
- **Auto-fix**: Run `ruff check --fix causalpy/` to automatically fix many linting issues
49+
- **Format**: Run `ruff format causalpy/` to format code according to project standards
50+
- **Linting rules**: Project uses strict linting (F, B, UP, C4, SIM, I) to catch bugs and enforce modern Python patterns
51+
- **Note**: Documentation notebooks in `docs/` are excluded from strict linting rules
52+
4453
## Type Checking
4554

4655
- **Tool**: MyPy

causalpy/data/PISA18sampleScale.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,4 @@ PV1READ,Female,ESCS,METASUM,PERFEED,JOYREAD,MASTGOAL,ADAPTIVITY,TEACHINT,SCREADD
9898
1.382758437,0,1.112755087,1.024329216,-1.363017023,0.546695917,-0.300835494,0.488206717,0.990856172,0.19103636,-0.063690149
9999
-0.180166117,0,-0.903784153,1.416120964,-0.789077206,0.3589234,-2.209705037,-1.353064842,-0.668887592,0.689393741,-0.929939088
100100
-0.138452609,0,-1.523831485,-0.171666648,0.021680557,-0.050770988,1.521829065,-0.8111262,-0.039406676,0.66554889,-0.851380406
101-
0.907727459,1,0.115773982,1.024329216,1.478217432,0.461175761,-0.873789642,0.080450276,-0.668887592,-0.265544842,-0.063690149
101+
0.907727459,1,0.115773982,1.024329216,1.478217432,0.461175761,-0.873789642,0.080450276,-0.668887592,-0.265544842,-0.063690149

0 commit comments

Comments
 (0)