Esempio n. 1
0
 def test_check_subsample_power_inputs_bootstrap_counts(self):
     with self.assertRaises(ValueError):
         _check_subsample_power_inputs(test=self.f,
                                       samples=[np.ones((3)),
                                                np.ones((5))],
                                       counts=self.counts,
                                       bootstrap=False)
Esempio n. 2
0
 def test_check_subsample_power_inputs_matched_mode(self):
     with self.assertRaises(ValueError):
         _check_subsample_power_inputs(test=self.f,
                                       samples=[np.ones((2)),
                                                np.ones((5))],
                                       counts=self.counts,
                                       draw_mode="matched")
Esempio n. 3
0
 def test_check_subsample_power_inputs_draw_mode_error(self):
     with self.assertRaises(ValueError):
         _check_subsample_power_inputs(test=self.f,
                                       samples=[np.ones((2)),
                                                np.ones((5))],
                                       counts=self.counts,
                                       draw_mode="Alice Price Healy")
Esempio n. 4
0
 def test_check_subsample_power_inputs_test(self):
     # Defines a test function
     def test(x):
         return 'Hello World!'
     with self.assertRaises(TypeError):
         _check_subsample_power_inputs(test=test,
                                       samples=self.samps,
                                       counts=self.counts)
Esempio n. 5
0
    def test_check_subsample_power_inputs_test(self):
        # Defines a test function
        def test(x):
            return 'Hello World!'

        with self.assertRaises(TypeError):
            _check_subsample_power_inputs(test=test,
                                          samples=self.samps,
                                          counts=self.counts)
Esempio n. 6
0
 def test_check_sample_power_inputs(self):
     # Defines the know returns
     known_num_p = 1
     known_ratio = np.ones((2))
     # Runs the code for the returns
     test_ratio, test_num_p = \
         _check_subsample_power_inputs(test=self.f,
                                       samples=self.samps,
                                       counts=self.counts,
                                       )
     # Checks the returns are sane
     self.assertEqual(known_num_p, test_num_p)
     npt.assert_array_equal(known_ratio, test_ratio)
Esempio n. 7
0
 def test_check_sample_power_inputs(self):
     # Defines the know returns
     known_num_p = 1
     known_ratio = np.ones((2))
     # Runs the code for the returns
     test_ratio, test_num_p = \
         _check_subsample_power_inputs(test=self.f,
                                       samples=self.samps,
                                       counts=self.counts,
                                       )
     # Checks the returns are sane
     self.assertEqual(known_num_p, test_num_p)
     npt.assert_array_equal(known_ratio, test_ratio)
Esempio n. 8
0
 def test_check_subsample_power_inputs_bootstrap_error(self):
     with self.assertRaises(ValueError):
         _check_subsample_power_inputs(test=self.f,
                                       samples=self.samps,
                                       counts=np.arange(10, 1000, 10),
                                       bootstrap=False)
Esempio n. 9
0
 def test_check_subsample_power_inputs_ratio(self):
     with self.assertRaises(ValueError):
         _check_subsample_power_inputs(test=self.f,
                                       samples=self.samps,
                                       counts=self.counts,
                                       ratio=np.array([1, 2, 3]))
Esempio n. 10
0
 def test_check_subsample_power_inputs_bootstrap_counts(self):
     with self.assertRaises(ValueError):
         _check_subsample_power_inputs(test=self.f,
                                       samples=[np.ones((3)), np.ones((5))],
                                       counts=self.counts,
                                       bootstrap=False)
Esempio n. 11
0
 def test_check_subsample_power_inputs_low_counts(self):
     with self.assertRaises(ValueError):
         _check_subsample_power_inputs(test=self.f,
                                       samples=self.samps,
                                       counts=np.arange(-5, 0)
                                       )
Esempio n. 12
0
 def test_check_subsample_power_inputs_matched_mode(self):
     with self.assertRaises(ValueError):
         _check_subsample_power_inputs(test=self.f,
                                       samples=[np.ones((2)), np.ones((5))],
                                       counts=self.counts,
                                       draw_mode="matched")
Esempio n. 13
0
 def test_check_subsample_power_inputs_draw_mode_error(self):
     with self.assertRaises(ValueError):
         _check_subsample_power_inputs(test=self.f,
                                       samples=[np.ones((2)), np.ones((5))],
                                       counts=self.counts,
                                       draw_mode="Alice Price Healy")
Esempio n. 14
0
 def test_check_subsample_power_inputs_bootstrap_error(self):
     with self.assertRaises(ValueError):
         _check_subsample_power_inputs(test=self.f,
                                       samples=self.samps,
                                       counts=np.arange(10, 1000, 10),
                                       bootstrap=False)
Esempio n. 15
0
 def test_check_subsample_power_inputs_ratio(self):
     with self.assertRaises(ValueError):
         _check_subsample_power_inputs(test=self.f,
                                       samples=self.samps,
                                       counts=self.counts,
                                       ratio=np.array([1, 2, 3]))
Esempio n. 16
0
 def test_check_subsample_power_inputs_low_counts(self):
     with self.assertRaises(ValueError):
         _check_subsample_power_inputs(test=self.f,
                                       samples=self.samps,
                                       counts=np.arange(-5, 0))