-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from grst/grst-patch-1
Improve pytest setup
- Loading branch information
Showing
2 changed files
with
34 additions
and
31 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |