Exemplo n.º 1
0
def test_dmy_all_leap(feb3_noon):
    dmy_struct = ffi.new("dmy_struct *")
    expected = feb3_noon
    expected_jd = _AllLeapFromDate(expected)
    vic_lib.dmy_all_leap(expected_jd, dmy_struct)
    actual = dmy_to_datetime(dmy_struct)
    # assert that the difference is less than one second
    assert abs(expected - actual) < datetime.timedelta(seconds=1)
Exemplo n.º 2
0
def test_dmy_all_leap(feb3_noon):
    dmy_struct = ffi.new("dmy_struct *")
    expected = feb3_noon
    expected_jd = _AllLeapFromDate(expected)
    vic_lib.dmy_all_leap(expected_jd, dmy_struct)
    actual = dmy_to_datetime(dmy_struct)
    # assert that the difference is less than one second
    assert abs(expected - actual) < datetime.timedelta(seconds=1)
Exemplo n.º 3
0
def test_all_leap_from_dmy(feb3_noon, dmy_feb_3_noon):
    d_vic = vic_lib.all_leap_from_dmy(dmy_feb_3_noon)
    d_nc = netcdftime._AllLeapFromDate(feb3_noon)
    np.testing.assert_allclose(d_vic, d_nc)
Exemplo n.º 4
0
def test_all_leap_from_dmy(feb3_noon, dmy_feb_3_noon):
    d_vic = vic_lib.all_leap_from_dmy(dmy_feb_3_noon)
    d_nc = netcdftime._AllLeapFromDate(feb3_noon)
    np.testing.assert_allclose(d_vic, d_nc)