예제 #1
0
def test_n_periods_meeting_cdd_per_day_threshold(
    generated_consumption_data_with_n_periods_cdd_1, gsod_722880_2012_2014_weather_source
):
    cd, n_periods_lt, n_periods_gt, cdd = generated_consumption_data_with_n_periods_cdd_1
    meter_lt = NPeriodsMeetingCDDPerDayThreshold(base=65, temperature_unit_str="degF", operation="<")
    meter_gt = NPeriodsMeetingCDDPerDayThreshold(base=65, temperature_unit_str="degF", operation=">")
    result_lt = meter_lt.evaluate_raw(consumption_data=cd, cdd=cdd, weather_source=gsod_722880_2012_2014_weather_source)
    result_gt = meter_gt.evaluate_raw(consumption_data=cd, cdd=cdd, weather_source=gsod_722880_2012_2014_weather_source)
    assert n_periods_lt == result_lt["n_periods"]
    assert n_periods_gt == result_gt["n_periods"]
예제 #2
0
def test_n_periods_meeting_cdd_per_day_threshold(generated_consumption_history_with_n_periods_cdd_1,gsod_722880_2012_2014_weather_source):
    ch, fuel_type, n_periods_lt, n_periods_gt, cdd = generated_consumption_history_with_n_periods_cdd_1
    meter_lt = NPeriodsMeetingCDDPerDayThreshold(base=65,temperature_unit_str="degF",operation="lt")
    meter_gt = NPeriodsMeetingCDDPerDayThreshold(base=65,temperature_unit_str="degF",operation="gt")
    result_lt = meter_lt.evaluate(consumption_history=ch,
                            cdd=cdd,
                            fuel_type=fuel_type,
                            weather_source=gsod_722880_2012_2014_weather_source)
    result_gt = meter_gt.evaluate(consumption_history=ch,
                            cdd=cdd,
                            fuel_type=fuel_type,
                            weather_source=gsod_722880_2012_2014_weather_source)
    assert n_periods_lt == result_lt["n_periods"]
    assert n_periods_gt == result_gt["n_periods"]
예제 #3
0
def test_n_periods_meeting_cdd_per_day_threshold(generated_consumption_data_with_n_periods_cdd_1,gsod_722880_2012_2014_weather_source):
    cd, n_periods_lt, n_periods_gt, cdd = generated_consumption_data_with_n_periods_cdd_1
    meter_lt = NPeriodsMeetingCDDPerDayThreshold(base=65,temperature_unit_str="degF",operation="<")
    meter_gt = NPeriodsMeetingCDDPerDayThreshold(base=65,temperature_unit_str="degF",operation=">")
    result_lt = meter_lt.evaluate_raw(consumption_data=cd,
                            cdd=cdd,
                            weather_source=gsod_722880_2012_2014_weather_source)
    result_gt = meter_gt.evaluate_raw(consumption_data=cd,
                            cdd=cdd,
                            weather_source=gsod_722880_2012_2014_weather_source)
    assert n_periods_lt == result_lt["n_periods"]
    assert n_periods_gt == result_gt["n_periods"]