import pytest
from numpy import nan

@pytest.fixture(scope="session")
def metrics_type_1_data():
    data = \
[{'_daily_mean_core_day_demand_baseline_baseline_percentile': 9.990613,
  '_daily_mean_core_day_demand_baseline_baseline_regional': 7.141024,
  'alpha': 44.177776,
  'avoided_daily_mean_core_day_runtime_baseline_percentile': 194.447522,
  'avoided_daily_mean_core_day_runtime_baseline_regional': 68.559025,
  'avoided_total_core_day_runtime_baseline_percentile': 57556.466542,
  'avoided_total_core_day_runtime_baseline_regional': 20293.471271,
  'baseline_daily_mean_core_day_runtime_baseline_percentile': 441.363063,
  'baseline_daily_mean_core_day_runtime_baseline_regional': 315.474565,
  'baseline_percentile_core_cooling_comfort_temperature': 69.5,
  'baseline_total_core_day_runtime_baseline_percentile': 130643.466542,
  'baseline_total_core_day_runtime_baseline_regional': 93380.471271,
  'climate_zone': 'Mixed-Humid',
  'cool_stage': '',
  'cool_type': 'heat_pump',
  'core_cooling_days_mean_indoor_temperature': 73.95971753003002,
  'core_cooling_days_mean_outdoor_temperature': 79.8426321875,
  'core_mean_indoor_temperature': 73.95971753003002,
  'core_mean_outdoor_temperature': 79.8426321875,
  'ct_identifier': '8465829e-df0d-449e-97bf-96317c24dec3',
  'cv_root_mean_sq_err': 0.07887381236030344,
  'daily_mean_core_cooling_runtime': 246.91554054054055,
  'end_date': '2014-12-31T00:00:00',
  'heat_stage': 'single_stage',
  'heat_type': 'heat_pump_electric_backup',
  'heating_or_cooling': 'cooling_ALL',
  'mean_abs_err': 12.08287,
  'mean_abs_pct_err': 0.048935,
  'mean_demand': 5.614707,
  'mean_sq_err': 377.620819,
  'n_core_cooling_days': 296,
  'n_days_both_heating_and_cooling': 212,
  'n_days_in_inputfile_date_range': 1460,
  'n_days_insufficient_data': 13,
  'percent_savings_baseline_percentile': 44.056138,
  'percent_savings_baseline_regional': 21.732029,
  'regional_average_baseline_cooling_comfort_temperature': 73.0,
  'root_mean_sq_err': 19.432468,
  'start_date': '2011-01-01T00:00:00',
  'station': '725314',
  'sw_version': '2.0.0a8',
  'tau': -0.8,
  'total_core_cooling_runtime': 73087.0},
 {'_daily_mean_core_day_demand_baseline_baseline_percentile': 27.379637,
  '_daily_mean_core_day_demand_baseline_baseline_regional': 26.846875,
  'alpha': 31.694594789454573,
  'avoided_daily_mean_core_day_runtime_baseline_percentile': 94.432505,
  'avoided_daily_mean_core_day_runtime_baseline_regional': 77.557134,
  'avoided_total_core_day_runtime_baseline_percentile': 84233.794048,
  'avoided_total_core_day_runtime_baseline_regional': 69180.963615,
  'baseline_daily_mean_core_day_runtime_baseline_percentile': 867.256496,
  'baseline_daily_mean_core_day_runtime_baseline_regional': 850.381125,
  'baseline_percentile_core_heating_comfort_temperature': 69.54999999999988,
  'baseline_total_core_day_runtime_baseline_percentile': 773592.794048,
  'baseline_total_core_day_runtime_baseline_regional': 758539.963615,
  'climate_zone': 'Mixed-Humid',
  'cool_stage': '',
  'cool_type': 'heat_pump',
  'core_heating_days_mean_indoor_temperature': 66.69791666666667,
  'core_heating_days_mean_outdoor_temperature': 44.69122160033633,
  'core_mean_indoor_temperature': 66.69791666666667,
  'core_mean_outdoor_temperature': 44.69122160033633,
  'ct_identifier': '8465829e-df0d-449e-97bf-96317c24dec3',
  'cv_root_mean_sq_err': 0.10753222979305962,
  'daily_mean_core_heating_runtime': 772.8239910313902,
  'end_date': '2014-12-31T00:00:00',
  'heat_stage': 'single_stage',
  'heat_type': 'heat_pump_electric_backup',
  'heating_or_cooling': 'heating_ALL',
  'mean_abs_err': 55.66503659236822,
  'mean_abs_pct_err': 0.07202809079215974,
  'mean_demand': 24.431861,
  'mean_sq_err': 6906.189550425122,
  'n_core_heating_days': 892,
  'n_days_both_heating_and_cooling': 212,
  'n_days_in_inputfile_date_range': 1460,
  'n_days_insufficient_data': 13,
  'percent_savings_baseline_percentile': 10.888648,
  'percent_savings_baseline_regional': 9.120279,
  'regional_average_baseline_heating_comfort_temperature': 69.0,
  'rhu1_00F_to_05F': nan,
  'rhu1_05F_to_10F': 0.35810185185185184,
  'rhu1_10F_to_15F': 0.36336805555555557,
  'rhu1_15F_to_20F': 0.37900691389063484,
  'rhu1_20F_to_25F': 0.375673443706005,
  'rhu1_25F_to_30F': 0.3318400322150354,
  'rhu1_30F_to_35F': 0.28432496802364043,
  'rhu1_30F_to_45F': 0.22154695797667256,
  'rhu1_35F_to_40F': 0.1974189826660588,
  'rhu1_40F_to_45F': 0.15271363589013506,
  'rhu1_45F_to_50F': 0.09249776186213071,
  'rhu1_50F_to_55F': 0.052322643343051506,
  'rhu1_55F_to_60F': 0.028319891645631964,
  'rhu2_00F_to_05F': nan,
  'rhu2_05F_to_10F': 0.35810185185185184,
  'rhu2_10F_to_15F': 0.36336805555555557,
  'rhu2_15F_to_20F': 0.37900691389063484,
  'rhu2_20F_to_25F': 0.375673443706005,
  'rhu2_25F_to_30F': 0.3318400322150354,
  'rhu2_30F_to_35F': 0.28432496802364043,
  'rhu2_30F_to_45F': 0.22154695797667256,
  'rhu2_35F_to_40F': 0.1974189826660588,
  'rhu2_40F_to_45F': 0.15271363589013506,
  'rhu2_45F_to_50F': 0.09249776186213071,
  'rhu2_50F_to_55F': 0.052322643343051506,
  'rhu2_55F_to_60F': 0.028319891645631964,
  'root_mean_sq_err': 83.1034869931769,
  'start_date': '2011-01-01T00:00:00',
  'station': '725314',
  'sw_version': '2.0.0a8',
  'tau': -2.4,
  'total_auxiliary_heating_core_day_runtime': 144238.0,
  'total_core_heating_runtime': 689359.0,
  'total_emergency_heating_core_day_runtime': 2104.0}]

    return data


