Exemplo n.º 1
0
def test_dmy_all_30_day(feb3_noon):
    dmy_struct = ffi.new("dmy_struct *")
    expected = feb3_noon
    expected_jd = _360DayFromDate(expected)
    vic_lib.dmy_all_30_day(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_30_day(feb3_noon):
    dmy_struct = ffi.new("dmy_struct *")
    expected = feb3_noon
    expected_jd = _360DayFromDate(expected)
    vic_lib.dmy_all_30_day(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_30_day_from_dmy(feb3_noon, dmy_feb_3_noon):
    d_vic = vic_lib.all_30_day_from_dmy(dmy_feb_3_noon)
    d_nc = netcdftime._360DayFromDate(feb3_noon)
    np.testing.assert_allclose(d_vic, d_nc)
Exemplo n.º 4
0
def test_all_30_day_from_dmy(feb3_noon, dmy_feb_3_noon):
    d_vic = vic_lib.all_30_day_from_dmy(dmy_feb_3_noon)
    d_nc = netcdftime._360DayFromDate(feb3_noon)
    np.testing.assert_allclose(d_vic, d_nc)