Skip to content

Commit

Permalink
Update dependencies and add Python 3.12 compatibility
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
  • Loading branch information
bloebp committed Oct 4, 2024
1 parent 2f35b62 commit 69075be
Show file tree
Hide file tree
Showing 9 changed files with 2,589 additions and 2,853 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/advanced-on-demand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
poetry-version: [1.5.1]
test-group: [1, 2, 3, 4]

Expand Down Expand Up @@ -54,6 +54,12 @@ jobs:
with:
poetry-version: ${{ matrix.poetry-version }}

- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
with:
version: "14.0"
directory: ${{ runner.temp }}/llvm

- name: Install graphviz
run: |
sudo apt install graphviz libgraphviz-dev graphviz-dev pkg-config
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/ci-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand All @@ -36,6 +36,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
with:
version: "14.0"
directory: ${{ runner.temp }}/llvm

- name: Install graphviz
run: |
sudo apt install graphviz libgraphviz-dev graphviz-dev pkg-config
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
poetry-version: [1.5.1]
test-group: [1, 2, 3, 4, 5, 6]

Expand All @@ -44,6 +44,12 @@ jobs:
with:
poetry-version: ${{ matrix.poetry-version }}

- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2.0.5
with:
version: "14.0"
directory: ${{ runner.temp }}/llvm

- name: Install graphviz
run: |
sudo apt install graphviz libgraphviz-dev graphviz-dev pkg-config
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ jobs:
with:
fetch-depth: 0

- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2.0.5
with:
version: "14.0"
directory: ${{ runner.temp }}/llvm

- name: Some cleanup for more disk space
run: |
rm -rf /usr/share/dotnet
rm -rf "$AGENT_TOOLSDIRECTORY"
apt-get autoremove -y
apt-get clean
df -h
- name: Install Python Dependencies
run: poetry install -E plotting -E pydot -E pygraphviz -E econml --with docs

Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ jobs:
with:
fetch-depth: 0

- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2.0.5
with:
version: "14.0"
directory: ${{ runner.temp }}/llvm

- name: Some cleanup for more disk space
run: |
rm -rf /usr/share/dotnet
rm -rf "$AGENT_TOOLSDIRECTORY"
apt-get autoremove -y
apt-get clean
df -h
- name: Install Python Dependencies
run: poetry install -E plotting -E pydot -E pygraphviz -E econml --with docs

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
poetry-version: [1.5.1]

steps:
Expand All @@ -27,6 +27,12 @@ jobs:
with:
poetry-version: ${{ matrix.poetry-version }}

- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
with:
version: "14.0"
directory: ${{ runner.temp }}/llvm

- name: Install graphviz
run: |
sudo apt install graphviz libgraphviz-dev graphviz-dev pkg-config
Expand Down
2 changes: 0 additions & 2 deletions dowhy/causal_estimators/econml.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import numpy as np
import pandas as pd
from numpy.distutils.misc_util import is_sequence

from dowhy.causal_estimator import CausalEstimate, CausalEstimator
from dowhy.causal_identifier import IdentifiedEstimand
Expand Down Expand Up @@ -295,7 +294,6 @@ def shap_values(self, df: pd.DataFrame, *args, **kwargs):
def apply_multitreatment(self, df: pd.DataFrame, fun: Callable, *args, **kwargs):
ests = []
assert not isinstance(self._treatment_value, str)
assert is_sequence(self._treatment_value)

if df is None:
filtered_df = None
Expand Down
5,293 changes: 2,480 additions & 2,813 deletions poetry.lock

Large diffs are not rendered by default.

