コード例 #1
0
ファイル: test_time.py プロジェクト: skulumani/astro
    def test_jan_1(self):
        yrmdhms = (2000, 1, 1, 0, 0, 0)
        days = time.finddays(yrmdhms[0], yrmdhms[1], yrmdhms[2], yrmdhms[3], yrmdhms[4], yrmdhms[5])
        mdhms = time.dayofyr2mdhms(yrmdhms[0], 1)

        np.testing.assert_allclose(days, 1)
        np.testing.assert_allclose(mdhms, yrmdhms[1:])
コード例 #2
0
def test_finddays_newyears():
    ddays = time.finddays(2017, 1, 1, 0, 0, 0)
    np.testing.assert_equal(ddays, 0)
コード例 #3
0
ファイル: test_time.py プロジェクト: skulumani/astro
 def test_jan_31(self):
     days = time.finddays(2000, 1, 31, 0, 0, 0)
     np.testing.assert_allclose(days, 31)
コード例 #4
0
ファイル: test_time.py プロジェクト: skulumani/astro
def test_finddays_special_year():
    expected_days = 365
    actual_days = time.finddays(1800, 12, 31, 0, 0, 0)
    np.testing.assert_allclose(actual_days, expected_days)
コード例 #5
0
ファイル: test_time.py プロジェクト: skulumani/astro
def test_vallado_312_converting_fractional_days():
    expected_days = 77.5097222
    actual_days = time.finddays(2001, 3, 18, 12, 14, 0)
    np.testing.assert_allclose(actual_days, expected_days)
コード例 #6
0
ファイル: test_time.py プロジェクト: skulumani/astro
def test_finddays_vallado_311():
    expected_days = 129.0
    actual_days = time.finddays(1992, 5, 8, 0, 0, 0)
    np.testing.assert_allclose(actual_days, expected_days)
コード例 #7
0
ファイル: test_time.py プロジェクト: skulumani/astro
def test_finddays_leapday():
    dday = time.finddays(2000, 2, 29, 0, 0, 0)
    np.testing.assert_equal(dday, 31+29)
コード例 #8
0
ファイル: test_time.py プロジェクト: skulumani/astro
def test_finddays_newyears():
    ddays = time.finddays(2017, 1, 1, 0, 0, 0)
    np.testing.assert_equal(ddays, 1)