Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/ci-tests-drafts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-dafni.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

- uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: '3.11'

- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: '3.11'

- name: Install build tools
run: |
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
rev: 25.9.0
hooks:
- id: black
args: ['--line-length=120', '--target-version=py310']
args: ['--line-length=120', '--target-version=py311']
files: ^causal_testing/

- repo: https://github.com/pycqa/isort
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ a deliberate modification to the input configuration expected to produce a corre
## Installation

### Requirements
- Python 3.10, 3.11, 3.12 and 3.13
- Python 3.11, 3.12, 3.13 and 3.14

### Recommended: Install from conda-forge

Expand Down
2 changes: 1 addition & 1 deletion causal_testing/estimation/ipcw_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def setup_xo_t_do(self, individual: pd.DataFrame, strategy_assigned: list):
pd.Series(strategy_assigned, index=individual.index) != pd.Series(strategy_followed, index=individual.index)
).astype("boolean")
mask = mask | ~individual["eligible"]
mask.reset_index(inplace=True, drop=True)
mask = mask.reset_index(drop=True)
false = mask.loc[mask]
if false.empty:
return pd.DataFrame(
Expand Down
2 changes: 1 addition & 1 deletion causal_testing/estimation/linear_regression_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def estimate_coefficient(self) -> EffectEstimate:

if any(
(
self.df.dtypes[factor.name()] == "object"
not pd.api.types.is_numeric_dtype(self.df.dtypes[factor.name()])
for factor in patsy_md.rhs_termlist[1].factors
# We want to remove this long term as it prevents us from discovering categoricals within I(...) blocks
if factor.name() in self.df.dtypes
Expand Down
2 changes: 1 addition & 1 deletion docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Getting Started

Installation
-----------------
* We currently support Python versions 3.10, 3.11, 3.12, and 3.13.
* We currently support Python versions 3.11, 3.12, 3.13, and 3.14.

* The Causal Testing Framework can be installed through `conda-forge`_ (recommended), the `Python Package Index (PyPI)`_, or directly from source (recommended for contributors).

Expand Down
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this file be committed? Is it needed for the tutorial or could it be in the .gitignore?

Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@
"max_doses": 2198.7466666666674
},
"ci_low": {
"max_doses": 2065.111372257549
"max_doses": 2065.1113722575496
},
"ci_high": {
"max_doses": 2332.3819610757855
"max_doses": 2332.381961075785
}
}
},
Expand Down Expand Up @@ -247,13 +247,13 @@
],
"effect_measure": "coefficient",
"effect_estimate": {
"cum_vaccinated": 0.0017107387725947554
"cum_vaccinated": 0.0017107387725956436
},
"ci_low": {
"cum_vaccinated": -0.03931269141189859
"cum_vaccinated": -0.03931269141189769
},
"ci_high": {
"cum_vaccinated": 0.0427341689570881
"cum_vaccinated": 0.04273416895708898
}
}
}
Expand Down
24 changes: 11 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,24 @@ name = "causal_testing_framework"
authors = [{ name = "The CITCOM team" }]
description = "A framework for causal testing using causal directed acyclic graphs."
readme = "README.md"
requires-python = ">=3.10,<3.14"
requires-python = ">=3.11,<3.15"
license = { text = "MIT" }
keywords = ["causal inference","verification"]
dependencies = [
"lifelines<=0.28.0; python_version <= '3.10'",
"lifelines; python_version > '3.10'",
"networkx>=3.4,<3.5",
"numpy>=1.26.0,<=2.2.0",
"pandas>=2.1,<3",
"lifelines",
"networkx>=3.4,<3.7",
"numpy>=1.26.0,<=2.4.4",
"pandas>=2.1",
"scikit_learn~=1.4",
"scipy>=1.12.0,<1.14; python_version <= '3.10'",
"scipy>=1.12.0,<=1.16.2; python_version > '3.10'",
"scipy>=1.12.0,<=1.17.1",
"statsmodels~=0.14",
"tabulate~=0.9",
"pydot~=2.0",
"pygad~=3.3",
"deap~=1.4.1",
"sympy~=1.13.1",
"pyarrow~=19.0.1",
"fastparquet~=2024.11.0",
"sympy~=1.14.0",
"pyarrow>=19.0.1,<25",
"fastparquet>=2024.11.0",
"tqdm~=4.67.1"
]
dynamic = ["version"]
Expand Down Expand Up @@ -74,7 +72,7 @@ write_to = "causal_testing/_version.py"
[tool.black]
# https://github.com/psf/black
line-length = 120
target-version = ["py310"]
target-version = ["py311"]

[tool.isort]
profile = "black"
Expand All @@ -94,7 +92,7 @@ python_files = [

[tool.tox]
requires = ["tox>=4.19"]
env_list = ["3.10","3.11","3.12","3.13"]
env_list = ["3.11","3.12","3.13","3.14"]
skip_missing_interpreters = false # fail if devs don’t have all required Python versions

# Base configuration for all test environments
Expand Down
13 changes: 7 additions & 6 deletions tests/testing_tests/test_causal_test_adequacy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
import unittest
from pathlib import Path
import scipy
import pandas as pd

Expand Down Expand Up @@ -49,11 +48,12 @@ def test_data_adequacy_numeric(self):
adequacy_metric = DataAdequacy(causal_test_case)
adequacy_metric.measure_adequacy()

self.assertEqual(
self.assertAlmostEqual(
adequacy_metric.kurtosis["test_input"],
0,
f"Expected kurtosis not {adequacy_metric.kurtosis['test_input']}",
)
delta=1.0,
msg=f"Expected kurtosis near 0, got {adequacy_metric.kurtosis['test_input']}",
) # This adds a numerical tolerance for Pandas
self.assertEqual(
adequacy_metric.bootstrap_size, 100, f"Expected bootstrap size 100 not {adequacy_metric.bootstrap_size}"
)
Expand All @@ -76,10 +76,11 @@ def test_data_adequacy_categorical(self):
adequacy_metric = DataAdequacy(causal_test_case)
adequacy_metric.measure_adequacy()

self.assertEqual(
self.assertAlmostEqual(
adequacy_metric.kurtosis["test_input_no_dist[T.b]"],
0,
f"Expected kurtosis not {adequacy_metric.kurtosis['test_input_no_dist[T.b]']}",
delta=1.0,
msg=f"Expected kurtosis near 0, got {adequacy_metric.kurtosis['test_input_no_dist[T.b]']}",
)
self.assertEqual(
adequacy_metric.bootstrap_size, 100, f"Expected bootstrap size 100 not {adequacy_metric.bootstrap_size}"
Expand Down
Loading