def test_strip_div_model_column(self): self.write_posterior_file() self.columns.append(('PRI.div.model', [2, 1, 2])) div_tmp_path = self.get_test_path(prefix = 'div-model-column') self.write_posterior_file(path=div_tmp_path) stripped_path = self.get_test_path(prefix = 'stripped') PosteriorWorker.strip_div_model_column(div_tmp_path, stripped_path) self.assertSameFiles([self.posterior_path, stripped_path])
def test_add_div_model_column_sort0(self): MSBAYES_SORT_INDEX.set_index(0) div_model_path = self.get_test_path(prefix = 'posterior-div-models-') div_models_to_indices = {'0,0': 1, '0,1': 2} expected_div_model_col = ('PRI.div.model', [2, 1, 2]) PosteriorWorker.add_div_model_column(self.posterior_path, div_model_path, div_models_to_indices) self.columns.insert(0, expected_div_model_col) self.update_expected() samples = parse_parameters(div_model_path) self.assertEqual(samples, self.expected) MSBAYES_SORT_INDEX.reset_default()