Ejemplo n.º 1
0
 def test__calculate_power_curve_ratio_error(self):
     with self.assertRaises(ValueError):
         _calculate_power_curve(self.f,
                                self.pop,
                                self.num_samps,
                                ratio=np.array([0.1, 0.2, 0.3]),
                                num_iter=100)
Ejemplo n.º 2
0
 def test__calculate_power_curve_default(self):
     # Sets the known output
     known = np.array([0.509, 0.822, 0.962, 0.997, 1.000, 1.000, 1.000,
                       1.000, 1.000])
     # Generates the test values
     test = _calculate_power_curve(self.f,
                                   self.pop,
                                   self.num_samps,
                                   num_iter=100)
     # Checks the samples returned sanely
     npt.assert_allclose(test, known, rtol=0.1, atol=0.01)
Ejemplo n.º 3
0
    def test__calculate_power_curve_ratio(self):
        # Sets the know output
        known = np.array([0.096, 0.333, 0.493, 0.743, 0.824, 0.937, 0.969,
                          0.996, 0.998])

        # Generates the test values
        test = _calculate_power_curve(self.f,
                                      self.pop,
                                      self.num_samps,
                                      ratio=np.array([0.25, 0.75]),
                                      num_iter=100)

        # Checks the samples returned sanely
        npt.assert_allclose(test, known, rtol=0.1, atol=0.1)
Ejemplo n.º 4
0
    def test__calculate_power_curve_alpha(self):
        # Sets the know output
        known = np.array([0.31, 0.568, 0.842, 0.954, 0.995, 1.000, 1.000,
                          1.000, 1.000])

        # Generates the test values
        test = _calculate_power_curve(self.f,
                                      self.pop,
                                      self.num_samps,
                                      alpha=0.01,
                                      num_iter=100)

        # Checks the samples returned sanely
        npt.assert_allclose(test, known, rtol=0.1, atol=0.1)
Ejemplo n.º 5
0
 def test__calculate_power_curve_ratio_error(self):
     with self.assertRaises(ValueError):
         _calculate_power_curve(self.f, self.pop, self.num_samps,
                                ratio=np.array([0.1, 0.2, 0.3]),
                                num_iter=100)