diff --git a/tests/test_basic.py b/tests/test_basic.py deleted file mode 100644 index 0918bd2..0000000 --- a/tests/test_basic.py +++ /dev/null @@ -1,31 +0,0 @@ -import os -import pandas as pd - -from favapy import fava - -data_dir = os.environ.get("DATA_DIR") -if data_dir is None: - raise ValueError("DATA_DIR environment variable not set") - -data_file_path = os.path.join(data_dir, "Example_dataset_GSE75748_sc_cell_type_ec.tsv") - -data = pd.read_csv(data_file_path, sep="\t").iloc[:100, :100] - - -def test_favapy(): - FAVA_network = fava.cook( - data=data, - log2_normalization=True, - hidden_layer=None, - latent_dim=None, - epochs=10, - batch_size=32, - interaction_count=100, - ) - return FAVA_network - - -FAVA_network = test_favapy() - -# tests __repr__ -print(FAVA_network) diff --git a/tests/test_fava.py b/tests/test_fava.py new file mode 100644 index 0000000..5aba314 --- /dev/null +++ b/tests/test_fava.py @@ -0,0 +1,34 @@ +import os +import pandas as pd +import pytest +from pathlib import Path + +from favapy import fava + + +@pytest.fixture +def data_dir() -> Path: + data_dir = os.environ.get("DATA_DIR") + if data_dir is None: + raise ValueError("DATA_DIR environment variable not set") + else: + return Path(data_dir) + + +@pytest.fixture +def test_dataset(data_dir) -> pd.DataFrame: + data_file_path = data_dir / "Example_dataset_GSE75748_sc_cell_type_ec.tsv" + return pd.read_csv(data_file_path, sep="\t").iloc[:100, :100] + + +def test_favapy(test_dataset): + FAVA_network = fava.cook( + data=test_dataset, + log2_normalization=True, + hidden_layer=None, + latent_dim=None, + epochs=10, + batch_size=32, + interaction_count=100, + ) + return FAVA_network