コード例 #1
0
ファイル: test_utils.py プロジェクト: sanjaybasu/dstauffman
 def test_gt_one(self):
     with self.assertRaises(ValueError):
         dcs.convert_annual_to_monthly_probability(np.array([0., 0.5, 1.5]))
コード例 #2
0
ファイル: test_units.py プロジェクト: superbeckgit/dstauffman
 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
ファイル: test_utils.py プロジェクト: sanjaybasu/dstauffman
 def test_scalar(self):
     monthly = dcs.convert_annual_to_monthly_probability(0)
     self.assertIn(monthly, self.monthly)
コード例 #4
0
ファイル: test_utils.py プロジェクト: sanjaybasu/dstauffman
 def test_lt_zero(self):
     with self.assertRaises(ValueError):
         dcs.convert_annual_to_monthly_probability(np.array([0., 0.5, -1.]))
コード例 #5
0
ファイル: test_units.py プロジェクト: superbeckgit/dstauffman
 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
ファイル: test_utils.py プロジェクト: sanjaybasu/dstauffman
 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
ファイル: test_stats.py プロジェクト: superbeckgit/dstauffman
 def test_gt_one(self):
     with self.assertRaises(ValueError):
         dcs.convert_annual_to_monthly_probability(np.array([0., 0.5, 1.5]))
コード例 #8
0
ファイル: test_stats.py プロジェクト: superbeckgit/dstauffman
 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
ファイル: test_stats.py プロジェクト: superbeckgit/dstauffman
 def test_lt_zero(self):
     with self.assertRaises(ValueError):
         dcs.convert_annual_to_monthly_probability(np.array([0., 0.5, -1.]))
コード例 #10
0
ファイル: test_stats.py プロジェクト: superbeckgit/dstauffman
 def test_scalar(self):
     monthly = dcs.convert_annual_to_monthly_probability(0)
     self.assertIn(monthly, self.monthly)
コード例 #11
0
ファイル: test_stats.py プロジェクト: superbeckgit/dstauffman
 def test_conversion(self):
     monthly = dcs.convert_annual_to_monthly_probability(self.annuals)
     np.testing.assert_array_almost_equal(monthly, self.monthly)
コード例 #12
0
ファイル: test_stats.py プロジェクト: superbeckgit/dstauffman
 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
ファイル: test_stats.py プロジェクト: superbeckgit/dstauffman
 def test_conversion(self):
     monthly = dcs.convert_annual_to_monthly_probability(self.annuals)
     np.testing.assert_array_almost_equal(monthly, self.monthly)