Exemplo n.º 1
0
def test_dict_to_live_point(live_point, d):
    """
    Test the function that converts a dictionary with a single live point to
    a live point array
    """
    x = lp.dict_to_live_points(d)
    np.testing.assert_array_equal(live_point, x)
Exemplo n.º 2
0
def test_dict_multiple_to_live_points(live_points, d):
    """
    Test the function that converts a dictionary with multiple live points to
    a live point array
    """
    x = lp.dict_to_live_points(d)
    np.testing.assert_array_equal(live_points, x)
Exemplo n.º 3
0
def test_empty_dict_to_live_points(empty_live_point):
    """
    Test the function that converts a dictionary with empty lists to
    a live point array
    """
    np.testing.assert_array_equal(
        empty_live_point, lp.dict_to_live_points({
            'x': [],
            'y': [],
            'z': []
        }))
Exemplo n.º 4
0
 def new_point(self, N=1):
     """Draw a point from the prior"""
     prior_samples = self.priors.sample(size=N)
     samples = {n: prior_samples[n] for n in self.names}
     return dict_to_live_points(samples)
Exemplo n.º 5
0
 def new_point(self, N=1):
     prior_samples = self.priors.sample(size=N)
     samples = {n: prior_samples[n] for n in self.names}
     self._update_bounds()
     return dict_to_live_points(samples)