Exemplo n.º 1
0
 def test_bimodal_open(self):
     start_idx = bmutils.get_good_starting_point(self.cl, self.geom_smpl, strategy="bimodal_open")
     # print(self.cl.clustercenters[start_idx])
     #print(np.sort(self.cl.clustercenters.squeeze()))
     assert 12 <= self.cl.clustercenters[start_idx] <= 18, "The coordinate distribution was created with pop " \
                                                         "maxima the values 1 (compact) and 15 (open)." \
                                                         " The found OPEN starting " \
                                                         "point should be in the interval [12,18] approx (see setUp)"
Exemplo n.º 2
0
    def test_most_pop_ordering(self):
        order = np.random.permutation(np.arange(self.cl.n_clusters))
        geom_smpl = [self.geom_smpl[ii] for ii in order]
        start_idx = bmutils.get_good_starting_point(self.cl, geom_smpl,
                                                    cl_order=order, strategy='most_pop')

        # Test might fail in some cases because it's not deterministi
        # For the check to work via the clustercenter value, we have to re-order the clusters themselves
        assert 12 <= self.cl.clustercenters[order][start_idx] <= 18, "The coordinate distribution was created with " \
                                                                     "a max pop around the value 15. The found starting " \
                                                                     "point should be in this interval (see the setUp)"
        # However, for the geom_smpl object, start_idx can be used directly:
        assert 12 <= geom_smpl[start_idx].xyz[:,-1,-1].mean() <= 18, "The coordinate distribution was created with " \
                                                                     "a max pop around the value 15. The found starting " \
                                                                     "point should be in this interval (see the setUp)"
Exemplo n.º 3
0
 def test_most_pop(self):
     start_idx = bmutils.get_good_starting_point(self.cl, self.geom_smpl, strategy="most_pop")
     #print(start_idx, self.cl.clustercenters[start_idx], np.sort(self.cl.clustercenters.squeeze()))
     assert 12 <= self.cl.clustercenters[start_idx] <= 18, "The coordinate distribution was created with a max pop " \
                                                           "around the value 15. The found starting point should be" \
                                                           "in this interval (see the setUp)"
Exemplo n.º 4
0
 def _test_most_pop_x_rgyr(self):
     start_idx = bmutils.get_good_starting_point(self.cl, self.geom_smpl, strategy="most_pop_x_smallest_Rgyr")
Exemplo n.º 5
0
 def test_smallest_rgyr(self):
     start_idx = bmutils.get_good_starting_point(self.cl, self.geom_smpl)
     # Should be the clustercenter with the smallest possible rgyr
     assert self.cl.clustercenters[start_idx] ==  self.cl.clustercenters.squeeze().min()