Example #1
0
def test_dakota_direction_quadrature():
    n = 5
    method_dict = get_method_dict()
    method_dict = add_distribution(method_dict)

    jsonfile = open('tests/record_test_dakota_direction_quadrature.json','r')
    baseline = json.load(jsonfile)
    jsonfile.close()
    mean, std, N, winddirections, windspeeds, power, \
        winddirections_approx, windspeeds_approx, power_approx \
            = run(method_dict, n)
    obj = {'mean': [mean], 'std': [std], 'samples': [N], 'winddirections': winddirections.tolist(),
           'windspeeds': windspeeds.tolist(), 'power': power.tolist(),
           'method': method_dict['method'], 'uncertain_variable': method_dict['uncertain_var'],
           'layout': method_dict['layout']}
    test = obj
    assertions(test, baseline)