Skip to content

Commit

Permalink
Add unit test for network comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
pwollstadt committed Nov 6, 2018
1 parent a53782a commit 7f8a1da
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions test/test_network_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,11 @@ def test_calculate_mean():
for t in comp.union.targets_analysed:
assert (cmi_mean[t] == cmi[t]).all(), ('Error in mean of CMI for '
'target {0}'.format(t))

if len(cmi[t]) == 0: # skip if no links in results
continue
assert (cmi_mean[t] == cmi[t][0]).all(), (
'Error in mean of CMI for target {0} - actual: ({1}), expected: '
'({2})'.format(t, cmi_mean[t], cmi[t][0]))

@jpype_missing
def test_p_value_union():
Expand Down Expand Up @@ -499,13 +503,12 @@ def test_tails():


if __name__ == '__main__':
while True:
test_calculate_cmi_all_links()
# test_tails()
# test_compare_links_within()
# test_network_comparison_use_cases()
# test_p_value_union()
# test_create_union_network()
# test_assertions()
# test_calculate_mean()
# test_get_permuted_replications()
test_calculate_cmi_all_links()
test_tails()
test_compare_links_within()
test_network_comparison_use_cases()
test_p_value_union()
test_create_union_network()
test_assertions()
test_calculate_mean()
test_get_permuted_replications()

0 comments on commit 7f8a1da

Please sign in to comment.