def test_write_dendrogram_no_stats(self, caplog, tmp_dir): res = wrapper.Output(target_root_name) res.extract_results() res.aggregate_input_data() res.write_dendrogram() statfile = res.root_out_name + "_stats.tsv" assert "Cannot find {}".format(statfile) in caplog.text
def test_write_cdt(self, caplog, tmp_dir): res = wrapper.Output(target_root_name) res.extract_results() res.aggregate_input_data() res.write_cdt() assert os.path.isfile(res.root_out_name + ".cdt") ref_file = target_root_path + "_out.cdt" assert filecmp.cmp(ref_file, res.root_out_name + ".cdt", shallow=False)
def test_aggregate_input_data(self, caplog, tmp_dir): res = wrapper.Output(target_root_name) res.extract_results() res.aggregate_input_data() assert "Aggregating input data" in caplog.text assert os.path.isfile(res.root_out_name + ".tsv") ref_file = target_root_path + "_out.tsv" assert filecmp.cmp(ref_file, res.root_out_name + ".tsv", shallow=False)
def test_init(self): res = wrapper.Output() assert res.root_in_name == "autoclass" assert res.root_out_name == "autoclass_out" assert res.tolerate_error == False assert res.case_number == 0 assert res.class_number == 0 assert res.df == None assert res.stats == None assert res.experiment_names == []
def test_extract_results(self, caplog, tmp_dir): res = wrapper.Output(target_root_name) res.extract_results() assert "Found 600 cases classified in 3 classes" in caplog.text assert res.stats["main-class"].nunique() == 3 assert res.stats.shape == (600, 5)
def test_write_dendrogram(self, caplog, tmp_dir): res = wrapper.Output(target_root_name) res.extract_results() res.aggregate_input_data() res.write_dendrogram() assert os.path.isfile(res.root_out_name + "_dendrogram.png")