diff --git a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/cowen/Heat Load Analysis Beta 7.xlsx b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/cowen/Heat Load Analysis Beta 7.xlsx new file mode 100644 index 00000000..946aa3d3 Binary files /dev/null and b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/cowen/Heat Load Analysis Beta 7.xlsx differ diff --git a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/cowen/fuel-oil.csv b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/cowen/fuel-oil.csv deleted file mode 100644 index de42e6ce..00000000 --- a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/cowen/fuel-oil.csv +++ /dev/null @@ -1,5 +0,0 @@ -start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_58f,hdd_at_60f,hdd_at_62f,ua_at_58f,ua_at_60f,ua_at_62f,ua_sensitivity_at_0.1_gal,ua_sensitivity_at_0.1_gal,unused1,estimated_heating_use_therms,estimated_other_use_therms,estimated_total_use_therms,estimated_savings_therms,estimated_savings_percent,unused2,start_row,end_row,,,,, -8/30/2019,12/11/2019,149,104,0,,1.43,1.43,1000.5,1146.2,1306.1, , , , , ,,,,,,,,3166,3269,,0,,,0 -12/12/2019,1/17/2020,105,37,1,,2.84,2.84,829.2,900.6,974.6,589.2,542.5,501.3, , ,,,,,,,,3270,3306,,1,542.5,,1 -1/18/2020,3/21/2020,141,64,1,,2.2,2.2,1394.5,1522.5,1650.5,470.5,430.9,397.5, , ,,,,,,,,3307,3370,,1,430.9,,1 -3/22/2020,6/4/2020,82,75,0,,1.09,1.09,726.8,849.3,980.2, , , , , ,,,,,,,,3371,3445,,0,,,0 \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/cowen/oil-propane.csv b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/cowen/oil-propane.csv new file mode 100644 index 00000000..74ad52ae --- /dev/null +++ b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/cowen/oil-propane.csv @@ -0,0 +1,5 @@ +start_date,end_date,usage,days_in_bill,inclusion_code,inclusion_override,avg_daily_usage,daily_htg_usage,hdd_at_58f,hdd_at_60f,hdd_at_62f,ua_at_58f,ua_at_60f,ua_at_62f,ua_sensitivity_at_-0.1_therms,ua_sensitivity_at_0.1_therms +2019-08-30 00:00:00,2019-12-11 00:00:00,149,104,0,,1.4326923076923077,1.4326923076923077,1000.4999999999998,1146.1999999999998,1306.1,,,,, +2019-12-12 00:00:00,2020-01-17 00:00:00,105,37,1,,2.8378378378378377,2.8378378378378377,829.1999999999999,900.6,974.6,589.2426435118186,542.5272040861647,501.3338805663862,, +2020-01-18 00:00:00,2020-03-21 00:00:00,141,64,1,,2.203125,2.203125,1394.500000000001,1522.5000000000011,1650.5000000000011,470.50555754750775,430.94909688013104,397.52802181157193,, +2020-03-22 00:00:00,2020-06-04 00:00:00,82,75,0,,1.0933333333333333,1.0933333333333333,726.7999999999998,849.2999999999996,980.1999999999997,,,,, diff --git a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/cowen/summary.json b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/cowen/summary.json index 9833f751..10ec3b57 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/cowen/summary.json +++ b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/cowen/summary.json @@ -4,18 +4,18 @@ "living_area": 1205, "fuel_type": "OIL", "heating_system_efficiency": 0.8, - "other_fuel_usage": null, + "other_fuel_usage": 0, "other_fuel_usage_override": null, - "thermostat_set_point": 68.0, + "thermostat_set_point": 68, "setback_temperature": null, "setback_hours_per_day": null, "estimated_balance_point": 60, - "balance_point_sensitivity": 2.0, - "average_indoor_temperature": 68.0, - "difference_between_ti_and_tbp": 8.0, + "balance_point_sensitivity": 2, + "average_indoor_temperature": 68, + "difference_between_ti_and_tbp": 8, "design_temperature": 9.5, - "whole_home_heat_loss_rate": 487, + "whole_home_heat_loss_rate": 487.0, "standard_deviation_of_heat_loss_rate": 0.1146, - "average_heat_load": 25554, - "maximum_heat_load": 29448 + "average_heat_load": 25554.0, + "maximum_heat_load": 29448.0 } \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/gelfand/Heat Load Analysis Beta 7.xlsx b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/gelfand/Heat Load Analysis Beta 7.xlsx new file mode 100644 index 00000000..279e70fc Binary files /dev/null and b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/gelfand/Heat Load Analysis Beta 7.xlsx differ diff --git a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/gelfand/fuel-oil.csv b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/gelfand/fuel-oil.csv deleted file mode 100644 index 6b3b5092..00000000 --- a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/gelfand/fuel-oil.csv +++ /dev/null @@ -1,9 +0,0 @@ -start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_57f,hdd_at_58f,hdd_at_59f,ua_at_57f,ua_at_58f,ua_at_59f,ua_sensitivity_at_0.3_gal,ua_sensitivity_at_0.5_gal,unused1,estimated_heating_use_therms,estimated_other_use_therms,estimated_total_use_therms,estimated_savings_therms,estimated_savings_percent,unused2,start_row,end_row,,,,, -10/2/2019,11/18/2019,191.1,48,0,,3.98,3.58,439.5,481.5,523.5, , , , , ,,,,,,,,3199,3246,,1,1661.3,ERROR,0 -11/19/2019,12/23/2019,154.6,35,1,,4.42,4.02,803.1,838.1,873.1,814.7,780.6,749.4,800.1,761.2,,,,,,,,3247,3281,,1,780.6,,1 -12/24/2019,2/7/2020,197,46,1,,4.28,3.88,1054.1,1098.1,1142.3,788.4,756.8,727.6,776.3,737.3,,,,,,,,3282,3327,,1,756.8,,1 -2/8/2020,3/23/2020,163,45,1,,3.62,3.22,856.4,899.6,943.6,787.9,750,715.1,773.3,726.8,,,,,,,,3328,3372,,1,750,,1 -3/24/2020,5/15/2020,128,53,0,,2.42,2.02,548.3,595.4,644.7, , , , , ,,,,,,,,3373,3425,,0,,,0 -5/16/2020,10/15/2020,66.4,153,0,,0.43,0.03,95.8,119.2,145, , , , , ,,,,,,,,3426,3578,,0,,,0 -10/16/2020,12/7/2020,132.5,53,1,,2.5,2.1,628.8,672,717.8,823.7,770.7,721.5,807.4,734,,,,,,,,3579,3631,,1,770.7,,1 -12/8/2020,1/18/2021,194.2,42,1,,4.62,4.22,1021.3,1063.3,1105.3,808.3,776.4,746.9,794.7,758,,,,,,,,3632,3673,,1,776.4,,1 \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/gelfand/oil-propane.csv b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/gelfand/oil-propane.csv new file mode 100644 index 00000000..7e4b1bff --- /dev/null +++ b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/gelfand/oil-propane.csv @@ -0,0 +1,9 @@ +start_date,end_date,usage,days_in_bill,inclusion_code,inclusion_override,avg_daily_usage,daily_htg_usage,hdd_at_57f,hdd_at_58f,hdd_at_59f,ua_at_57f,ua_at_58f,ua_at_59f,ua_sensitivity_at_0.3_therms,ua_sensitivity_at_0.5_therms +2019-10-02 00:00:00,2019-11-18 00:00:00,191.1,48,0,,3.9812499999999997,3.58125,439.49999999999994,481.49999999999994,523.5000000000001,,,,, +2019-11-19 00:00:00,2019-12-23 00:00:00,154.6,35,1,,4.417142857142857,4.017142857142857,803.1000000000003,838.1000000000003,873.1000000000003,814.6665006433402,780.6451099709659,749.3513534150344,800.0779541025332,761.2122658393985 +2019-12-24 00:00:00,2020-02-07 00:00:00,197,46,1,,4.282608695652174,3.882608695652174,1054.1000000000001,1098.1000000000001,1142.3,788.4312051355026,756.8393892480951,727.5543494120051,776.3324530249217,737.3463254712684 +2020-02-08 00:00:00,2020-03-23 00:00:00,163,45,1,,3.6222222222222222,3.2222222222222223,856.4000000000001,899.6000000000001,943.6,787.8717110384555,750.0370535052615,715.062879751307,773.3140655105972,726.7600414999258 +2020-03-24 00:00:00,2020-05-15 00:00:00,128,53,0,,2.4150943396226414,2.0150943396226415,548.3,595.4,644.6999999999998,,,,, +2020-05-16 00:00:00,2020-10-15 00:00:00,66.4,153,0,,0.4339869281045752,0.033986928104575154,95.79999999999998,119.19999999999999,145,,,,, +2020-10-16 00:00:00,2020-12-07 00:00:00,132.5,53,1,,2.5,2.1,628.8,671.9999999999999,717.7999999999998,823.6577608142495,770.7083333333336,721.5324602953472,807.4087301587305,734.0079365079367 +2020-12-08 00:00:00,2021-01-18 00:00:00,194.2,42,1,,4.623809523809523,4.223809523809523,1021.3000000000001,1063.3,1105.2999999999997,808.2848656940499,776.3578795573528,746.8572634880425,794.7383930530737,757.977366061632 diff --git a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/gelfand/summary.json b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/gelfand/summary.json index 773e17e8..0e5a258c 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/gelfand/summary.json +++ b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/gelfand/summary.json @@ -4,18 +4,18 @@ "living_area": 1500, "fuel_type": "OIL", "heating_system_efficiency": 0.8, - "other_fuel_usage": null, - "other_fuel_usage_override": 0.40, - "thermostat_set_point": 68.0, + "other_fuel_usage": 0, + "other_fuel_usage_override": 0.4, + "thermostat_set_point": 68, "setback_temperature": null, "setback_hours_per_day": null, - "estimated_balance_point": 58.0, - "balance_point_sensitivity": 1.0, - "average_indoor_temperature": 68.0, - "difference_between_ti_and_tbp": 10.0, + "estimated_balance_point": 58, + "balance_point_sensitivity": 1, + "average_indoor_temperature": 68, + "difference_between_ti_and_tbp": 10, "design_temperature": 8.4, - "whole_home_heat_loss_rate": 767, + "whole_home_heat_loss_rate": 767.0, "standard_deviation_of_heat_loss_rate": 0.0152, - "average_heat_load": 39573, - "maximum_heat_load": 47242 + "average_heat_load": 39573.0, + "maximum_heat_load": 47242.0 } \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/harris/Heat Load Analysis Beta 7.xlsx b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/harris/Heat Load Analysis Beta 7.xlsx new file mode 100644 index 00000000..344df521 Binary files /dev/null and b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/harris/Heat Load Analysis Beta 7.xlsx differ diff --git a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/harris/fuel-oil.csv b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/harris/fuel-oil.csv deleted file mode 100644 index 06f23179..00000000 --- a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/harris/fuel-oil.csv +++ /dev/null @@ -1,17 +0,0 @@ -start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_58f,hdd_at_60f,hdd_at_62f,ua_at_58f,ua_at_60f,ua_at_62f,ua_sensitivity_at_0.2_gal,ua_sensitivity_at_0.4_gal,unused1,estimated_heating_use_therms,estimated_other_use_therms,estimated_total_use_therms,estimated_savings_therms,estimated_savings_percent,unused2,start_row,end_row,,,,, -8/9/2018,11/16/2018,137.4,100,0,,1.37,1.07,516.6,614.2,713.9, , , , , ,,,,,,,,2780,2879,,0,,,0 -11/17/2018,12/17/2018,140.8,31,1,,4.54,4.24,752.8,814.8,876.8,812.8,751,697.9,768.7,733.3,,,,,,,,2880,2910,,1,751,,1 -12/18/2018,1/15/2019,123.1,29,1,,4.24,3.94,737.5,795.5,853.5,721.8,669.2,623.7,686.2,652.2,,,,,,,,2911,2939,,1,669.2,,1 -1/16/2019,2/9/2019,133.1,25,1,,5.32,5.02,745.8,795.8,845.8,783.7,734.4,691,749,719.8,,,,,,,,2940,2964,,1,734.4,,1 -2/10/2019,3/12/2019,147.9,31,1,,4.77,4.47,888.8,950.8,1012.8,725.6,678.3,636.8,693.5,663.2,,,,,,,,2965,2995,,1,678.3,,1 -3/13/2019,5/16/2019,135.8,65,0,,2.09,1.79,699.9,818.1,938.9, , , , , ,,,,,,,,2996,3060,,0,,,0 -5/17/2019,11/13/2019,129.7,181,0,,0.72,0.42,375.5,470.8,588.4, , , , , ,,,,,,,,3061,3241,,0,,,0 -11/14/2019,12/17/2019,121,34,1,,3.56,3.26,780.5,848.5,916.5,660.6,607.6,562.6,626.3,589,,,,,,,,3242,3275,,1,607.6,,1 -12/18/2019,1/16/2020,111.5,30,1,,3.72,3.42,679.8,737.4,797.4,701.6,646.8,598.2,665.8,627.9,,,,,,,,3276,3305,,1,646.8,,1 -1/17/2020,2/20/2020,170.6,35,1,,4.87,4.57,952.4,1022.4,1092.4,782.2,728.7,682,744.6,712.7,,,,,,,,3306,3340,,1,728.7,,1 -2/21/2020,3/27/2020,121.3,36,1,,3.37,3.07,608.6,679,751,844.9,757.3,684.7,782,732.6,,,,,,,,3341,3376,,1,757.3,,1 -3/28/2020,6/25/2020,119.1,90,0,,1.32,1.02,559,667.1,783.6, , , , , ,,,,,,,,3377,3466,,0,,,0 -6/26/2020,11/12/2020,111.7,140,0,,0.8,0.5,345.4,426.7,523.3, , , , , ,,,,,,,,3467,3606,,0,,,0 -11/13/2020,12/18/2020,111.5,36,1,,3.1,2.8,724.2,796.2,868.2,647,588.5,539.7,609.6,567.5,,,,,,,,3607,3642,,1,588.5,,1 -12/19/2020,1/14/2021,109.6,27,1,,4.06,3.76,689.7,743.7,797.7,684.8,635.1,592.1,652,618.2,,,,,,,,3643,3669,,1,635.1,,1 -1/15/2021,2/13/2021,113.8,30,0,,3.79,3.49,932.7,992.7,1052.7, , , , , ,,,,,,,,3670,3699,,1,491.3,ERROR,0 \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/harris/oil-propane.csv b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/harris/oil-propane.csv new file mode 100644 index 00000000..74375e03 --- /dev/null +++ b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/harris/oil-propane.csv @@ -0,0 +1,17 @@ +start_date,end_date,usage,days_in_bill,inclusion_code,inclusion_override,avg_daily_usage,daily_htg_usage,hdd_at_58f,hdd_at_60f,hdd_at_62f,ua_at_58f,ua_at_60f,ua_at_62f,ua_sensitivity_at_0.2_therms,ua_sensitivity_at_0.4_therms +2018-08-09 00:00:00,2018-11-16 00:00:00,137.4,100,0,,1.374,1.074,516.6000000000001,614.2000000000002,713.9000000000002,,,,, +2018-11-17 00:00:00,2018-12-17 00:00:00,140.8,31,1,,4.541935483870968,4.241935483870968,752.8,814.8,876.7999999999998,812.8498051718032,750.9981999672723,697.8938564476887,768.7023400425463,733.2940598919982 +2018-12-18 00:00:00,2019-01-15 00:00:00,123.1,29,1,,4.244827586206896,3.9448275862068964,737.4999999999999,795.4999999999999,853.4999999999999,721.818757062147,669.1908652838887,623.7156805311464,686.1546197360152,652.227110831762 +2019-01-16 00:00:00,2019-02-09 00:00:00,133.1,25,1,,5.324,5.024,745.8000000000001,795.8,845.8,783.6667560561366,734.4290860350172,691.0128477969577,749.0474993717015,719.8106726983331 +2019-02-10 00:00:00,2019-03-12 00:00:00,147.9,31,1,,4.770967741935484,4.4709677419354845,888.7999999999998,950.7999999999998,1012.7999999999998,725.643564356436,678.3256205300802,636.8009478672988,693.4974056934514,663.153835366709 +2019-03-13 00:00:00,2019-05-16 00:00:00,135.8,65,0,,2.0892307692307694,1.7892307692307694,699.8999999999999,818.0999999999998,938.8999999999997,,,,, +2019-05-17 00:00:00,2019-11-13 00:00:00,129.7,181,0,,0.716574585635359,0.41657458563535904,375.49999999999994,470.80000000000007,588.4000000000001,,,,, +2019-11-14 00:00:00,2019-12-17 00:00:00,121,34,1,,3.5588235294117645,3.2588235294117647,780.5,848.5,916.5,660.588511637839,607.648006285602,562.5633751591198,626.2942447456295,589.0017678255745 +2019-12-18 00:00:00,2020-01-16 00:00:00,111.5,30,1,,3.716666666666667,3.416666666666667,679.8000000000001,737.4000000000001,797.4000000000001,701.6279297832697,646.8221679775789,598.1523284006354,665.753548503752,627.8907874514058 +2020-01-17 00:00:00,2020-02-20 00:00:00,170.6,35,1,,4.8742857142857146,4.574285714285715,952.4000000000002,1022.4000000000003,1092.4,782.2329553408931,728.6763171622326,681.9834004638107,744.6061554512257,712.7464788732394 +2020-02-21 00:00:00,2020-03-27 00:00:00,121.3,36,1,,3.3694444444444445,3.0694444444444446,608.5999999999999,679,750.9999999999999,844.8789571694601,757.2803141875307,684.6782068353308,781.9518900343643,732.6087383406972 +2020-03-28 00:00:00,2020-06-25 00:00:00,119.1,90,0,,1.3233333333333333,1.0233333333333332,559.0000000000001,667.1,783.5999999999999,,,,, +2020-06-26 00:00:00,2020-11-12 00:00:00,111.7,140,0,,0.7978571428571429,0.49785714285714294,345.4,426.69999999999993,523.3,,,,, +2020-11-13 00:00:00,2020-12-18 00:00:00,111.5,36,1,,3.0972222222222223,2.7972222222222225,724.1999999999998,796.1999999999998,868.1999999999998,647.0459357451904,588.533869212091,539.7266374875222,609.5738089257308,567.4939294984512 +2020-12-19 00:00:00,2021-01-14 00:00:00,109.6,27,1,,4.059259259259259,3.7592592592592595,689.6999999999999,743.6999999999999,797.6999999999999,684.8098206949882,635.0858321007574,592.0939367347792,651.9797409349648,618.19192326655 +2021-01-15 00:00:00,2021-02-13 00:00:00,113.8,30,0,,3.7933333333333334,3.4933333333333336,932.7,992.7,1052.7,,,,, diff --git a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/harris/summary.json b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/harris/summary.json index 56074432..86a32f22 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/harris/summary.json +++ b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/harris/summary.json @@ -4,18 +4,18 @@ "living_area": 2200, "fuel_type": "OIL", "heating_system_efficiency": 0.8, - "other_fuel_usage": null, - "other_fuel_usage_override": 0.30, - "thermostat_set_point": 68.0, + "other_fuel_usage": 0, + "other_fuel_usage_override": 0.3, + "thermostat_set_point": 68, "setback_temperature": null, "setback_hours_per_day": null, - "estimated_balance_point": 60.0, - "balance_point_sensitivity": 2.0, - "average_indoor_temperature": 68.0, - "difference_between_ti_and_tbp": 8.0, + "estimated_balance_point": 60, + "balance_point_sensitivity": 2, + "average_indoor_temperature": 68, + "difference_between_ti_and_tbp": 8, "design_temperature": 8.4, - "whole_home_heat_loss_rate": 680, + "whole_home_heat_loss_rate": 680.0, "standard_deviation_of_heat_loss_rate": 0.0847, - "average_heat_load": 36432, - "maximum_heat_load": 41869 + "average_heat_load": 36432.0, + "maximum_heat_load": 41869.0 } \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/karle/Heat Load Analysis Beta 7.xlsx b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/karle/Heat Load Analysis Beta 7.xlsx new file mode 100644 index 00000000..af879739 Binary files /dev/null and b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/karle/Heat Load Analysis Beta 7.xlsx differ diff --git a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/karle/fuel-oil.csv b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/karle/fuel-oil.csv deleted file mode 100644 index a8a32bbc..00000000 --- a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/karle/fuel-oil.csv +++ /dev/null @@ -1,17 +0,0 @@ -start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_58.5f,hdd_at_60.5f,hdd_at_62.5f,ua_at_58.5f,ua_at_60.5f,ua_at_62.5f,ua_sensitivity_at_0.1_gal,ua_sensitivity_at_0.1_gal,unused1,estimated_heating_use_therms,estimated_other_use_therms,estimated_total_use_therms,estimated_savings_therms,estimated_savings_percent,unused2,start_row,end_row,,,,, -1/16/2019,2/1/2019,132,17,1,,7.76,7.76,576.1,610.1,644.1,"1,066.20","1,006.80",953.6, , ,,,,,,,,2940,2956,,1,1006.8,,1 -2/2/2019,2/21/2019,130,20,1,,6.5,6.5,524.8,564.8,604.8,"1,152.70","1,071.10","1,000.20", , ,,,,,,,,2957,2976,,1,1071.1,,1 -2/22/2019,3/12/2019,129,19,1,,6.79,6.79,561.7,599.7,637.7,"1,068.70","1,001.00",941.3, , ,,,,,,,,2977,2995,,1,1001,,1 -3/13/2019,4/8/2019,105,27,1,,3.89,3.89,446.5,500.5,554.5,"1,094.30",976.2,881.2, , ,,,,,,,,2996,3022,,1,976.2,,1 -4/9/2019,10/25/2019,36,200,0,,0.18,0.18,411.2,541.4,696.1, , , , , ,,,,,,,,3023,3222,,0,,,0 -10/26/2019,11/25/2019,143,31,1,,4.61,4.61,530.2,589,649,"1,255.00","1,129.80","1,025.30", , ,,,,,,,,3223,3253,,1,1129.8,,1 -11/26/2019,12/17/2019,129,22,1,,5.86,5.86,536.6,580.6,624.6,"1,118.70","1,033.90",961.1, , ,,,,,,,,3254,3275,,1,1033.9,,1 -12/18/2019,1/12/2021,205,392,0,,0.52,0.52,4634.7,5150.4,5696.2, , , , , ,,,,,,,,3276,3667,,1,185.2,ERROR,0 -1/13/2021,2/4/2021,162,23,1,,7.04,7.04,682.2,728.2,774.2,"1,105.00","1,035.20",973.7, , ,,,,,,,,3668,3690,,1,1035.2,,1 -2/5/2021,2/25/2021,147,21,1,,7,7,648.2,690.2,732.2,"1,055.30",991.1,934.2, , ,,,,,,,,3691,3711,,1,991.1,,1 -2/26/2021,3/23/2021,141,26,1,,5.42,5.42,579.3,631.3,683.3,"1,132.60","1,039.30",960.2, , ,,,,,,,,3712,3737,,1,1039.3,,1 -3/24/2021,12/1/2021,157,253,0,,0.62,0.62,1075.7,1294.9,1541.7, , , , , ,,,,,,,,3738,3990,,0,,,0 -12/2/2021,1/6/2022,202,36,1,,5.61,5.61,783.5,855.5,927.5,"1,199.70","1,098.70","1,013.40", , ,,,,,,,,3991,4026,,1,1098.7,,1 -1/7/2022,1/25/2022,165,19,1,,8.68,8.68,641.3,679.3,717.3,"1,197.30","1,130.30","1,070.40", , ,,,,,,,,4027,4045,,1,1130.3,,1 -1/26/2022,2/15/2022,172,21,1,,8.19,8.19,675.1,717.1,759.1,"1,185.60","1,116.10","1,054.40", , ,,,,,,,,4046,4066,,1,1116.1,,1 -2/16/2022,3/10/2022,146,23,1,,6.35,6.35,562.7,608.7,654.7,"1,207.40","1,116.10","1,037.70", , ,,,,,,,,4067,4089,,1,1116.1,,1 \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/karle/oil-propane.csv b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/karle/oil-propane.csv new file mode 100644 index 00000000..43de8749 --- /dev/null +++ b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/karle/oil-propane.csv @@ -0,0 +1,17 @@ +start_date,end_date,usage,days_in_bill,inclusion_code,inclusion_override,avg_daily_usage,daily_htg_usage,hdd_at_58.5f,hdd_at_60.5f,hdd_at_62.5f,ua_at_58.5f,ua_at_60.5f,ua_at_62.5f,ua_sensitivity_at_-0.1_therms,ua_sensitivity_at_0.1_therms +2019-01-16 00:00:00,2019-02-01 00:00:00,132,17,1,,7.764705882352941,7.764705882352941,576.1,610.0999999999999,644.0999999999999,1066.2037840652663,1006.7857728241273,953.6407390156809,, +2019-02-02 00:00:00,2019-02-21 00:00:00,130,20,1,,6.5,6.5,524.8,564.8000000000001,604.8000000000001,1152.6930894308944,1071.0576015108593,1000.2204585537918,, +2019-02-22 00:00:00,2019-03-12 00:00:00,129,19,1,,6.7894736842105265,6.7894736842105265,561.6999999999999,599.6999999999999,637.6999999999999,1068.6843510770875,1000.9671502417876,941.320370079975,, +2019-03-13 00:00:00,2019-04-08 00:00:00,105,27,1,,3.888888888888889,3.888888888888889,446.50000000000006,500.50000000000006,554.5000000000001,1094.288913773796,976.2237762237761,881.1541929666364,, +2019-04-09 00:00:00,2019-10-25 00:00:00,36,200,0,,0.18,0.18,411.2000000000001,541.4000000000002,696.1000000000001,,,,, +2019-10-26 00:00:00,2019-11-25 00:00:00,143,31,1,,4.612903225806452,4.612903225806452,530.1999999999999,588.9999999999999,649,1255.048409405256,1129.7566496887382,1025.3107344632767,, +2019-11-26 00:00:00,2019-12-17 00:00:00,129,22,1,,5.863636363636363,5.863636363636363,536.6,580.6,624.6,1118.6731270965336,1033.895969686531,961.0630803714376,, +2019-12-18 00:00:00,2021-01-12 00:00:00,205,392,0,,0.5229591836734694,0.5229591836734694,4634.700000000003,5150.4000000000015,5696.200000000001,,,,, +2021-01-13 00:00:00,2021-02-04 00:00:00,162,23,1,,7.043478260869565,7.043478260869565,682.2,728.2,774.2,1105.0131926121371,1035.2101071134302,973.7018858176181,, +2021-02-05 00:00:00,2021-02-25 00:00:00,147,21,1,,7,7,648.2,690.2,732.2,1055.291576673866,991.075050709939,934.2256214149138,, +2021-02-26 00:00:00,2021-03-23 00:00:00,141,26,1,,5.423076923076923,5.423076923076923,579.3,631.3,683.2999999999998,1132.6083203866738,1039.3156977665137,960.2224498756038,, +2021-03-24 00:00:00,2021-12-01 00:00:00,157,253,0,,0.6205533596837944,0.6205533596837944,1075.7,1294.9000000000003,1541.7,,,,, +2021-12-02 00:00:00,2022-01-06 00:00:00,202,36,1,,5.611111111111111,5.611111111111111,783.5,855.5000000000001,927.5000000000002,1199.7106998510956,1098.7414767192672,1013.448337825696,, +2022-01-07 00:00:00,2022-01-25 00:00:00,165,19,1,,8.68421052631579,8.68421052631579,641.3000000000001,679.3,717.3,1197.2555746140652,1130.2811717944944,1070.4028997630003,, +2022-01-26 00:00:00,2022-02-15 00:00:00,172,21,1,,8.19047619047619,8.19047619047619,675.1,717.0999999999999,759.0999999999999,1185.5626326963907,1116.1251336401247,1054.371404733676,, +2022-02-16 00:00:00,2022-03-10 00:00:00,146,23,1,,6.3478260869565215,6.3478260869565215,562.7,608.7000000000002,654.7,1207.3692316805875,1116.1272657576253,1037.706837737386,, diff --git a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/karle/summary.json b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/karle/summary.json index f7bf828a..0573d41b 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/karle/summary.json +++ b/rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/karle/summary.json @@ -4,18 +4,18 @@ "living_area": 3800, "fuel_type": "OIL", "heating_system_efficiency": 0.8, - "other_fuel_usage": null, - "other_fuel_usage_override": 0.00, - "thermostat_set_point": 67.0, - "setback_temperature": 55.0, - "setback_hours_per_day": 7.0, + "other_fuel_usage": 0, + "other_fuel_usage_override": null, + "thermostat_set_point": 67, + "setback_temperature": 55, + "setback_hours_per_day": 7, "estimated_balance_point": 60.5, - "balance_point_sensitivity": 2.0, + "balance_point_sensitivity": 2, "average_indoor_temperature": 63.5, - "difference_between_ti_and_tbp": 3.0, + "difference_between_ti_and_tbp": 3, "design_temperature": 8.4, - "whole_home_heat_loss_rate": 1057, + "whole_home_heat_loss_rate": 1057.0, "standard_deviation_of_heat_loss_rate": 0.0508, - "average_heat_load": 61961, - "maximum_heat_load": 65133 + "average_heat_load": 61961.0, + "maximum_heat_load": 65133.0 } \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/generate_example_data.py b/rules-engine/tests/test_rules_engine/generate_example_data.py index 8d3998a6..72fc9c40 100644 --- a/rules-engine/tests/test_rules_engine/generate_example_data.py +++ b/rules-engine/tests/test_rules_engine/generate_example_data.py @@ -9,7 +9,6 @@ Each folder contains an excel file (named "Heat Load Analysis Beta 7.xlsx") which specifies the example inputs Once this module is run, each folder will contain three files, the original excel, a summary.json, and a fuel-specific csv file -NOTE: This module depends on the existing "cases/examples" directory structure. Should this be changed, updates will be needed. NOTE: Due to the variety of types in the Summary and Fuel specific worksheets, the workbook object is purposely of type Any. """ @@ -18,22 +17,15 @@ import os import pathlib import re +from pathlib import Path from typing import Any import openpyxl ROOT_DIR = pathlib.Path(__file__).parent / "cases" / "examples" -# As of right now, all examples can and should be generated -YET_TO_BE_UPDATED_EXAMPLES = "" -# Filter in/out failing examples, if any -INPUT_DATA = filter( - lambda d: d not in YET_TO_BE_UPDATED_EXAMPLES, next(os.walk(ROOT_DIR))[1] -) - - -def generate_summary_json(workbook: Any, folder: str) -> str: +def generate_summary_json(workbook: Any, working_directory: Path) -> str: """ Read the heat load analysis spreadsheet and write information from the "Summary" tab into a json file We do this so our test runners use the json file for faster processing of our example data @@ -91,7 +83,7 @@ def generate_summary_json(workbook: Any, folder: str) -> str: break # Now that we have accumulated all the relevant fields into a data dictionary, write out summary.json - with open(ROOT_DIR / folder / "summary.json", "w") as json_file: + with open(working_directory / "summary.json", "w") as json_file: json.dump(data, json_file, indent=4) # Return the fuel type we found in the Summary worksheet so we can operate on the correct worksheet next @@ -99,7 +91,7 @@ def generate_summary_json(workbook: Any, folder: str) -> str: def generate_billing_record_input_csv( - workbook: Any, fuel_type: str, folder: str + workbook: Any, fuel_type: str, working_directory: Path ) -> None: """ Read the heat load analysis spreadsheet and write data from the appropriate "fuel type" worksheet into a csv file @@ -107,7 +99,7 @@ def generate_billing_record_input_csv( """ # Choose the appropriate fuel-type worksheet, set header and data row locations and output filename for each type if fuel_type == "GAS": - output_file_path = ROOT_DIR / folder / "natural-gas.csv" + output_file_path = working_directory / "natural-gas.csv" worksheet = workbook["Natural Gas"] header_row = 4 billing_row = 5 @@ -123,7 +115,7 @@ def generate_billing_record_input_csv( "daily_htg_usage", ] elif fuel_type == "OIL": - output_file_path = ROOT_DIR / folder / "oil-propane.csv" + output_file_path = working_directory / "oil-propane.csv" worksheet = workbook["Oil-Propane"] header_row = 5 billing_row = 7 @@ -187,12 +179,19 @@ def generate_billing_record_input_csv( if __name__ == "__main__": # For each example folder, read the excel sheet and write summary.json and "fuel_type".csv - for folder in INPUT_DATA: - workbook = openpyxl.load_workbook( - filename=ROOT_DIR / folder / "Heat Load Analysis Beta 7.xlsx", - data_only=True, - ) - fuel_type = generate_summary_json(workbook, folder) - generate_billing_record_input_csv(workbook, fuel_type, folder) + for root, dirs, files in os.walk(ROOT_DIR): + working_directory = Path(root) + try: + workbook = openpyxl.load_workbook( + filename=working_directory / "Heat Load Analysis Beta 7.xlsx", + data_only=True, + ) + except FileNotFoundError as fnf_error: + # It's ok to iterate over directories that do not contain an excel file + print("Skipping test directory:", working_directory) + continue + print("Processing test directory:", working_directory) + fuel_type = generate_summary_json(workbook, working_directory) + generate_billing_record_input_csv(workbook, fuel_type, working_directory) workbook.close() del workbook