Exemple #1
0
def test_wps_climdex_dtr_err(climdex_input, freq):
    with NamedTemporaryFile(suffix=".rda",
                            prefix="output_",
                            dir="/tmp",
                            delete=True) as out_file:
        datainputs = build_params(climdex_input, freq, out_file.name)
        process_err_test(ClimdexDTR, datainputs)
def test_wps_climdexInput_csv_column_err(
    tmax_file_content,
    tmin_file_content,
    prec_file_content,
    tmax_column,
    tmin_column,
    prec_column,
    base_range,
    vector_name,
):
    with NamedTemporaryFile(suffix=".rda",
                            prefix="output_",
                            dir="/tmp",
                            delete=True) as out_file:
        datainputs = build_params(
            tmax_file_content,
            tmin_file_content,
            prec_file_content,
            tmax_column,
            tmin_column,
            prec_column,
            base_range,
            vector_name,
            out_file.name,
        )
        process_err_test(ClimdexInputCSV, datainputs)
Exemple #3
0
def test_wps_climdexInput_raw_err(
    tmax_file,
    tmin_file,
    prec_file,
    tmax_name,
    tmin_name,
    prec_name,
    tmax_column,
    tmin_column,
    prec_column,
    base_range,
    vector_name,
):
    with NamedTemporaryFile(
        suffix=".rda", prefix="output_", dir="/tmp", delete=True
    ) as out_file:
        datainputs = (
            f"tmax_file=@xlink:href={tmax_file};"
            f"tmin_file=@xlink:href={tmin_file};"
            f"prec_file=@xlink:href={prec_file};"
            f"tmax_name={tmax_name};"
            f"tmin_name={tmin_name};"
            f"prec_name={prec_name};"
            f"tmax_column={tmax_column};"
            f"tmin_column={tmin_column};"
            f"prec_column={prec_column};"
            f"base_range={base_range};"
            f"out_file={out_file.name};"
            f"vector_name={vector_name};"
        )
        process_err_test(ClimdexInputRaw, datainputs)
Exemple #4
0
def test_parse_string_err(rules, parse_tree, variables):
    datainputs = (
        f"{build_rule_input(rules)}"
        f"parse_tree=@xlink:href={parse_tree};"
        f"variables=@xlink:href={variables};"
    )
    process_err_test(EvaluateRule, datainputs)
Exemple #5
0
def test_wps_climdex_spells_err(climdex_input, func, span_years):
    with NamedTemporaryFile(suffix=".rda",
                            prefix="output_",
                            dir="/tmp",
                            delete=True) as out_file:
        datainputs = build_params(climdex_input, func, span_years,
                                  out_file.name)
        process_err_test(ClimdexSpells, datainputs)
def test_wps_get_available_indices_ci_err(climdex_input, ci_name):
    with NamedTemporaryFile(suffix=".rda",
                            prefix="output_",
                            dir="/tmp",
                            delete=True) as out_file:
        datainputs = (f"climdex_input=@xlink:href={climdex_input};"
                      f"ci_name={ci_name};"
                      f"output_file={out_file.name};")
        process_err_test(GetIndices, datainputs)
Exemple #7
0
def test_file_err(rules, parse_tree):
    with NamedTemporaryFile(
        suffix=".json", prefix="tmp_copy", dir="/tmp", delete=True
    ) as var_file:
        datainputs = (
            f"{build_rule_input(rules)}"
            f"parse_tree=@xlink:href={parse_tree};"
            f"variables={var_file.name};"
        )
        process_err_test(EvaluateRule, datainputs)
def test_wps_climdex_quantile_vector_err(data_file, data_vector,
                                         quantiles_vector, vector_name):
    with NamedTemporaryFile(suffix=".rda",
                            prefix="output_",
                            dir="/tmp",
                            delete=True) as out_file:
        datainputs = build_params(
            data_file,
            data_vector,
            quantiles_vector,
            vector_name,
            out_file.name,
        )
        process_err_test(ClimdexQuantile, datainputs)
Exemple #9
0
def test_wps_gen_climos_input_check(netcdf, kwargs):
    params = build_params(netcdf, kwargs)
    process_err_test(GenerateClimos, params)
Exemple #10
0
def test_wps_parser_err(conditions):
    datainput = build_condition_input(conditions)
    process_err_test(Parser, datainput)
Exemple #11
0
def test_source_check(netcdf, kwargs):
    params = build_params(netcdf, kwargs)
    process_err_test(DecomposeFlowVectors, params)
Exemple #12
0
def test_wps_climdex_rmm_err(climdex_input, threshold):
    with NamedTemporaryFile(
        suffix=".rda", prefix="output_", dir="/tmp", delete=True
    ) as out_file:
        datainputs = build_params(climdex_input, threshold, out_file.name)
        process_err_test(ClimdexRMM, datainputs)