Skip to content

Commit

Permalink
in progress of testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ntalluri committed Nov 7, 2024
1 parent 691673c commit 26178f9
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/evaluate/expected/expected-node-ensemble.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Node max_freq
C 0.75
E 0.75
D 0.75
F 0.75
A 0.5
B 0.5
L 0.5
M 0.5
O 0.25
P 0.25
N 0.25
Q 0.25
10 changes: 10 additions & 0 deletions test/evaluate/input/ensemble-network.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Node1 Node2 Frequency Direction
A B 0.5 U
C D 0.75 U
E F 0.75 U
L M 0.5 U
M N 0.25 U
O P 0.25 U
P Q 0.25 U
A B 0.25 D
B A 0.25 D
36 changes: 36 additions & 0 deletions test/evaluate/test_evaluate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import filecmp
from pathlib import Path

import pandas as pd
import pytest

from spras.evaluation import Evaluation

INPUT_DIR = 'test/evaluate/input/'
OUT_DIR = 'test/evaluate/output/'
EXPECT_DIR = 'test/evaluate/expected/'


class TestEvaluate:
@classmethod
def setup_class(cls):
"""
Create the expected output directory
"""
Path(OUT_DIR).mkdir(parents=True, exist_ok=True)

def test_node_ensemble(self):
ensemble_file = INPUT_DIR + 'ensemble-network.tsv'
edge_freq = Evaluation.edge_frequency_node_ensemble(ensemble_file)
edge_freq.to_csv(OUT_DIR + 'node-ensemble.csv', sep="\t", index=False)
assert filecmp.cmp(OUT_DIR + 'node-ensemble.csv', EXPECT_DIR + 'expected-node-ensemble.csv', shallow=False)

def test_PRC_node_ensemble(self):
None

def test_precision_and_recall(self):
None

def test_pca_chosen_pathway(self):
None

0 comments on commit 26178f9

Please sign in to comment.