Exemplo n.º 1
0
    def test_get_groupings_no_field_states(self):
        """_get_groupings() should return an empty list if there are no field
        states in the groupings dictionary."""
        self.assertEqual(_get_groupings(self.dist_matrix_header,
            self.dist_matrix, {}, within=True), [])

        self.assertEqual(_get_groupings(self.dist_matrix_header,
            self.dist_matrix, {}, within=False), [])
Exemplo n.º 2
0
    def test_get_groupings_no_field_states(self):
        """_get_groupings() should return an empty list if there are no field
        states in the groupings dictionary."""
        self.assertEqual(_get_groupings(self.dist_matrix_header,
            self.dist_matrix, {}, within=True), [])

        self.assertEqual(_get_groupings(self.dist_matrix_header,
            self.dist_matrix, {}, within=False), [])
Exemplo n.º 3
0
    def test_get_groupings_invalid_distance_matrix(self):
        """Handles asymmetric and/or hollow distance matrices correctly."""
        self.assertRaises(ValueError, _get_groupings, ['foo', 'bar'],
                matrix([[0.0, 0.7], [0.7, 0.01]]), self.tiny_groups)

        # Should not raise error if we suppress the check.
        _get_groupings(['foo', 'bar'], matrix([[0.0, 0.7], [0.7, 0.01]]),
                       self.tiny_groups,
                       suppress_symmetry_and_hollowness_check=True)
Exemplo n.º 4
0
    def test_get_groupings_invalid_distance_matrix(self):
        """Handles asymmetric and/or hollow distance matrices correctly."""
        self.assertRaises(ValueError, _get_groupings, ['foo', 'bar'],
                matrix([[0.0, 0.7], [0.7, 0.01]]), self.tiny_groups)

        # Should not raise error if we suppress the check.
        _get_groupings(['foo', 'bar'], matrix([[0.0, 0.7], [0.7, 0.01]]),
                       self.tiny_groups,
                       suppress_symmetry_and_hollowness_check=True)
Exemplo n.º 5
0
 def test_get_groupings_between_tiny_dataset(self):
     """_get_groupings() should return an empty list for a single-sample
     dataset as there is only one field state, so no between distances can
     be computed."""
     self.assertEqual(
         _get_groupings(self.tiny_dist_matrix_header, self.tiny_dist_matrix, self.tiny_groups, within=False), []
     )
Exemplo n.º 6
0
 def test_get_groupings_within_tiny_dataset(self):
     """_get_groupings() should return an empty list for a single-sample
     dataset as the diagonal is omitted for within distances."""
     self.assertEqual(
         _get_groupings(self.tiny_dist_matrix_header,
                        self.tiny_dist_matrix,
                        self.tiny_groups,
                        within=True), [])
Exemplo n.º 7
0
 def test_get_groupings_between_tiny_dataset(self):
     """_get_groupings() should return an empty list for a single-sample
     dataset as there is only one field state, so no between distances can
     be computed."""
     self.assertEqual(
         _get_groupings(self.tiny_dist_matrix_header,
                        self.tiny_dist_matrix,
                        self.tiny_groups,
                        within=False), [])
Exemplo n.º 8
0
 def test_get_groupings_within_tiny_dataset(self):
     """_get_groupings() should return an empty list for a single-sample
     dataset as the diagonal is omitted for within distances."""
     self.assertEqual(
         _get_groupings(self.tiny_dist_matrix_header, self.tiny_dist_matrix, self.tiny_groups, within=True), []
     )