From feee7fc06b1b6515ae1c3697edd90935a1893266 Mon Sep 17 00:00:00 2001 From: PaoloBonettiPolimi <94172434+PaoloBonettiPolimi@users.noreply.github.com> Date: Tue, 16 Apr 2024 17:25:51 +0200 Subject: [PATCH] fixing no_lag test --- tests/test_causal_analysis_noLag.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test_causal_analysis_noLag.py b/tests/test_causal_analysis_noLag.py index 11133f7..4cac0b8 100644 --- a/tests/test_causal_analysis_noLag.py +++ b/tests/test_causal_analysis_noLag.py @@ -29,7 +29,7 @@ def test_content(response): # assert 'GitHub' in BeautifulSoup(response.content).title.string -def test_causal_analysis(): +def test_causal_analysis_noLag(): df_train = pd.read_csv("hawk/demo/Ticino_train.csv", header=0) df_test = pd.read_csv("hawk/demo/Ticino_test.csv", header=0) target_column_name = "target" @@ -41,6 +41,14 @@ def test_causal_analysis(): tefs_max_lag_target = 1 workdir = "tests/output" + if str(tefs_max_lag_features) == "no_lag": + tefs_max_lag_features = 0 + else: + tefs_max_lag_features = int(tefs_max_lag_features) + + if not tefs_use_contemporary_features and tefs_max_lag_features == 0: + raise ValueError("You cannot use no lag features and not use contemporary features in TEFS.") + causal_analysis = CausalAnalysis( df_train, df_test,