diff --git a/rules-engine/tests/test_rules_engine/cases/examples/README.md b/rules-engine/tests/test_rules_engine/cases/examples/README.md index f951fab8..c38335d3 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/README.md +++ b/rules-engine/tests/test_rules_engine/cases/examples/README.md @@ -1 +1,5 @@ -These test cases are derived from the examples that come bundled in the Heat Load Analysis tool \ No newline at end of file +These test cases are derived from the examples that come bundled in the Heat Load Analysis tool + +The example test case files (csv and json) are auto-generated directly from the corresponing source Heat Load Analysis excel sheet. + +To generate the test case example files, run `make gen_examples` from within the rules_engine directory. \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/cases/examples/shen/Heat Load Analysis Beta 7.xlsx b/rules-engine/tests/test_rules_engine/cases/examples/shen/Heat Load Analysis Beta 7.xlsx index 02ea4dc7..b305c878 100644 Binary files a/rules-engine/tests/test_rules_engine/cases/examples/shen/Heat Load Analysis Beta 7.xlsx and b/rules-engine/tests/test_rules_engine/cases/examples/shen/Heat Load Analysis Beta 7.xlsx differ diff --git a/rules-engine/tests/test_rules_engine/cases/examples/shen/natural-gas.csv b/rules-engine/tests/test_rules_engine/cases/examples/shen/natural-gas.csv index 91d19bf4..ba22dc8c 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/shen/natural-gas.csv +++ b/rules-engine/tests/test_rules_engine/cases/examples/shen/natural-gas.csv @@ -1,19 +1,19 @@ -start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_60f,hdd_at_61f,hdd_at_62f,ua_at_60f,ua_at_61f,ua_at_62f,ua_sensitivity_at_0.5_therms,ua_sensitivity_at_0.7_therms -2021-12-08 00:00:00,2022-01-07 00:00:00,31,218,,1,7.032258064516129,6.4344319775596075,743.6,774.6,805.6,1005.9208141356972,965.6632034486244,928.5038696515696,980.6709493820092,950.6554575152394 -2022-01-08 00:00:00,2022-02-08 00:00:00,32,312,,1,9.75,9.152173913043478,1153.7,1185.7,1217.7,951.9466668676582,926.2552665642382,901.9141574814957,936.3758704269353,916.1346627015412 -2022-02-09 00:00:00,2022-03-09 00:00:00,29,200,,1,6.896551724137931,6.298725637181409,767.3999999999999,796.3999999999999,825.3999999999999,892.606741000102,860.1034819732274,829.8841931711635,873.7586803659948,846.4482835804599 -2022-03-10 00:00:00,2022-04-07 00:00:00,29,128,,0,4.413793103448276,3.8159670164917543,490.29999999999995,519.3,548.3,,,,, -2022-04-08 00:00:00,2022-05-09 00:00:00,32,80,,0,2.5,1.9021739130434783,306.2,338.2,370.2,,,,, -2022-05-10 00:00:00,2022-06-08 00:00:00,30,30,,0,1,0.40217391304347827,35.199999999999996,46.29999999999999,59.39999999999999,,,,, -2022-06-09 00:00:00,2022-07-08 00:00:00,30,22,,-1,0.7333333333333333,0.13550724637681155,3.5,4.5,6.200000000000003,,,,, +start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_59f,hdd_at_60f,hdd_at_61f,ua_at_59f,ua_at_60f,ua_at_61f,ua_sensitivity_at_0.5_therms,ua_sensitivity_at_0.7_therms +2021-12-08 00:00:00,2022-01-07 00:00:00,31,218,,1,7.032258064516129,6.4344319775596075,720.8000000000001,751.8000000000001,782.8000000000001,1037.7396190223426,994.9490787327807,955.5476716802561,1010.4119677990216,979.4861896665396 +2022-01-08 00:00:00,2022-02-08 00:00:00,32,312,,1,9.75,9.152173913043478,1113.3,1145.3000000000002,1177.3,986.4913945614098,958.9285510916068,932.8640699611124,969.4061552127978,948.4509469704159 +2022-02-09 00:00:00,2022-03-09 00:00:00,29,200,,1,6.896551724137931,6.298725637181409,743.3,772.3,801.3,921.547710269714,886.9434326602077,854.8438949750135,901.0247482111594,872.8621171092561 +2022-03-10 00:00:00,2022-04-07 00:00:00,29,128,,0,4.413793103448276,3.8159670164917543,448.79999999999995,477.79999999999995,506.79999999999995,,,,, +2022-04-08 00:00:00,2022-05-09 00:00:00,32,80,,0,2.5,1.9021739130434783,269.3999999999999,301.3999999999999,333.3999999999999,,,,, +2022-05-10 00:00:00,2022-06-08 00:00:00,30,30,,0,1,0.40217391304347827,16,24.299999999999997,34.39999999999999,,,,, +2022-06-09 00:00:00,2022-07-08 00:00:00,30,22,,-1,0.7333333333333333,0.13550724637681155,2.5,3.5,4.5,,,,, 2022-07-09 00:00:00,2022-08-09 00:00:00,32,17,,-1,0.53125,-0.06657608695652173,0,0,0,,,,, -2022-08-10 00:00:00,2022-09-08 00:00:00,30,16,,-1,0.5333333333333333,-0.0644927536231884,0,0,0.6000000000000014,,,,, -2022-08-17 00:00:00,2022-10-07 00:00:00,52,29,,0,0.5576923076923077,-0.04013377926421402,75.5,89.1,106.8,,,,, -2022-10-08 00:00:00,2022-11-08 00:00:00,32,66,,0,2.0625,1.4646739130434783,205.80000000000004,229.80000000000004,255.99999999999997,,,,, -2022-11-09 00:00:00,2022-12-09 00:00:00,31,157,,1,5.064516129032258,4.4666900420757365,541.2,570.2,599.2,959.4470018316784,910.6501532643009,866.5766311603878,931.0377365684047,890.2625699601971 -2022-12-10 00:00:00,2023-01-10 00:00:00,32,221,,1,6.90625,6.3084239130434785,812.7,844.7,876.7,931.476399120484,896.1890251748755,863.4776657525007,910.395252237738,881.9827981120129 -2023-01-11 00:00:00,2023-02-08 00:00:00,29,215,,1,7.413793103448276,6.815967016491754,762.9000000000001,791.9000000000001,820.9,971.6036348715141,936.0227466138125,902.95579613044,949.7555411585782,922.2899520690469 -2023-02-09 00:00:00,2023-03-10 00:00:00,30,199,,1,6.633333333333334,6.035507246376812,694.8999999999999,724.8999999999999,754.8999999999999,977.1111889730774,936.6734242204325,899.4496823650702,952.1928062041544,921.1540422367107 -2023-03-11 00:00:00,2023-04-10 00:00:00,31,138,,0,4.451612903225806,3.8537868162692845,559.3,590.2999999999998,621.2999999999998,,,,, -2023-04-11 00:00:00,2023-05-09 00:00:00,29,62,,0,2.1379310344827585,1.5401049475262367,222.09999999999997,246.09999999999997,270.1,,,,, -2023-05-10 00:00:00,2023-06-09 00:00:00,31,20,,0,0.6451612903225806,0.0473352033660589,86.50000000000001,105.7,126.50000000000001,,,,, +2022-08-10 00:00:00,2022-09-08 00:00:00,30,16,,-1,0.5333333333333333,-0.0644927536231884,0,0,0,,,,, +2022-08-17 00:00:00,2022-10-07 00:00:00,52,29,,0,0.5576923076923077,-0.04013377926421402,62.49999999999999,75.5,89.1,,,,, +2022-10-08 00:00:00,2022-11-08 00:00:00,32,66,,0,2.0625,1.4646739130434783,194.5,219.20000000000005,244.20000000000005,,,,, +2022-11-09 00:00:00,2022-12-09 00:00:00,31,157,,1,5.064516129032258,4.4666900420757365,522.4,551.4,580.4000000000001,993.9753395698784,941.6987983157499,894.6463083930123,962.7814969011687,920.616099730331 +2022-12-10 00:00:00,2023-01-10 00:00:00,32,221,,1,6.90625,6.3084239130434785,782.8000000000002,814.8000000000002,846.8000000000002,967.0552753771299,929.0756867516167,893.9665441251975,943.803227252353,914.3481462508803 +2023-01-11 00:00:00,2023-02-08 00:00:00,29,215,,1,7.413793103448276,6.815967016491754,727.6,756.6,785.6,1018.7416341993927,979.6939109747266,943.529039006464,994.0674240595798,965.3203978898733 +2023-02-09 00:00:00,2023-03-10 00:00:00,30,199,,1,6.633333333333334,6.035507246376812,667.2999999999998,697.2999999999998,727.2999999999998,1017.5251988871446,973.7481216368731,933.5825178294948,989.881780033546,957.6144632402002 +2023-03-11 00:00:00,2023-04-10 00:00:00,31,138,,0,4.451612903225806,3.8537868162692845,517,548,578.9999999999999,,,,, +2023-04-11 00:00:00,2023-05-09 00:00:00,29,62,,0,2.1379310344827585,1.5401049475262367,196.79999999999995,220.79999999999995,244.79999999999995,,,,, +2023-05-10 00:00:00,2023-06-09 00:00:00,31,20,,0,0.6451612903225806,0.0473352033660589,63.7,81.6,100.80000000000001,,,,, diff --git a/rules-engine/tests/test_rules_engine/cases/examples/shen/summary.json b/rules-engine/tests/test_rules_engine/cases/examples/shen/summary.json index 565ef119..dde02152 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/shen/summary.json +++ b/rules-engine/tests/test_rules_engine/cases/examples/shen/summary.json @@ -9,13 +9,13 @@ "thermostat_set_point": 68, "setback_temperature": null, "setback_hours_per_day": null, - "estimated_balance_point": 61, + "estimated_balance_point": 60, "balance_point_sensitivity": 1, "average_indoor_temperature": 68, - "difference_between_ti_and_tbp": 7, + "difference_between_ti_and_tbp": 8, "design_temperature": 8.4, - "whole_home_heat_loss_rate": 919.0, - "standard_deviation_of_heat_loss_rate": 0.0341, - "average_heat_load": 50166.0, - "maximum_heat_load": 56598.0 + "whole_home_heat_loss_rate": 952.0, + "standard_deviation_of_heat_loss_rate": 0.0355, + "average_heat_load": 51035.0, + "maximum_heat_load": 58652.0 } \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/test_examples.py b/rules-engine/tests/test_rules_engine/test_examples.py index 69fb003e..ac914298 100644 --- a/rules-engine/tests/test_rules_engine/test_examples.py +++ b/rules-engine/tests/test_rules_engine/test_examples.py @@ -23,8 +23,9 @@ # Each subdirectory contains a JSON file (named summary.json) which specifies the inputs for the test runner ROOT_DIR = pathlib.Path(__file__).parent / "cases" / "examples" -# TODO: example-2 is OIL; shen is misbehaving -YET_TO_BE_UPDATED_EXAMPLES = ("example-2", "shen") +# TODO: example-2 is OIL; all others are Natural Gas +YET_TO_BE_UPDATED_EXAMPLES = "example-2" + # Filter out failing examples for now INPUT_DATA = filter( lambda d: d not in YET_TO_BE_UPDATED_EXAMPLES, next(os.walk(ROOT_DIR))[1]