Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dowhy as core dependency #661

Merged
merged 2 commits into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
parameters:
versions: ['3.8']
images: ['ubuntu-18.04']
package: '-e .[tf,plt]'
package: '-e .[tf,plt,dowhy]'
job:
job: 'Notebooks_cust'
dependsOn: 'EvalChanges'
Expand Down Expand Up @@ -192,7 +192,7 @@ jobs:

- template: azure-pipelines-steps.yml
parameters:
package: '-e .[tf,plt]'
package: '-e .[tf,plt,dowhy]'
job:
job: Tests_main
dependsOn: 'EvalChanges'
Expand Down
13 changes: 11 additions & 2 deletions econml/dowhy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@
import pandas as pd
import numpy as np
import warnings
from dowhy import CausalModel
from econml.utilities import check_input_arrays, reshape_arrays_2dim, get_input_columns
from econml.utilities import check_input_arrays, reshape_arrays_2dim, get_input_columns, MissingModule
try:
import dowhy
from dowhy import CausalModel
except ImportError as exn:
dowhy = CausalModel = MissingModule("dowhy is no longer a dependency of the main econml "
"package; install econml[dowhy] or econml[all] to require it, or install "
"dowhy separately to use dowhy from econml", exn)


class DoWhyWrapper:
Expand All @@ -30,6 +36,9 @@ class DoWhyWrapper:
"""

def __init__(self, cate_estimator):
from pkg_resources import parse_version
if parse_version(dowhy.__version__) >= parse_version('0.9'):
warnings.warn("econml has not been tested with dowhy versions >= 0.9")
self._cate_estimator = cate_estimator

def _get_params(self):
Expand Down
4 changes: 3 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ install_requires =
statsmodels >= 0.10
pandas
shap >= 0.38.1, < 0.41.0
dowhy < 0.8
lightgbm
test_suite = econml.tests
tests_require =
Expand All @@ -62,13 +61,16 @@ tf =
plt =
graphviz
matplotlib
dowhy =
dowhy < 0.9
all =
azure-cli
keras < 2.4
tensorflow > 1.10, < 2.3
; Version capped due to tensorflow incompatibility
protobuf < 4
matplotlib
dowhy < 0.9

[options.packages.find]
include =
Expand Down