Skip to content

Commit

Permalink
reformatted
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjones315 committed Mar 7, 2024
1 parent b5b84cf commit dced953
Showing 1 changed file with 36 additions and 12 deletions.
48 changes: 36 additions & 12 deletions test/data_tests/data_utilities_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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
)
Expand All @@ -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)
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit dced953

Please sign in to comment.