예제 #1
0
파일: test_make_dmy.py 프로젝트: BramDr/VIC
def test_make_dmy():
    vic_lib.global_param.model_steps_per_day = 1
    vic_lib.global_param.dt = 86400
    vic_lib.global_param.startsec = 0
    vic_lib.global_param.startday = 1
    vic_lib.global_param.startmonth = 1
    vic_lib.global_param.startyear = 2015
    vic_lib.global_param.nrecs = 30

    for calendar in ['CALENDAR_STANDARD', 'CALENDAR_GREGORIAN',
                     'CALENDAR_PROLEPTIC_GREGORIAN', 'CALENDAR_NOLEAP',
                     'CALENDAR_365_DAY', 'CALENDAR_360_DAY', 'CALENDAR_JULIAN',
                     'CALENDAR_ALL_LEAP', 'CALENDAR_366_DAY']:
        vic_lib.global_param.calendar = getattr(vic_lib, calendar)
        dmy = vic_lib.make_dmy(ffi.addressof(vic_lib.global_param))

        assert dmy is not None
        for i in range(vic_lib.global_param.nrecs):
            assert dmy[i].year == 2015
            assert dmy[i].month == 1
            assert dmy[i].day == i + 1
            assert dmy[i].dayseconds == 0
예제 #2
0
def test_make_dmy():
    vic_lib.global_param.model_steps_per_day = 1
    vic_lib.global_param.dt = 86400
    vic_lib.global_param.startsec = 0
    vic_lib.global_param.startday = 1
    vic_lib.global_param.startmonth = 1
    vic_lib.global_param.startyear = 2015
    vic_lib.global_param.nrecs = 30

    for calendar in [
            'CALENDAR_STANDARD', 'CALENDAR_GREGORIAN',
            'CALENDAR_PROLEPTIC_GREGORIAN', 'CALENDAR_NOLEAP',
            'CALENDAR_365_DAY', 'CALENDAR_360_DAY', 'CALENDAR_JULIAN',
            'CALENDAR_ALL_LEAP', 'CALENDAR_366_DAY'
    ]:
        vic_lib.global_param.calendar = getattr(vic_lib, calendar)
        dmy = vic_lib.make_dmy(ffi.addressof(vic_lib.global_param))

        assert dmy is not None
        for i in range(vic_lib.global_param.nrecs):
            assert dmy[i].year == 2015
            assert dmy[i].month == 1
            assert dmy[i].day == i + 1
            assert dmy[i].dayseconds == 0
예제 #3
0
def test_print_parameters():
    assert vic_lib.print_parameters(ffi.addressof(vic_lib.param)) is None
예제 #4
0
def test_print_option():
    assert vic_lib.print_option(ffi.addressof(vic_lib.options)) is None
예제 #5
0
def test_print_global_param():
    assert vic_lib.print_global_param(
        ffi.addressof(vic_lib.global_param)) is None
예제 #6
0
def test_print_filep():
    assert vic_lib.print_filep(ffi.addressof(vic_lib.filep)) is None
예제 #7
0
def test_print_filenames():
    assert vic_lib.print_filenames(ffi.addressof(vic_lib.filenames)) is None