Skip to content

Commit 66f22aa

Browse files
committed
update deprecation warnings for the scikit-learn experiment classes
1 parent 6f6fade commit 66f22aa

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

causalpy/skl_experiments.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,15 @@
3636

3737
# Ensure deprecation warnings are always shown in Jupyter Notebooks
3838
warnings.simplefilter("always", DeprecationWarning)
39+
RED = "\033[91m"
40+
RESET = "\033[0m"
3941

4042

4143
def SyntheticControl(*args, **kwargs):
4244
warnings.warn(
43-
"""causalpy.skl_experiments.SyntheticControl is deprecated and will be removed in a future release. Please use causalpy.experiments.SyntheticControl instead.""",
45+
f"""{RED}cp.pymc_experiments.SyntheticControl is deprecated and will be removed in a future release. Please use:
46+
import causalpy as cp
47+
cp.SyntheticControl(...){RESET}""",
4448
DeprecationWarning,
4549
stacklevel=2,
4650
)
@@ -49,7 +53,9 @@ def SyntheticControl(*args, **kwargs):
4953

5054
def DifferenceInDifferences(*args, **kwargs):
5155
warnings.warn(
52-
"""causalpy.skl_experiments.DifferenceInDifferences is deprecated and will be removed in a future release. Please use causalpy.experiments.DifferenceInDifferences instead.""",
56+
f"""{RED}cp.pymc_experiments.DifferenceInDifferences is deprecated and will be removed in a future release. Please use:
57+
import causalpy as cp
58+
cp.DifferenceInDifferences(...){RESET}""",
5359
DeprecationWarning,
5460
stacklevel=2,
5561
)
@@ -58,7 +64,9 @@ def DifferenceInDifferences(*args, **kwargs):
5864

5965
def InterruptedTimeSeries(*args, **kwargs):
6066
warnings.warn(
61-
"""causalpy.skl_experiments.InterruptedTimeSeries is deprecated and will be removed in a future release. Please use causalpy.experiments.InterruptedTimeSeries instead.""",
67+
f"""{RED}cp.pymc_experiments.InterruptedTimeSeries is deprecated and will be removed in a future release. Please use:
68+
import causalpy as cp
69+
cp.InterruptedTimeSeries(...){RESET}""",
6270
DeprecationWarning,
6371
stacklevel=2,
6472
)
@@ -67,7 +75,9 @@ def InterruptedTimeSeries(*args, **kwargs):
6775

6876
def RegressionDiscontinuity(*args, **kwargs):
6977
warnings.warn(
70-
"""causalpy.skl_experiments.RegressionDiscontinuity is deprecated and will be removed in a future release. Please use causalpy.experiments.RegressionDiscontinuity instead.""",
78+
f"""{RED}cp.pymc_experiments.RegressionDiscontinuity is deprecated and will be removed in a future release. Please use:
79+
import causalpy as cp
80+
cp.RegressionDiscontinuity(...){RESET}""",
7181
DeprecationWarning,
7282
stacklevel=2,
7383
)

0 commit comments

Comments
 (0)