@pytest.fixture(scope="session")
def metrics_hpeb_2_hp_2_data():
    data = \
[{'_daily_mean_core_day_demand_baseline_baseline_percentile': 12.674969,
  '_daily_mean_core_day_demand_baseline_baseline_regional': 10.628069,
  'alpha': 28.403159,
  'avoided_daily_mean_core_day_runtime_baseline_percentile': 31.459415,
  'avoided_daily_mean_core_day_runtime_baseline_regional': -26.678997,
  'avoided_total_core_day_runtime_baseline_percentile': 5568.316517,
  'avoided_total_core_day_runtime_baseline_regional': -4722.182514,
  'baseline_daily_mean_core_day_runtime_baseline_percentile': 360.009144,
  'baseline_daily_mean_core_day_runtime_baseline_regional': 301.870732,
  'baseline_percentile_core_cooling_comfort_temperature': 70.8,
  'baseline_total_core_day_runtime_baseline_percentile': 63721.618517,
  'baseline_total_core_day_runtime_baseline_regional': 53431.119486,
  'climate_zone': 'Mixed-Humid',
  'cool_stage': 'two_stage',
  'cool_type': 'heat_pump',
  'core_cooling_days_mean_indoor_temperature': 71.87485875706216,
  'core_cooling_days_mean_outdoor_temperature': 74.53503144067797,
  'core_mean_indoor_temperature': 71.87485875706216,
  'core_mean_outdoor_temperature': 74.53503144067797,
  'ct_identifier': 'c61badb0e0c0a7e06932de804af43111',
  'cv_root_mean_sq_err': 0.16357602780022015,
  'daily_mean_core_cooling_runtime': 328.5497288135593,
  'end_date': '2018-12-31T00:00:00',
  'heat_stage': 'two_stage',
  'heat_type': 'heat_pump_electric_backup',
  'heating_or_cooling': 'cooling_ALL',
  'mean_abs_err': 40.78334959625454,
  'mean_abs_pct_err': 0.12413143588195652,
  'mean_demand': 11.602206,
  'mean_sq_err': 2888.294955208049,
  'n_core_cooling_days': 177,
  'n_days_both_heating_and_cooling': 19,
  'n_days_in_inputfile_date_range': 364,
  'n_days_insufficient_data': 14,
  'percent_savings_baseline_percentile': 8.738505,
  'percent_savings_baseline_regional': -8.837888,
  'regional_average_baseline_cooling_comfort_temperature': 73.0,
  'root_mean_sq_err': 53.742859574161564,
  'start_date': '2018-01-01T00:00:00',
  'station': '723170',
  'sw_version': '2.0.0a8',
  'tau': 8.7,
  'total_core_cooling_runtime': 58153.301999999996},
 {'_daily_mean_core_day_demand_baseline_baseline_percentile': 14.667208,
  '_daily_mean_core_day_demand_baseline_baseline_regional': 13.844233,
  'alpha': 24.12888815088287,
  'avoided_daily_mean_core_day_runtime_baseline_percentile': 29.520066,
  'avoided_daily_mean_core_day_runtime_baseline_regional': 9.662756,
  'avoided_total_core_day_runtime_baseline_percentile': 3926.168756,
  'avoided_total_core_day_runtime_baseline_regional': 1285.146584,
  'baseline_daily_mean_core_day_runtime_baseline_percentile': 353.900562,
  'baseline_daily_mean_core_day_runtime_baseline_regional': 334.043253,
  'baseline_percentile_core_heating_comfort_temperature': 69.9,
  'baseline_total_core_day_runtime_baseline_percentile': 47068.774756,
  'baseline_total_core_day_runtime_baseline_regional': 44427.752584,
  'climate_zone': 'Mixed-Humid',
  'cool_stage': 'two_stage',
  'cool_type': 'heat_pump',
  'core_heating_days_mean_indoor_temperature': 68.62462406015037,
  'core_heating_days_mean_outdoor_temperature': 43.35078979323308,
  'core_mean_indoor_temperature': 68.62462406015037,
  'core_mean_outdoor_temperature': 43.35078979323308,
  'ct_identifier': 'c61badb0e0c0a7e06932de804af43111',
  'cv_root_mean_sq_err': 0.2499173059502313,
  'daily_mean_core_heating_runtime': 324.3804962406015,
  'end_date': '2018-12-31T00:00:00',
  'heat_stage': 'two_stage',
  'heat_type': 'heat_pump_electric_backup',
  'heating_or_cooling': 'heating_ALL',
  'mean_abs_err': 62.13151151808365,
  'mean_abs_pct_err': 0.19153898658567647,
  'mean_demand': 13.41565,
  'mean_sq_err': 6572.069220018736,
  'n_core_heating_days': 133,
  'n_days_both_heating_and_cooling': 19,
  'n_days_in_inputfile_date_range': 364,
  'n_days_insufficient_data': 14,
  'percent_savings_baseline_percentile': 8.341345,
  'percent_savings_baseline_regional': 2.892666,
  'regional_average_baseline_heating_comfort_temperature': 69.0,
  'rhu1_00F_to_05F': nan,
  'rhu1_05F_to_10F': nan,
  'rhu1_10F_to_15F': nan,
  'rhu1_15F_to_20F': 0.8938117141436386,
  'rhu1_20F_to_25F': 0.5963729624072203,
  'rhu1_25F_to_30F': 0.11484128153249978,
  'rhu1_30F_to_35F': 0.06079135092511376,
  'rhu1_30F_to_45F': 0.04260111560494782,
  'rhu1_35F_to_40F': 0.037086580256967316,
  'rhu1_40F_to_45F': 0.03371910830246602,
  'rhu1_45F_to_50F': 0.009995474641406795,
  'rhu1_50F_to_55F': 0.0,
  'rhu1_55F_to_60F': 0.012756025498260699,
  'rhu2_00F_to_05F': nan,
  'rhu2_05F_to_10F': nan,
  'rhu2_10F_to_15F': nan,
  'rhu2_15F_to_20F': 0.8938117141436386,
  'rhu2_20F_to_25F': 0.5963729624072203,
  'rhu2_25F_to_30F': nan,
  'rhu2_30F_to_35F': 0.06079135092511376,
  'rhu2_30F_to_45F': 0.04260111560494782,
  'rhu2_35F_to_40F': 0.037086580256967316,
  'rhu2_40F_to_45F': 0.03371910830246602,
  'rhu2_45F_to_50F': 0.009995474641406795,
  'rhu2_50F_to_55F': 0.0,
  'rhu2_55F_to_60F': nan,
  'root_mean_sq_err': 81.06829972325025,
  'start_date': '2018-01-01T00:00:00',
  'station': '723170',
  'sw_version': '2.0.0a8',
  'tau': 12.2,
  'total_auxiliary_heating_core_day_runtime': 1921.2,
  'total_core_heating_runtime': 43142.606,
  'total_emergency_heating_core_day_runtime': 110.0}]

    return data


