From dced9533d0a796bd9d4c65a8c44ecc726ec6dd65 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Thu, 7 Mar 2024 13:45:56 -0800 Subject: [PATCH] reformatted --- test/data_tests/data_utilities_test.py | 48 +++++++++++++++++++------- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/test/data_tests/data_utilities_test.py b/test/data_tests/data_utilities_test.py index 67eb2fd7..2d40d867 100755 --- a/test/data_tests/data_utilities_test.py +++ b/test/data_tests/data_utilities_test.py @@ -85,7 +85,7 @@ def test_bootstrap_character_matrices_no_priors(self): self.assertEqual(len(bootstrap_samples), 10) - for (bootstrap_matrix, bootstrap_priors) in bootstrap_samples: + for bootstrap_matrix, bootstrap_priors in bootstrap_samples: self.assertCountEqual( self.character_matrix.index, bootstrap_matrix.index ) @@ -113,7 +113,7 @@ def test_bootstrap_character_matrices_with_priors(self): self.assertEqual(len(bootstrap_samples), 10) - for (bootstrap_matrix, bootstrap_priors) in bootstrap_samples: + for bootstrap_matrix, bootstrap_priors in bootstrap_samples: self.assertCountEqual( self.character_matrix.index, bootstrap_matrix.index ) @@ -317,11 +317,31 @@ def test_lca_characters_ambiguous(self): self.assertEqual(ret_vec, [1, 2, 3, 0, 5]) def test_lca_characters_ambiguous2(self): - - s1 = [(4, 62), (3, 10), (3, 10, 16), (0, 3), (0, 2, 3), (0, 2, 3), (0, 4, 7), (0, 2, 23), (0, 1, 4, 44)] + + s1 = [ + (4, 62), + (3, 10), + (3, 10, 16), + (0, 3), + (0, 2, 3), + (0, 2, 3), + (0, 4, 7), + (0, 2, 23), + (0, 1, 4, 44), + ] s2 = [4, 3, -1, 0, 0, 0, (0, 7), (0, 2), (0, 4)] - expected_reconstruction = [4, 3, (3, 10, 16), 0, 0, 0, (0, 7), (0, 2), (0, 4)] + expected_reconstruction = [ + 4, + 3, + (3, 10, 16), + 0, + 0, + 0, + (0, 7), + (0, 2), + (0, 4), + ] ret_vec = data_utilities.get_lca_characters( [s1, s2], missing_state_indicator=-1 ) @@ -336,7 +356,7 @@ def test_lca_characters_ambiguous_and_missing(self): ret_vec = data_utilities.get_lca_characters( vecs, missing_state_indicator=-1 ) - self.assertEqual(ret_vec, [1, (0,2), (3,0), 0, 5]) + self.assertEqual(ret_vec, [1, (0, 2), (3, 0), 0, 5]) def test_resolve_most_abundant(self): state = (1, 2, 3, 3) @@ -463,8 +483,10 @@ def test_inter_cluster_distance_basic(self): tree = CassiopeiaTree(tree=tree, cell_meta=meta_data) - inter_cluster_distances = data_utilities.compute_inter_cluster_distances( - tree, meta_item="CellType" + inter_cluster_distances = ( + data_utilities.compute_inter_cluster_distances( + tree, meta_item="CellType" + ) ) expected_distances = pd.DataFrame.from_dict( @@ -518,10 +540,12 @@ def test_inter_cluster_distance_custom_input(self): tree = CassiopeiaTree(tree=tree) - inter_cluster_distances = data_utilities.compute_inter_cluster_distances( - tree, - meta_data=meta_data["CellType"], - dissimilarity_map=weight_matrix, + inter_cluster_distances = ( + data_utilities.compute_inter_cluster_distances( + tree, + meta_data=meta_data["CellType"], + dissimilarity_map=weight_matrix, + ) ) expected_distances = pd.DataFrame.from_dict(