Skip to content

Commit

Permalink
added more tests for ensembling
Browse files Browse the repository at this point in the history
  • Loading branch information
ntalluri committed Aug 15, 2024
1 parent b6610ae commit 8c71ad8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/ml/expected/expected-ensemble-network-empty.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Node1 Node2 Frequency Direction
2 changes: 2 additions & 0 deletions test/ml/expected/expected-ensemble-network-single.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Node1 Node2 Frequency Direction
L M 1.0 U
22 changes: 22 additions & 0 deletions test/ml/test_ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,25 @@ def test_ensemble_network(self):
expected = expected.round(5)

assert en.equals(expected)

def test_ensemble_network_single_line(self):
dataframe = ml.summarize_networks([INPUT_DIR + 'test-data-single/single.txt'])
ml.ensemble_network(dataframe, OUT_DIR + 'ensemble-network-single.tsv')

en = pd.read_table(OUT_DIR + 'ensemble-network-single.tsv')
en = en.round(5)
expected = pd.read_table(EXPECT_DIR + 'expected-ensemble-network-single.tsv')
expected = expected.round(5)

assert en.equals(expected)

def test_ensemble_network_empty(self):
dataframe = ml.summarize_networks([INPUT_DIR + 'test-data-empty/empty.txt'])
ml.ensemble_network(dataframe, OUT_DIR + 'ensemble-network-empty.tsv')

en = pd.read_table(OUT_DIR + 'ensemble-network-empty.tsv')
en = en.round(5)
expected = pd.read_table(EXPECT_DIR + 'expected-ensemble-network-empty.tsv')
expected = expected.round(5)

assert en.equals(expected)

0 comments on commit 8c71ad8

Please sign in to comment.