Esempio n. 1
0
    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:])
Esempio n. 2
0
def test_finddays_newyears():
    ddays = time.finddays(2017, 1, 1, 0, 0, 0)
    np.testing.assert_equal(ddays, 0)
Esempio n. 3
0
 def test_jan_31(self):
     days = time.finddays(2000, 1, 31, 0, 0, 0)
     np.testing.assert_allclose(days, 31)
Esempio n. 4
0
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)
Esempio n. 5
0
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)
Esempio n. 6
0
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)
Esempio n. 7
0
def test_finddays_leapday():
    dday = time.finddays(2000, 2, 29, 0, 0, 0)
    np.testing.assert_equal(dday, 31+29)
Esempio n. 8
0
def test_finddays_newyears():
    ddays = time.finddays(2017, 1, 1, 0, 0, 0)
    np.testing.assert_equal(ddays, 1)