@pytest.fixture(scope="session")
def metrics_ert_hpeb_2_hp_2_data():
    data = \
[{'_daily_mean_core_day_demand_baseline_baseline_percentile': 12.25281033824587,
  '_daily_mean_core_day_demand_baseline_baseline_regional': 10.312943007859884,
  'alpha': 27.667712,
  'avoided_daily_mean_core_day_runtime_baseline_percentile': 27.561512,
  'avoided_daily_mean_core_day_runtime_baseline_regional': -26.099438,
  'avoided_total_core_day_runtime_baseline_percentile': 4850.826165,
  'avoided_total_core_day_runtime_baseline_regional': -4593.501151,
  'baseline_daily_mean_core_day_runtime_baseline_percentile': 338.741058,
  'baseline_daily_mean_core_day_runtime_baseline_regional': 285.080107,
  'baseline_percentile_core_cooling_comfort_temperature': 70.9,
  'baseline_total_core_day_runtime_baseline_percentile': 59618.426165,
  'baseline_total_core_day_runtime_baseline_regional': 50174.098849,
  'climate_zone': 'Mixed-Humid',
  'cool_stage': 'two_stage',
  'cool_type': 'heat_pump',
  'core_cooling_days_mean_indoor_temperature': 71.88806818181817,
  'core_cooling_days_mean_outdoor_temperature': 74.60005241477273,
  'core_mean_indoor_temperature': 71.88806818181817,
  'core_mean_outdoor_temperature': 74.60005241477273,
  'ct_identifier': 'c61badb0e0c0a7e06932de804af43111',
  'cv_root_mean_sq_err': 0.16788677782925684,
  'daily_mean_core_cooling_runtime': 311.17954545454546,
  'end_date': '2018-12-31T00:00:00',
  'heat_stage': 'two_stage',
  'heat_type': 'heat_pump_electric_backup',
  'heating_or_cooling': 'cooling_ALL',
  'mean_abs_err': 39.55504086253661,
  'mean_abs_pct_err': 0.12711324198625543,
  'mean_demand': 11.27112244288543,
  'mean_sq_err': 2729.323861698708,
  'n_core_cooling_days': 176,
  'n_days_both_heating_and_cooling': 19,
  'n_days_in_inputfile_date_range': 364,
  'n_days_insufficient_data': 14,
  'percent_savings_baseline_percentile': 8.136455,
  'percent_savings_baseline_regional': -9.155124,
  'regional_average_baseline_cooling_comfort_temperature': 73.0,
  'root_mean_sq_err': 52.24293121273641,
  'start_date': '2018-01-01T00:00:00',
  'station': '723170',
  'sw_version': '2.0.0a8',
  'tau': 8.3,
  'total_core_cooling_runtime': 54767.6},
 {'_daily_mean_core_day_demand_baseline_baseline_percentile': 14.025969,
  '_daily_mean_core_day_demand_baseline_baseline_regional': 13.211491,
  'alpha': 23.730080239253436,
  'avoided_daily_mean_core_day_runtime_baseline_percentile': 28.649475,
  'avoided_daily_mean_core_day_runtime_baseline_regional': 9.30713,
  'avoided_total_core_day_runtime_baseline_percentile': 3810.380188,
  'avoided_total_core_day_runtime_baseline_regional': 1237.848288,
  'baseline_daily_mean_core_day_runtime_baseline_percentile': 333.090828,
  'baseline_daily_mean_core_day_runtime_baseline_regional': 313.748483,
  'baseline_percentile_core_heating_comfort_temperature': 69.9,
  'baseline_total_core_day_runtime_baseline_percentile': 44301.080188,
  'baseline_total_core_day_runtime_baseline_regional': 41728.548288,
  'climate_zone': 'Mixed-Humid',
  'cool_stage': 'two_stage',
  'cool_type': 'heat_pump',
  'core_heating_days_mean_indoor_temperature': 68.62462406015037,
  'core_heating_days_mean_outdoor_temperature': 43.35078979323308,
  'core_mean_indoor_temperature': 68.62462406015037,
  'core_mean_outdoor_temperature': 43.35078979323308,
  'ct_identifier': 'c61badb0e0c0a7e06932de804af43111',
  'cv_root_mean_sq_err': 0.258345382172041,
  'daily_mean_core_heating_runtime': 304.44135338345876,
  'end_date': '2018-12-31T00:00:00',
  'heat_stage': 'two_stage',
  'heat_type': 'heat_pump_electric_backup',
  'heating_or_cooling': 'heating_ALL',
  'mean_abs_err': 60.50847476858618,
  'mean_abs_pct_err': 0.1987524825261593,
  'mean_demand': 12.778177,
  'mean_sq_err': 6185.982599217759,
  'n_core_heating_days': 133,
  'n_days_both_heating_and_cooling': 19,
  'n_days_in_inputfile_date_range': 364,
  'n_days_insufficient_data': 14,
  'percent_savings_baseline_percentile': 8.6011,
  'percent_savings_baseline_regional': 2.96643,
  'regional_average_baseline_heating_comfort_temperature': 69.0,
  'rhu1_00F_to_05F': nan,
  'rhu1_05F_to_10F': nan,
  'rhu1_10F_to_15F': nan,
  'rhu1_15F_to_20F': 0.8979559976359601,
  'rhu1_20F_to_25F': 0.6045587903407809,
  'rhu1_25F_to_30F': 0.12034338820193748,
  'rhu1_30F_to_35F': 0.06371785003148996,
  'rhu1_30F_to_45F': 0.04516069332278556,
  'rhu1_35F_to_40F': 0.03934310540012056,
  'rhu1_40F_to_45F': 0.03605074276325836,
  'rhu1_45F_to_50F': 0.010863180256371055,
  'rhu1_50F_to_55F': 0.0,
  'rhu1_55F_to_60F': 0.013987335790568002,
  'rhu2_00F_to_05F': nan,
  'rhu2_05F_to_10F': nan,
  'rhu2_10F_to_15F': nan,
  'rhu2_15F_to_20F': 0.8979559976359601,
  'rhu2_20F_to_25F': 0.6045587903407809,
  'rhu2_25F_to_30F': nan,
  'rhu2_30F_to_35F': 0.06371785003148996,
  'rhu2_30F_to_45F': 0.04516069332278556,
  'rhu2_35F_to_40F': 0.03934310540012056,
  'rhu2_40F_to_45F': 0.03605074276325836,
  'rhu2_45F_to_50F': 0.010863180256371055,
  'rhu2_50F_to_55F': 0.0,
  'rhu2_55F_to_60F': nan,
  'root_mean_sq_err': 78.65101778882304,
  'start_date': '2018-01-01T00:00:00',
  'station': '723170',
  'sw_version': '2.0.0a8',
  'tau': 12.9,
  'total_auxiliary_heating_core_day_runtime': 1921.2,
  'total_core_heating_runtime': 40490.70000000001,
  'total_emergency_heating_core_day_runtime': 110.0}]

    return data

