コード例 #1
0
def test_prepare_inputs_from_poa(sapm_dc_snl_ac_system, location, weather,
                                 total_irrad):
    data = weather.copy()
    data[['poa_global', 'poa_diffuse', 'poa_direct']] = total_irrad
    mc = ModelChain(sapm_dc_snl_ac_system, location)
    mc.prepare_inputs_from_poa(data)
    # weather attribute
    assert_frame_equal(mc.weather, weather)
    # total_irrad attribute
    assert_frame_equal(mc.total_irrad, total_irrad)
コード例 #2
0
def test_prepare_inputs_from_poa(sapm_dc_snl_ac_system, location,
                                 weather, total_irrad):
    data = pd.concat([weather, total_irrad], axis=1)
    mc = ModelChain(sapm_dc_snl_ac_system, location)
    mc.prepare_inputs_from_poa(data)
    weather_expected = weather.copy()
    weather_expected['temp_air'] = 20
    weather_expected['wind_speed'] = 0
    # order as expected
    weather_expected = weather_expected[
        ['ghi', 'dhi', 'dni', 'wind_speed', 'temp_air']]
    # weather attribute
    assert_frame_equal(mc.weather, weather_expected)
    # total_irrad attribute
    assert_frame_equal(mc.total_irrad, total_irrad)