def test_sample_fixed_imag(self): n_samples = 10 real = Uniform(*(np.random.rand(2) + np.array([0, 1]))) imag = np.random.rand() cp = ComplexPrior(real, imag) samples = cp.sample(n_samples) self.assertTrue(np.all(samples.real < real.upper_bound)) self.assertTrue(np.all(samples.real > real.lower_bound)) self.assertTrue(np.all(samples.imag == imag))
def test_sample_fixed_real(self): n_samples = 10 real = np.random.rand() imag = Uniform(*(np.random.rand(2) + np.array([0, 1]))) cp = ComplexPrior(real, imag) samples = cp.sample(n_samples) self.assertTrue(np.all(samples.real == real)) self.assertTrue(np.all(samples.imag < imag.upper_bound)) self.assertTrue(np.all(samples.imag > imag.lower_bound))