Skip to content
Snippets Groups Projects
Commit 6f342c67 authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

test with or without computed cov matrix with real data

parent ceef0324
No related branches found
No related tags found
No related merge requests found
...@@ -19,10 +19,13 @@ class TestInitTable(object): ...@@ -19,10 +19,13 @@ class TestInitTable(object):
# Create a temporary directory # Create a temporary directory
self.test_dir = tempfile.mkdtemp() self.test_dir = tempfile.mkdtemp()
input_data_path = self.get_file_path_fn("*chr*.txt") input_data_path = self.get_file_path_fn("*chr*.txt")
init_covariance_path = self.get_file_path_fn("COV.csv") if self.computed_cov:
init_covariance_path = None
else:
init_covariance_path = self.get_file_path_fn("COV.csv")
regions_map_path = self.get_file_path_fn("regions.txt") regions_map_path = self.get_file_path_fn("regions.txt")
description_file_path = self.get_file_path_fn("summary.csv") description_file_path = self.get_file_path_fn("summary.csv")
self.expected_hdf_path = self.get_file_path_fn("initTable.hdf5") self.expected_hdf_path = self.get_file_path_fn(f"initTable{'-computed-cov' if self.computed_cov else ''}.hdf5")
init_table_path = os.path.join(self.test_dir, "test_init_table.hdf5") init_table_path = os.path.join(self.test_dir, "test_init_table.hdf5")
create_inittable_file( create_inittable_file(
input_data_path, input_data_path,
...@@ -66,15 +69,15 @@ class TestInitTable(object): ...@@ -66,15 +69,15 @@ class TestInitTable(object):
assert_frame_equal(self.expected_cov, self.result_cov, check_like=True) assert_frame_equal(self.expected_cov, self.result_cov, check_like=True)
params = [("nonans", "data_test1"), ("withnans", "data_test2")] params = [("nonans", "data_real", True), ("withnans", "data_real", False)]
for name, param in params: for name, param, computed_cov in params:
cls_name = "TestInitTable_%s" % (name,) cls_name = "TestInitTable_%s" % (name,)
print(cls_name) print(cls_name)
globals()[cls_name] = type( globals()[cls_name] = type(
cls_name, cls_name,
(TestInitTable, JassTestCase), (TestInitTable, JassTestCase),
{"test_folder": param, "__test__": True}, {"test_folder": param, "computed_cov":computed_cov, "__test__": True},
) )
if __name__ == "__main__": if __name__ == "__main__":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment