コード例 #1
0
ファイル: consumption.py プロジェクト: cathydeng/eemeter
def generated_consumption_history_pre_post_1(request):
    model = TemperatureSensitivityModel(cooling=True,heating=True)
    pre_params = {
        "base_consumption": request.param[0][0],
        "heating_slope": request.param[0][1],
        "heating_reference_temperature": request.param[0][2],
        "cooling_slope": request.param[0][3],
        "cooling_reference_temperature": request.param[0][4]
    }
    post_params = {
        "base_consumption": request.param[1][0],
        "heating_slope": request.param[1][1],
        "heating_reference_temperature": request.param[1][2],
        "cooling_slope": request.param[1][3],
        "cooling_reference_temperature": request.param[1][4]
    }
    start = datetime(2012,1,1)
    retrofit = datetime(2013,6,15)
    end = datetime(2014,12,31)
    pre_periods = generate_periods(start,retrofit,jitter_intensity=0)
    post_periods = generate_periods(retrofit,end,jitter_intensity=0)
    pre_gen = ConsumptionGenerator("electricity", "kWh", "degF", model, pre_params)
    post_gen = ConsumptionGenerator("electricity", "kWh", "degF", model, post_params)
    pre_consumptions = pre_gen.generate(gsod_722880_2012_2014_weather_source(), pre_periods)
    post_consumptions = post_gen.generate(gsod_722880_2012_2014_weather_source(), post_periods)
    ch = ConsumptionHistory(pre_consumptions + post_consumptions)
    return ch, model.param_dict_to_list(pre_params), model.param_dict_to_list(post_params), retrofit
コード例 #2
0
ファイル: test_meter_prism.py プロジェクト: cathydeng/eemeter
def prism_outputs_1(request):
    model = TemperatureSensitivityModel(cooling=True,heating=True)
    params = {
        "base_consumption": request.param[0][0],
        "heating_slope": request.param[0][1],
        "heating_reference_temperature": request.param[0][2],
        "cooling_slope": request.param[0][3],
        "cooling_reference_temperature": request.param[0][4]
    }
    start = datetime(2012,1,1)
    end = datetime(2014,12,31)
    retrofit_start_date = datetime(2013,6,1)
    retrofit_completion_date = datetime(2013,8,1)

    periods = generate_periods(start,end,jitter_intensity=0)
    gen = ConsumptionGenerator("electricity", "kWh", request.param[4], model, params)
    consumptions = gen.generate(gsod_722880_2012_2014_weather_source(), periods)
    consumption_kWh_per_day = [c.kWh / c.timedelta.days for c in consumptions]
    consumption_n_days = [p.timedelta.days for p in periods]
    fixture = ConsumptionHistory(consumptions), model.param_dict_to_list(params), \
            request.param[1], request.param[2], \
            request.param[3], request.param[4], \
            retrofit_start_date, retrofit_completion_date, \
            request.param[5], request.param[6], \
            request.param[7], request.param[8], \
            request.param[9], request.param[10], \
            consumption_kWh_per_day, consumption_kWh_per_day, \
            consumption_n_days, \
            request.param[11]
    return fixture
コード例 #3
0
def bpi_2400_1(request):
    elec_params = {
        "base_consumption": request.param[0][0],
        "heating_slope": request.param[0][1],
        "heating_reference_temperature": request.param[0][2],
        "cooling_slope": request.param[0][3],
        "cooling_reference_temperature": request.param[0][4]
    }
    gas_params = {
        "base_consumption": request.param[1][0],
        "heating_slope": request.param[1][1],
        "heating_reference_temperature": request.param[1][2],
    }

    normal_cdd = request.param[2]
    normal_hdd = request.param[3]
    cvrmse_electricity = request.param[4]
    cvrmse_natural_gas = request.param[5]
    n_periods = request.param[6]
    time_span = request.param[7]
    total_cdd = request.param[8]
    total_hdd = request.param[9]
    temp_unit = request.param[10]

    start = datetime(2012,1,1)
    end = datetime(2014,12,31)
    periods = generate_periods(start,end,jitter_intensity=0)
    elec_model = TemperatureSensitivityModel(cooling=True,heating=True)
    gas_model = TemperatureSensitivityModel(cooling=False,heating=True)
    gen_elec = ConsumptionGenerator("electricity", "kWh", temp_unit, elec_model, elec_params)
    gen_gas = ConsumptionGenerator("natural_gas", "therms", temp_unit, gas_model, gas_params)
    elec_consumptions = gen_elec.generate(gsod_722880_2012_2014_weather_source(), periods)
    gas_consumptions = gen_gas.generate(gsod_722880_2012_2014_weather_source(), periods)
    ch = ConsumptionHistory(elec_consumptions + gas_consumptions)

    elec_param_list = elec_model.param_dict_to_list(elec_params)
    gas_param_list = gas_model.param_dict_to_list(gas_params)

    average_daily_usages_elec = [c.kWh/c.timedelta.days for c in elec_consumptions]
    average_daily_usages_gas = [c.therms/c.timedelta.days for c in gas_consumptions]


    return ch, elec_param_list, gas_param_list, normal_cdd, normal_hdd, \
            cvrmse_electricity, cvrmse_natural_gas, \
            n_periods, time_span, total_cdd, total_hdd, temp_unit, \
            average_daily_usages_elec, average_daily_usages_gas
コード例 #4
0
ファイル: consumption.py プロジェクト: cathydeng/eemeter
def generated_consumption_history_with_annualized_usage_1(request):
    model = TemperatureSensitivityModel(cooling=True,heating=True)
    params = {
        "base_consumption": request.param[0][0],
        "heating_slope": request.param[0][1],
        "heating_reference_temperature": request.param[0][2],
        "cooling_slope": request.param[0][3],
        "cooling_reference_temperature": request.param[0][4]
    }
    start = datetime(2012,1,1)
    end = datetime(2014,12,31)
    periods = generate_periods(start,end,jitter_intensity=0)
    gen = ConsumptionGenerator("electricity", "kWh", "degF", model, params)
    consumptions = gen.generate(gsod_722880_2012_2014_weather_source(), periods)
    return ConsumptionHistory(consumptions), model.param_dict_to_list(params), request.param[1]
コード例 #5
0
ファイル: consumption.py プロジェクト: cathydeng/eemeter
def time_span_1(request):
    model = TemperatureSensitivityModel(cooling=True,heating=True)
    params = {
        "base_consumption": request.param[0][0],
        "heating_slope": request.param[0][1],
        "heating_reference_temperature": request.param[0][2],
        "cooling_slope": request.param[0][3],
        "cooling_reference_temperature": request.param[0][4]
    }
    fuel_type = request.param[1]
    start, end = request.param[2]
    n_days = request.param[3]
    periods = generate_periods(start,end,jitter_intensity=0)
    gen = ConsumptionGenerator(fuel_type, "kWh", "degF", model, params)
    consumptions = gen.generate(gsod_722880_2012_2014_weather_source(), periods)
    param_list = model.param_dict_to_list(params)
    return ConsumptionHistory(consumptions), fuel_type, n_days