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)
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)
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': [] }))
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)
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)