87 changes: 53 additions & 34 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ classifiers = [
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
]
keywords = [
'causality',
Expand All @@ -36,7 +37,7 @@ priority = "explicit"


[build-system]
requires = ["poetry-core>=1.0.0"]
requires = ["poetry-core>=1.0.0", "cython<3"]
build-backend = "poetry.core.masonry.api"

[tool.poetry-dynamic-versioning]
Expand All @@ -53,25 +54,41 @@ files = ["dowhy/__init__.py"]
# * numba (imported by econml) requires python <3.11
#
[tool.poetry.dependencies]
python = ">=3.8,<3.12"
cython = ">=0.29.32"
scipy = ">=1.4.1"
python = ">=3.8,<3.13"
cython = "<3.0"
scipy = [
{version = ">=1.7", python = "<3.9"},
{version = ">=1.10", python = ">=3.9"}
]
statsmodels = ">=0.13.5"
numpy = ">=1.20"
pandas = ">=1.4.3"
numpy = [
{version = "<2.0", python = "<3.9"},
{version = ">1.0", python = ">=3.9"}
]
pandas = [
{version = "<2.0", python = "<3.9"},
{version = ">1.0", python = ">=3.9"}
]
networkx = ">=2.8.5"
sympy = ">=1.10.1"
scikit-learn = ">1.0"
pydot = { version = "^1.4.2", optional = true }
joblib = ">=1.1.0"
pygraphviz = { version = "^1.9", optional = true }
econml = { version = ">=0.14.1", optional = true }
pygraphviz = { version = ">=1.9", optional = true }
econml = ">=0.15.1"
tqdm = ">=4.64.0"
causal-learn = ">=0.1.3.0"
numba = [
{version = "<0.59", python = "<3.9"},
{version = ">=0.59", python = ">=3.9"}
]

#Plotting Extra
matplotlib = { version = ">=3.5.3", optional = true }
cvxpy = "^1.2.2"
cvxpy = [
{version = "<1.5.0", python = "<3.9"},
{version = ">=1.2.2", python = ">=3.9"}
]

[tool.poetry.extras]
pygraphviz = ["pygraphviz"]
Expand All @@ -80,28 +97,31 @@ plotting = ["matplotlib"]
econml = ["econml"]

[tool.poetry.group.dev.dependencies]
poethepoet = "^0.24.4"
flake8 = "^5.0.4"
black = { version = ">=22.6,<25.0", extras = ["jupyter"] }
isort = "^5.10.1"
pytest = "^7.1.2"
pytest-cov = "^4.1.0"
pytest-split = "^0.8.0"
nbformat = "^5.4.0"
jupyter = "^1.0.0"
flaky = "^3.7.0"
keras = "^2.9.0"
xgboost = "^2.0.2"
mypy = "^1.7.1"
poethepoet = ">=0.24.4"
flake8 = ">=5.0.4"
black = { version = ">=22.6", extras = ["jupyter"] }
isort = ">=5.10.1"
pytest = ">=7.1.2"
pytest-cov = ">=4.1.0"
pytest-split = ">=0.8.0"
nbformat = ">=5.4.0"
jupyter = ">=1.0.0"
flaky = ">=3.7.0"
keras = ">=2.9.0"
xgboost = ">=2.0.2"
mypy = ">=1.7.1"
torch = [
{version = "<=1.99", python = ">=3.8,<3.11"},
{version = "^2.0", python = ">=3.11", source = "torch-cpu"}
{version = ">2.0", python = ">=3.11", source = "torch-cpu"}
]
torchvision = [
{version = ">=0.13.1", python = ">=3.8,<3.11"},
{version = ">=0.15.2", python=">=3.11"}
{version = ">=0.15.2", python=">=3.11", source = "torch-cpu"}
]
pytorch-lightning = [
{version = "<2.0", python = ">=3.8,<3.11"},
{version = ">=2.0", python=">=3.11"}
]
pytorch-lightning = "<2.0"

[tool.poetry.group.docs]
optional = true
Expand All @@ -111,17 +131,16 @@ optional = true
# Dependencies for Documentation Generation
#

sphinx_design = "^0.3.0"
sphinx = "^5.3.0"
sphinx_design = ">=0.3.0"
sphinx = ">=5.3.0"
sphinxcontrib-googleanalytics = { git = "https://github.com/sphinx-contrib/googleanalytics.git", branch = "master" }
nbsphinx = "^0.8.9"
sphinx-rtd-theme = "^1.0.0"
pydata-sphinx-theme = "^0.9.0"
ipykernel = "^6.15.1"
nbsphinx = ">=0.8.9"
sphinx-rtd-theme = ">=1.0.0"
pydata-sphinx-theme = ">=0.9.0"
ipykernel = ">=6.15.1"
sphinx-copybutton = "0.5.0"
seaborn = "^0.12.1"
tensorflow = "^2.11.0"
cdt ="^0.6.0"
seaborn = ">=0.12.1"
cdt =">=0.6.0"

#
# Versions defined for security reasons
Expand Down

0 comments on commit 69075be

Please sign in to comment.