示例#1
0
def test_compute_multi_station_nested(config_dict):
    temp = utils.compute_gof(config_dict['config_07'])
    # lrmse return 0 for no difference between the series
    assert (pytest.approx(temp[0], 0.001) == [0.72450915761])
    assert (pytest.approx(temp[1], 0.001) == [0.72542293372])
    assert (pytest.approx(temp[2], 0.001) == [-109.64159579])
    assert (pytest.approx(temp[3], 0.001) == [-108.70622740])
示例#2
0
def test_compute_gof_mo_modify_start(config_02):
    # overwrite the start date from the configuration file
    temp_config = copy.deepcopy(config_02)
    temp_config.evp['start_date'] = '1990-01-11'
    temp = utils.compute_gof(temp_config)
    assert (pytest.approx(temp[0], 0.001) == [0.7343])
    assert (pytest.approx(temp[1], 0.001) == [1.1576])
示例#3
0
def test_compute_multi_station_aggregation(config_dict):
    # test the aggregation results
    temp = utils.compute_gof(config_dict['config_10'])
    # lrmse return 0 for no difference between the series
    assert (pytest.approx(temp[0], 0.001) == [69.3])
    assert (pytest.approx(temp[1], 0.001) == [-15.027036744])
    assert (pytest.approx(temp[2], 0.001) == [115.5])
    assert (pytest.approx(temp[3], 0.001) == [-14.069738052])
示例#4
0
def test_compute_gof(config_01):
    # overwrite the start date from the configuration file
    config_01.evp['start_date'] = '1990-01-01'
    temp = utils.compute_gof(config_01)
    assert (temp == [[0.72450915761519752], [1.2196478869306084]])
示例#5
0
def test_compute_gof_fail(config_01):
    temp = utils.compute_gof(config_01)
    assert (temp == [[0.72450915761519752], [1.2196478869306084]])
示例#6
0
def test_window_ts_no_overlap(config_03):
    config_03.evp['end_date'] = '1990-01-05'
    with pytest.raises(SystemExit):
        utils.compute_gof(config_03)
示例#7
0
def test_compute_no_error_nested(config_04):
    temp = utils.compute_gof(config_04)
    # lrmse return 0 for no difference between the series
    assert (temp[0] == [0.0])
    assert (temp[1] == [0.0])
    assert (temp[2] == [0.0])
示例#8
0
def test_compute_no_error(config_03):
    temp = utils.compute_gof(config_03)
    # lrmse return 0 for no difference between the series
    assert (temp[0] == [0.0, 0.0, 0.0])
    assert (np.isnan(temp[1]))
示例#9
0
def test_compute_gof_mo(config_02):
    temp = utils.compute_gof(config_02)
    assert (pytest.approx(temp[0], 0.001) == [0.7245])
    assert (pytest.approx(temp[1], 0.001) == [1.2196])
    assert (pytest.approx(temp[2], 0.001) == [1.6799])
    assert (pytest.approx(temp[3], 0.001) == [13.17])