Skip to content

Commit

Permalink
Add test of the causal analysis class
Browse files Browse the repository at this point in the history
  • Loading branch information
teobucci committed Apr 5, 2024
1 parent d3a23ba commit 2e4107f
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion tests/test_hawk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

"""Tests for `hawk` package."""

import pandas as pd
import pytest

from click.testing import CliRunner # noqa: F401

import hawk # noqa: F401
from hawk import cli # noqa: F401
from hawk.analysis import CausalAnalysis


@pytest.fixture
Expand All @@ -24,3 +25,32 @@ def test_content(response):
"""Sample pytest test function with the pytest fixture as an argument."""
# from bs4 import BeautifulSoup
# assert 'GitHub' in BeautifulSoup(response.content).title.string


def test_causal_analysis():
df_train = pd.read_csv("analysis/demo/Ticino_train.csv", header=0)
df_test = pd.read_csv("analysis/demo/Ticino_test.csv", header=0)
target_column_name = "target"
pcmci_test_choice = "ParCorr"
pcmci_max_lag = 0
tefs_direction = "forward"
tefs_use_contemporary_features = True
tefs_max_lag_features = 1
tefs_max_lag_target = 1
workdir = "tests/output"

causal_analysis = CausalAnalysis(
df_train,
df_test,
target_column_name,
pcmci_test_choice,
pcmci_max_lag,
tefs_direction,
tefs_use_contemporary_features,
tefs_max_lag_features,
tefs_max_lag_target,
workdir,
response=None,
)

causal_analysis.run()

0 comments on commit 2e4107f

Please sign in to comment.