コード例 #1
0
ファイル: test_chain.py プロジェクト: Samreay/ChainConsumer
 def test_chain_with_bad_chain_fails_on_access2(self):
     c = Chain(self.bad, self.p, self.n)
     with pytest.raises(AssertionError):
         c.get_data(self.p[0])
コード例 #2
0
 def test_chain_with_bad_weights3(self):
     with pytest.raises(AssertionError):
         w = self.w.copy()
         w[10] = np.nan
         Chain(self.d, self.p, self.n, weights=w)
コード例 #3
0
 def test_good_grid(self):
     Chain(self.d, self.p, self.n, grid=False)
コード例 #4
0
 def test_bad_grid3(self):
     with pytest.raises(AssertionError):
         Chain(self.d, self.p, self.n, grid="False")
コード例 #5
0
 def test_chain_with_bad_params3(self):
     with pytest.raises(AssertionError):
         Chain(self.d, None, self.n)
コード例 #6
0
 def test_chain_with_bad_chain_initial_success2(self):
     c = Chain(self.bad, self.p, self.n)
     c.get_data(1)
コード例 #7
0
 def test_bad_posterior5(self):
     posterior = np.ones(100)
     posterior[0] = -np.inf
     with pytest.raises(AssertionError):
         Chain(self.d, self.p, self.n, posterior=posterior)
コード例 #8
0
 def test_chain_with_bad_params1(self):
     with pytest.raises(AssertionError):
         Chain(self.d, self.p[:-1], self.n)
コード例 #9
0
 def test_bad_posterior2(self):
     with pytest.raises(AssertionError):
         Chain(self.d, self.p, self.n, posterior=np.ones(50))
コード例 #10
0
 def test_good_chain(self):
     Chain(self.d, self.p, self.n)
コード例 #11
0
 def test_good_posterior3(self):
     Chain(self.d, self.p, self.n, posterior=np.ones((1, 100)))
コード例 #12
0
 def test_good_posterior2(self):
     Chain(self.d, self.p, self.n, posterior=np.ones((100, 1)))
コード例 #13
0
 def test_bad_walkers4(self):
     with pytest.raises(AssertionError):
         Chain(self.d, self.p, self.n, walkers=2.5)
コード例 #14
0
 def test_chain_with_bad_weights4(self):
     with pytest.raises(AssertionError):
         Chain(self.d, self.p, self.n, weights=np.ones((50, 2)))
コード例 #15
0
 def test_good_num_free_params2(self):
     Chain(self.d, self.p, self.n, num_free_params=2.0)
コード例 #16
0
 def test_chain_with_bad_name2(self):
     with pytest.raises(AssertionError):
         Chain(self.d, self.p, None)
コード例 #17
0
 def test_bad_num_free_params4(self):
     with pytest.raises(AssertionError):
         Chain(self.d, self.p, self.n, num_free_params=-10)
コード例 #18
0
 def test_chain_with_bad_params2(self):
     with pytest.raises(AssertionError):
         Chain(self.d, ["A", "B", 0], self.n)
コード例 #19
0
 def test_good_chain_weights1(self):
     Chain(self.d, self.p, self.n, self.w)
コード例 #20
0
 def test_chain_with_bad_chain_initial_success1(self):
     Chain(self.bad, self.p, self.n)
コード例 #21
0
 def test_good_num_eff_data_points2(self):
     Chain(self.d, self.p, self.n, num_eff_data_points=20.4)
コード例 #22
0
 def test_chain_with_bad_chain_fails_on_access2(self):
     c = Chain(self.bad, self.p, self.n)
     with pytest.raises(AssertionError):
         c.get_data(self.p[0])
コード例 #23
0
 def test_bad_num_eff_data_points3(self):
     with pytest.raises(AssertionError):
         Chain(self.d, self.p, self.n, num_eff_data_points=-100)
コード例 #24
0
 def test_bad_grid2(self):
     with pytest.raises(AssertionError):
         Chain(self.d, self.p, self.n, grid=None)
コード例 #25
0
 def test_good_chain_weights3(self):
     Chain(self.d, self.p, self.n, self.w[None].T)
コード例 #26
0
 def test_good_walkers1(self):
     Chain(self.d, self.p, self.n, walkers=10)
コード例 #27
0
ファイル: test_chain.py プロジェクト: Samreay/ChainConsumer
 def test_chain_with_bad_chain_initial_success2(self):
     c = Chain(self.bad, self.p, self.n)
     c.get_data(1)