コード例 #1
0
    def test_first_example_isma(self):
        day_counter = ActualActual(ISMA)

        self.assertAlmostEqual(
            0.5,
            day_counter.year_fraction(self.from_date, self.to_date,
                                      self.ref_start, self.ref_end))
コード例 #2
0
ファイル: test_daycounter.py プロジェクト: bondgeek/pybg
    def test_first_example_afb(self):
        day_counter = ActualActual(AFB)

        self.assertAlmostEqual(
            0.497267759563,
            day_counter.year_fraction(self.from_date, self.to_date)
        )
コード例 #3
0
    def test_first_example_isda(self):

        day_counter = ActualActual(ISDA)

        self.assertAlmostEqual(
            0.497724380567,
            day_counter.year_fraction(self.from_date, self.to_date))
コード例 #4
0
ファイル: test_daycounter.py プロジェクト: bondgeek/pybg
    def test_first_example_isma(self):
        day_counter = ActualActual(ISMA)

        self.assertAlmostEqual(
            0.5,
            day_counter.year_fraction(self.from_date, self.to_date,
                self.ref_start, self.ref_end)
        )
コード例 #5
0
ファイル: test_daycounter.py プロジェクト: bondgeek/pybg
    def test_first_example_isda(self):

        day_counter = ActualActual(ISDA)

        self.assertAlmostEqual(
            0.497724380567,
            day_counter.year_fraction(self.from_date, self.to_date)
        )
コード例 #6
0
    def test_short_calculation_second_period_isda(self):
        day_counter = ActualActual(ISDA)
        from_date = Date(1, July, 1999)
        to_date = Date(1, July, 2000)

        expected_result = 1.001377348600

        self.assertAlmostEquals(expected_result,
                                day_counter.year_fraction(from_date, to_date))
コード例 #7
0
    def test_short_calculation_first_period_afb(self):
        day_counter = ActualActual(AFB)
        from_date = Date(1, February, 1999)
        to_date = Date(1, July, 1999)

        expected_result = 0.410958904110

        self.assertAlmostEquals(expected_result,
                                day_counter.year_fraction(from_date, to_date))
コード例 #8
0
    def test_short_calculation_first_period_isma(self):
        day_counter = ActualActual(ISMA)
        from_date = Date(1, February, 1999)
        to_date = Date(1, July, 1999)
        ref_start = Date(1, July, 1998)
        ref_end = Date(1, July, 1999)
        expected_result = 0.410958904110

        self.assertAlmostEquals(
            expected_result,
            day_counter.year_fraction(from_date, to_date, ref_start, ref_end))
コード例 #9
0
ファイル: test_daycounter.py プロジェクト: bondgeek/pybg
    def test_short_calculation_first_period_afb(self):
        day_counter = ActualActual(AFB)
        from_date = Date(1, February, 1999)
        to_date = Date(1, July, 1999)

        expected_result = 0.410958904110

        self.assertAlmostEquals(
            expected_result,
            day_counter.year_fraction(from_date, to_date)
        )
コード例 #10
0
ファイル: test_daycounter.py プロジェクト: bondgeek/pybg
    def test_short_calculation_second_period_afb(self):
        day_counter = ActualActual(AFB)
        from_date = Date(1, July, 1999)
        to_date = Date(1, July, 2000)

        expected_result = 1.000000000000

        self.assertAlmostEquals(
            expected_result,
            day_counter.year_fraction(from_date, to_date)
        )
コード例 #11
0
    def test_short_calculation_second_period_isma(self):
        day_counter = ActualActual(ISMA)
        from_date = Date(1, July, 1999)
        to_date = Date(1, July, 2000)
        ref_start = Date(1, July, 1999)
        ref_end = Date(1, July, 2000)

        expected_result = 1.000000000000

        self.assertAlmostEquals(
            expected_result,
            day_counter.year_fraction(from_date, to_date, ref_start, ref_end))
コード例 #12
0
ファイル: test_daycounter.py プロジェクト: bondgeek/pybg
    def test_short_calculation_first_period_isma(self):
        day_counter = ActualActual(ISMA)
        from_date = Date(1, February, 1999)
        to_date = Date(1, July, 1999)
        ref_start = Date(1,July,1998)
        ref_end = Date(1,July,1999)
        expected_result = 0.410958904110

        self.assertAlmostEquals(
            expected_result,
            day_counter.year_fraction(from_date, to_date, ref_start, ref_end)
        )
コード例 #13
0
ファイル: test_daycounter.py プロジェクト: bondgeek/pybg
    def test_short_calculation_second_period_isma(self):
        day_counter = ActualActual(ISMA)
        from_date = Date(1, July, 1999)
        to_date = Date(1, July, 2000)
        ref_start = Date(1, July, 1999)
        ref_end = Date(1, July, 2000)


        expected_result = 1.000000000000

        self.assertAlmostEquals(
            expected_result,
            day_counter.year_fraction(from_date, to_date, ref_start, ref_end)
        )
コード例 #14
0
    def test_first_example_afb(self):
        day_counter = ActualActual(AFB)

        self.assertAlmostEqual(
            0.497267759563,
            day_counter.year_fraction(self.from_date, self.to_date))