예제 #1
0
 def test_gt_one(self):
     with self.assertRaises(ValueError):
         dcs.convert_annual_to_monthly_probability(np.array([0., 0.5, 1.5]))
예제 #2
0
 def test_prob_rate_conversions2a(self):
     new = dcs.Units.convert(0.5, dcs.Units.AP, dcs.Units.MP)
     exp = dcs.convert_annual_to_monthly_probability(0.5)
     self.assertEqual(new, exp)
예제 #3
0
 def test_scalar(self):
     monthly = dcs.convert_annual_to_monthly_probability(0)
     self.assertIn(monthly, self.monthly)
예제 #4
0
 def test_lt_zero(self):
     with self.assertRaises(ValueError):
         dcs.convert_annual_to_monthly_probability(np.array([0., 0.5, -1.]))
예제 #5
0
 def test_prob_rate_conversions2a(self):
     new = dcs.Units.convert(0.5, dcs.Units.AP, dcs.Units.MP)
     exp = dcs.convert_annual_to_monthly_probability(0.5)
     self.assertEqual(new, exp)
예제 #6
0
 def test_conversion(self):
     monthly = dcs.convert_annual_to_monthly_probability(self.annuals)
     for i in range(0, len(self.monthly)):
         self.assertAlmostEqual(monthly[i], self.monthly[i])
예제 #7
0
 def test_gt_one(self):
     with self.assertRaises(ValueError):
         dcs.convert_annual_to_monthly_probability(np.array([0., 0.5, 1.5]))
예제 #8
0
 def test_circular(self):
     annual = dcs.convert_monthly_to_annual_probability(self.monthly)
     np.testing.assert_array_almost_equal(annual, self.annuals)
     monthly = dcs.convert_annual_to_monthly_probability(annual)
     np.testing.assert_array_almost_equal(monthly, self.monthly)
예제 #9
0
 def test_lt_zero(self):
     with self.assertRaises(ValueError):
         dcs.convert_annual_to_monthly_probability(np.array([0., 0.5, -1.]))
예제 #10
0
 def test_scalar(self):
     monthly = dcs.convert_annual_to_monthly_probability(0)
     self.assertIn(monthly, self.monthly)
예제 #11
0
 def test_conversion(self):
     monthly = dcs.convert_annual_to_monthly_probability(self.annuals)
     np.testing.assert_array_almost_equal(monthly, self.monthly)
예제 #12
0
 def test_circular(self):
     annual = dcs.convert_monthly_to_annual_probability(self.monthly)
     np.testing.assert_array_almost_equal(annual, self.annuals)
     monthly = dcs.convert_annual_to_monthly_probability(annual)
     np.testing.assert_array_almost_equal(monthly, self.monthly)
예제 #13
0
 def test_conversion(self):
     monthly = dcs.convert_annual_to_monthly_probability(self.annuals)
     np.testing.assert_array_almost_equal(monthly, self.monthly)