From 9033c6f80115950abb76b3c4c503d59878682818 Mon Sep 17 00:00:00 2001 From: eriksynn <159293101+eriksynn@users.noreply.github.com> Date: Tue, 2 Jul 2024 19:31:12 -0400 Subject: [PATCH] Created and integrated a tool to auto-generate the test example files from original example excel sheets (#213) * Update test example files by auto-generating them from original example excel files. Fixes #207 * Created and integrated a tool to auto-generate the test example files from original example excel sheets * Add dependency types-openpyxl to pyproject.toml and regen requirements-dev.txt --- rules-engine/Makefile | 5 +- rules-engine/pyproject.toml | 2 + rules-engine/requirements-dev.txt | 12 +- .../cases/examples/breslow/natural-gas.csv | 72 +++---- .../cases/examples/breslow/summary.json | 20 +- .../cases/examples/cali/natural-gas.csv | 74 +++---- .../cases/examples/cali/summary.json | 14 +- .../cases/examples/example-1/natural-gas.csv | 74 +++---- .../cases/examples/example-1/summary.json | 16 +- .../cases/examples/example-2/oil-propane.csv | 5 + .../cases/examples/example-2/summary.json | 16 +- .../cases/examples/example-4/natural-gas.csv | 42 ++-- .../cases/examples/example-4/summary.json | 16 +- .../cases/examples/feldman/natural-gas.csv | 74 +++---- .../cases/examples/feldman/summary.json | 16 +- .../cases/examples/lewitus/natural-gas.csv | 74 +++---- .../cases/examples/lewitus/summary.json | 14 +- .../cases/examples/quateman/natural-gas.csv | 52 ++--- .../cases/examples/quateman/summary.json | 20 +- .../cases/examples/shen/natural-gas.csv | 38 ++-- .../cases/examples/shen/summary.json | 22 +- .../cases/examples/vitti/natural-gas.csv | 74 +++---- .../cases/examples/vitti/summary.json | 16 +- .../cases/examples/yellepeddi/natural-gas.csv | 42 ++-- .../cases/examples/yellepeddi/summary.json | 14 +- .../generate_example_data.py | 198 ++++++++++++++++++ .../tests/test_rules_engine/test_examples.py | 10 +- 27 files changed, 626 insertions(+), 406 deletions(-) create mode 100644 rules-engine/tests/test_rules_engine/cases/examples/example-2/oil-propane.csv create mode 100644 rules-engine/tests/test_rules_engine/generate_example_data.py diff --git a/rules-engine/Makefile b/rules-engine/Makefile index 9cd87a24..e0902a36 100644 --- a/rules-engine/Makefile +++ b/rules-engine/Makefile @@ -12,6 +12,9 @@ lint: black isort pydocstyle mypy: mypy . +gen_examples: + python .\tests\test_rules_engine\generate_example_data.py + test: pytest . @@ -19,4 +22,4 @@ build: pip install -q build python -m build -all: lint mypy test build +all: lint mypy gen_examples test build diff --git a/rules-engine/pyproject.toml b/rules-engine/pyproject.toml index 2c6e66f1..e9626739 100644 --- a/rules-engine/pyproject.toml +++ b/rules-engine/pyproject.toml @@ -15,9 +15,11 @@ dev = [ "black", "isort", "mypy", + "openpyxl", "pydantic", "pydocstyle", "pytest", + "types-openpyxl", ] [tool.isort] diff --git a/rules-engine/requirements-dev.txt b/rules-engine/requirements-dev.txt index b8ca940d..9de91bf7 100644 --- a/rules-engine/requirements-dev.txt +++ b/rules-engine/requirements-dev.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --extra=dev --output-file=requirements-dev.txt pyproject.toml @@ -10,6 +10,12 @@ black==23.3.0 # via rules-engine (pyproject.toml) click==8.1.3 # via black +colorama==0.4.6 + # via + # click + # pytest +et-xmlfile==1.1.0 + # via openpyxl iniconfig==2.0.0 # via pytest isort==5.12.0 @@ -20,6 +26,8 @@ mypy-extensions==1.0.0 # via # black # mypy +openpyxl==3.1.4 + # via rules-engine (pyproject.toml) packaging==23.1 # via # black @@ -40,6 +48,8 @@ pytest==7.3.2 # via rules-engine (pyproject.toml) snowballstemmer==2.2.0 # via pydocstyle +types-openpyxl==3.1.4.20240626 + # via rules-engine (pyproject.toml) typing-extensions==4.6.3 # via # mypy diff --git a/rules-engine/tests/test_rules_engine/cases/examples/breslow/natural-gas.csv b/rules-engine/tests/test_rules_engine/cases/examples/breslow/natural-gas.csv index 2e8f9629..2f16e99a 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/breslow/natural-gas.csv +++ b/rules-engine/tests/test_rules_engine/cases/examples/breslow/natural-gas.csv @@ -1,36 +1,36 @@ -start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_66f,hdd_at_68f,hdd_at_70f,ua_at_66f,ua_at_68f,ua_at_70f,ua_sensitivity_at_0.31_therms,ua_sensitivity_at_0.51_therms,unused1,estimated_heating_use_therms,estimated_other_use_therms,estimated_total_use_therms,estimated_savings_therms,estimated_savings_percent,unused2,start_row,end_row -3/3/2019,3/29/2019,27,120,,1,4.44,4.03,816.2,870.2,924.2,472.7,443.3,417.4,454.3,432.3,,,,,,,,2986,3012 -3/31/2019,4/30/2019,31,88,,0,2.84,2.43,511.3,570.1,632.1, , , , , ,,,,,,,,3014,3044 -5/2/2019,6/3/2019,33,66,,0,2,1.59,300.6,363.7,428.3, , , , , ,,,,,,,,3046,3078 -6/5/2019,6/27/2019,23,18,,0,0.78,0.37,18.3,42.4,85, , , , , ,,,,,,,,3080,3102 -6/29/2019,7/31/2019,33,14,,-1,0.42,0.01,0,4.9,31, , , , , ,,,,,,,,3104,3136 -8/2/2019,8/28/2019,27,13,,-1,0.48,0.07,13.6,28.4,59, , , , , ,,,,,,,,3138,3164 -8/30/2019,10/1/2019,33,34,,0,1.03,0.62,94.2,145.4,206.8, , , , , ,,,,,,,,3166,3198 -10/3/2019,10/28/2019,26,50,,0,1.92,1.51,306.6,356.6,407.9, , , , , ,,,,,,,,3200,3225 -10/30/2019,11/27/2019,29,118,,0,4.07,3.66,744.2,801.1,859.1, , , , , ,,,,,,,,3227,3255 -11/29/2019,12/30/2019,32,158,,1,4.94,4.53,1080.2,1144.2,1208.2,475,448.4,424.7,458.4,438.5,,,,,,,,3257,3288 -1/1/2020,1/29/2020,29,138,,1,4.76,4.35,925.8,983.8,1041.8,482.4,454,428.7,464.4,443.5,,,,,,,,3290,3318 -1/31/2020,2/26/2020,27,140,,1,5.19,4.78,873.8,927.8,981.8,522.6,492.2,465.1,502.5,481.9,,,,,,,,3320,3346 -2/28/2020,3/30/2020,32,127,,1,3.97,3.56,773,837,901,521.8,481.9,447.6,495.4,468.3,,,,,,,,3348,3379 -4/1/2020,4/28/2020,28,86,,0,3.07,2.66,584.1,640.1,696.1, , , , , ,,,,,,,,3381,3408 -4/30/2020,5/27/2020,28,44,,0,1.57,1.16,294.3,348.5,404.5, , , , , ,,,,,,,,3410,3437 -5/29/2020,6/26/2020,29,14,,0,0.48,0.07,56.7,85.3,126.2, , , , , ,,,,,,,,3439,3467 -6/28/2020,7/29/2020,32,11,,-1,0.34,-0.07,2,9,41.7, , , , , ,,,,,,,,3469,3500 -7/31/2020,8/27/2020,28,9,,-1,0.32,-0.09,12.1,26.4,61.1, , , , , ,,,,,,,,3502,3529 -8/29/2020,9/28/2020,31,22,,-1,0.71,0.3,141.6,188,243.8, , , , , ,,,,,,,,3531,3561 -9/30/2020,10/27/2020,28,36,,0,1.29,0.88,322.2,377.2,433.2, , , , , ,,,,,,,,3563,3590 -10/29/2020,11/30/2020,33,106,,0,3.21,2.8,718.4,784.4,850.4, , , , , ,,,,,,,,3592,3624 -12/2/2020,12/28/2020,27,131,,1,4.85,4.44,880.9,934.9,988.9,482.2,454.3,429.5,464.6,444.1,,,,,,,,3626,3652 -12/30/2020,1/28/2021,30,122,,1,4.07,3.66,1030.2,1090.2,1150.2,377.1,356.4,337.8,366.1,346.6,,,,,,,,3654,3683 -1/30/2021,2/26/2021,28,153,,1,5.46,5.05,1091.1,1147.1,1203.1,459.4,436.9,416.6,445.6,428.3,,,,,,,,3685,3712 -2/28/2021,3/30/2021,31,141,0,0,4.55,4.14,817.7,879.7,941.7, , , , , ,,,,,,,,3714,3744 -4/1/2021,4/29/2021,29,77,,0,2.66,2.25,498.5,556.5,614.5, , , , , ,,,,,,,,3746,3774 -5/1/2021,5/28/2021,28,38,,0,1.36,0.95,212.7,262.1,318, , , , , ,,,,,,,,3776,3803 -5/30/2021,6/29/2021,31,23,,0,0.74,0.33,68.1,101.7,145, , , , , ,,,,,,,,3805,3835 -7/1/2021,7/29/2021,29,10,,-1,0.34,-0.07,21.6,45.8,91, , , , , ,,,,,,,,3837,3865 -7/31/2021,8/31/2021,32,10,,-1,0.31,-0.1,7.5,25.2,53.4, , , , , ,,,,,,,,3867,3898 -9/2/2021,9/28/2021,27,9,,-1,0.33,-0.08,42.2,78.3,125.7, , , , , ,,,,,,,,3900,3926 -9/30/2021,10/28/2021,29,26,,0,0.9,0.49,266.7,322.7,380.5, , , , , ,,,,,,,,3928,3956 -10/30/2021,11/29/2021,31,102,,0,3.29,2.88,708.1,770.1,832.1, , , , , ,,,,,,,,3958,3988 -12/1/2021,12/27/2021,27,111,,1,4.11,3.7,783.6,837.6,891.6,451.7,422.5,396.9,434,411.1,,,,,,,,3990,4016 -12/29/2021,1/27/2022,30,166,,1,5.53,5.12,1154.1,1214.1,1274.1,471.7,448.4,427.2,457.1,439.6,,,,,,,,4018,4047 \ No newline at end of file +start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_66f,hdd_at_68f,hdd_at_70f,ua_at_66f,ua_at_68f,ua_at_70f,ua_sensitivity_at_0.31_therms,ua_sensitivity_at_0.51_therms +2019-03-03 00:00:00,2019-03-29 00:00:00,27,120,,1,4.444444444444445,4.0344026034402605,816.1999999999999,870.2,924.1999999999999,472.6657056529955,443.3345770558203,417.4310202921174,454.3234301930301,432.3457239186105 +2019-03-31 00:00:00,2019-04-30 00:00:00,31,88,,0,2.838709677419355,2.428667836415171,511.29999999999995,570.0999999999999,632.0999999999999,,,,, +2019-05-02 00:00:00,2019-06-03 00:00:00,33,66,,0,2,1.5899581589958158,300.59999999999997,363.7000000000001,428.3000000000001,,,,, +2019-06-05 00:00:00,2019-06-27 00:00:00,23,18,,0,0.782608695652174,0.37256685464798983,18.300000000000004,42.40000000000001,85.00000000000001,,,,, +2019-06-29 00:00:00,2019-07-31 00:00:00,33,14,,-1,0.42424242424242425,0.014200583238240139,0,4.900000000000006,31,,,,, +2019-08-02 00:00:00,2019-08-28 00:00:00,27,13,,-1,0.48148148148148145,0.07143964047729734,13.599999999999994,28.400000000000006,59.000000000000014,,,,, +2019-08-30 00:00:00,2019-10-01 00:00:00,33,34,,0,1.0303030303030303,0.6202611892988461,94.19999999999997,145.39999999999998,206.79999999999995,,,,, +2019-10-03 00:00:00,2019-10-28 00:00:00,26,50,,0,1.9230769230769231,1.513035082072739,306.6,356.6,407.90000000000003,,,,, +2019-10-30 00:00:00,2019-11-27 00:00:00,29,118,,0,4.068965517241379,3.658923676237195,744.1999999999999,801.1,859.1,,,,, +2019-11-29 00:00:00,2019-12-30 00:00:00,32,158,,1,4.9375,4.527458158995816,1080.2000000000003,1144.2000000000003,1208.2000000000005,475.0156681042329,448.4460100386229,424.6912139432149,458.35103829708584,438.54098178015994 +2020-01-01 00:00:00,2020-01-29 00:00:00,29,138,,1,4.758620689655173,4.348578848650988,925.8000000000001,983.8000000000001,1041.8000000000002,482.431719500463,453.98992266063084,428.7149989571209,464.42988335724937,443.5499619640123 +2020-01-31 00:00:00,2020-02-26 00:00:00,27,140,,1,5.185185185185185,4.775143344181001,873.8,927.8,981.8,522.5716208369286,492.15680350000883,465.087678027407,502.4634428619403,481.85016413807745 +2020-02-28 00:00:00,2020-03-30 00:00:00,32,127,,1,3.96875,3.558708158995816,773,837.0000000000001,901.0000000000001,521.7597128325043,481.86410755020995,447.63624641456795,495.40452969278266,468.32368540763724 +2020-04-01 00:00:00,2020-04-28 00:00:00,28,86,,0,3.0714285714285716,2.6613867304243874,584.0999999999999,640.0999999999999,696.1,,,,, +2020-04-30 00:00:00,2020-05-27 00:00:00,28,44,,0,1.5714285714285714,1.1613867304243872,294.30000000000007,348.49999999999994,404.49999999999994,,,,, +2020-05-29 00:00:00,2020-06-26 00:00:00,29,14,,0,0.4827586206896552,0.07271677968547108,56.699999999999996,85.29999999999998,126.19999999999997,,,,, +2020-06-28 00:00:00,2020-07-29 00:00:00,32,11,,-1,0.34375,-0.06629184100418412,2,8.999999999999986,41.699999999999974,,,,, +2020-07-31 00:00:00,2020-08-27 00:00:00,28,9,,-1,0.32142857142857145,-0.08861326957561266,12.100000000000001,26.399999999999984,61.09999999999999,,,,, +2020-08-29 00:00:00,2020-09-28 00:00:00,31,22,,-1,0.7096774193548387,0.29963557835065463,141.6,187.99999999999997,243.8,,,,, +2020-09-30 00:00:00,2020-10-27 00:00:00,28,36,,0,1.2857142857142858,0.8756724447101016,322.2,377.20000000000005,433.20000000000005,,,,, +2020-10-29 00:00:00,2020-11-30 00:00:00,33,106,,0,3.212121212121212,2.8020793711170278,718.3999999999999,784.3999999999999,850.3999999999996,,,,, +2020-12-02 00:00:00,2020-12-28 00:00:00,27,131,,1,4.851851851851852,4.441810010847668,880.9000000000002,934.9000000000002,988.9000000000002,482.1751416588808,454.324614704576,429.5157066309112,464.5529813748081,444.09624803434394 +2020-12-30 00:00:00,2021-01-28 00:00:00,30,122,,1,4.066666666666666,3.6566248256624823,1030.2,1090.2,1150.2,377.1271478612295,356.3716636641338,337.7815925288112,366.11758184428425,346.62574548398334 +2021-01-30 00:00:00,2021-02-26 00:00:00,28,153,,1,5.464285714285714,5.05424387328153,1091.1000000000004,1147.1000000000004,1203.1000000000001,459.3644188743026,436.9388173949539,416.6008789242388,445.5838062073213,428.29382858258646 +2021-02-28 00:00:00,2021-03-30 00:00:00,31,141,0,0,4.548387096774194,4.13834525577001,817.6999999999999,879.6999999999999,941.6999999999999,,,,, +2021-04-01 00:00:00,2021-04-29 00:00:00,29,77,,0,2.6551724137931036,2.2451305727889195,498.49999999999994,556.5,614.5,,,,, +2021-05-01 00:00:00,2021-05-28 00:00:00,28,38,,0,1.3571428571428572,0.947101016138673,212.69999999999993,262.09999999999997,318.00000000000006,,,,, +2021-05-30 00:00:00,2021-06-29 00:00:00,31,23,,0,0.7419354838709677,0.33189364286678363,68.1,101.69999999999999,145,,,,, +2021-07-01 00:00:00,2021-07-29 00:00:00,29,10,,-1,0.3448275862068966,-0.06521425479728754,21.6,45.800000000000004,90.99999999999999,,,,, +2021-07-31 00:00:00,2021-08-31 00:00:00,32,10,,-1,0.3125,-0.09754184100418412,7.499999999999986,25.19999999999999,53.39999999999998,,,,, +2021-09-02 00:00:00,2021-09-28 00:00:00,27,9,,-1,0.3333333333333333,-0.0767085076708508,42.19999999999999,78.29999999999998,125.69999999999999,,,,, +2021-09-30 00:00:00,2021-10-28 00:00:00,29,26,,0,0.896551724137931,0.48650988313374693,266.69999999999993,322.6999999999999,380.5,,,,, +2021-10-30 00:00:00,2021-11-29 00:00:00,31,102,,0,3.2903225806451615,2.8802807396409773,708.1,770.1,832.1,,,,, +2021-12-01 00:00:00,2021-12-27 00:00:00,27,111,,1,4.111111111111111,3.7010692701069265,783.6000000000001,837.6,891.6000000000001,451.6523085170684,422.53432301095364,396.9434151569928,433.95087028889066,411.1177757330167 +2021-12-29 00:00:00,2022-01-27 00:00:00,30,166,,1,5.533333333333333,5.123291492329149,1154.1,1214.1,1274.1000000000001,471.66599173379444,448.35657776128176,427.24254066397623,457.1079162012784,439.605239321285 diff --git a/rules-engine/tests/test_rules_engine/cases/examples/breslow/summary.json b/rules-engine/tests/test_rules_engine/cases/examples/breslow/summary.json index a1fee851..b552df0a 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/breslow/summary.json +++ b/rules-engine/tests/test_rules_engine/cases/examples/breslow/summary.json @@ -6,16 +6,16 @@ "heating_system_efficiency": 0.85, "other_fuel_usage": 0.41, "other_fuel_usage_override": null, - "thermostat_set_point": 68.0, - "setback_temperature": 62.0, - "setback_hours_per_day": 12.0, - "estimated_balance_point": 68.0, - "balance_point_sensitivity": 2.0, - "average_indoor_temperature": 65.0, - "difference_between_ti_and_tbp": -3.0, + "thermostat_set_point": 68, + "setback_temperature": 62, + "setback_hours_per_day": 12, + "estimated_balance_point": 68, + "balance_point_sensitivity": 2, + "average_indoor_temperature": 65, + "difference_between_ti_and_tbp": -3, "design_temperature": 8.4, - "whole_home_heat_loss_rate": 444, + "whole_home_heat_loss_rate": 444.0, "standard_deviation_of_heat_loss_rate": 0.0787, - "average_heat_load": 28672, - "maximum_heat_load": 27340 + "average_heat_load": 28672.0, + "maximum_heat_load": 27340.0 } \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/cases/examples/cali/natural-gas.csv b/rules-engine/tests/test_rules_engine/cases/examples/cali/natural-gas.csv index 564a3eb5..c85b6bcf 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/cali/natural-gas.csv +++ b/rules-engine/tests/test_rules_engine/cases/examples/cali/natural-gas.csv @@ -1,37 +1,37 @@ -start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_54f,hdd_at_56f,hdd_at_58f,ua_at_54f,ua_at_56f,ua_at_58f,ua_sensitivity_at_0.32_therms,ua_sensitivity_at_0.52_therms,unused1,estimated_heating_use_therms,estimated_other_use_therms,estimated_total_use_therms,estimated_savings_therms,estimated_savings_percent,unused2,start_row,end_row -2/28/2018,3/27/2018,28,132,,1,4.71,4.29,534.8,590.8,646.8,870.4,787.9,719.7,806.3,769.6,,,,,,,,2618,2645 -3/28/2018,4/30/2018,34,98,,0,2.88,2.46,332.1,393.3,455.4, , , , , ,,,,,,,,2646,2679 -5/1/2018,5/30/2018,30,23,,0,0.77,0.34,14,21.8,38.9, , , , , ,,,,,,,,2680,2709 -5/31/2018,6/28/2018,29,16,,0,0.55,0.13,2.1,4.1,9.6, , , , , ,,,,,,,,2710,2738 -6/29/2018,7/29/2018,31,16,,-1,0.52,0.09,0,0,0, , , , , ,,,,,,,,2739,2769 -7/30/2018,8/27/2018,29,12,,-1,0.41,-0.01,0,0,0, , , , , ,,,,,,,,2770,2798 -8/28/2018,9/26/2018,30,16,,-1,0.53,0.11,3.2,7.4,14.6, , , , , ,,,,,,,,2799,2828 -9/27/2018,10/25/2018,29,37,,0,1.28,0.85,106.3,132.7,171.2, , , , , ,,,,,,,,2829,2857 -10/26/2018,11/27/2018,33,119,,0,3.61,3.18,440.5,500.6,564.6, , , , , ,,,,,,,,2858,2890 -11/28/2018,12/28/2018,31,151,,1,4.87,4.45,600.2,660.2,721.3,890,809.2,740.6,827.3,791,,,,,,,,2891,2921 -12/29/2018,1/29/2019,32,183,,1,5.72,5.29,781.8,845.8,909.8,839.8,776.3,721.7,790.9,761.6,,,,,,,,2922,2953 -1/30/2019,2/28/2019,30,158,,1,5.27,4.84,714.4,774.4,834.4,788,727,674.7,742,712,,,,,,,,2954,2983 -3/1/2019,3/27/2019,27,128,,1,4.74,4.32,513.1,566.5,620.5,880.2,797.3,727.9,815.7,778.8,,,,,,,,2984,3010 -3/28/2019,4/29/2019,33,64,,0,1.94,1.52,186.2,237.5,293.5, , , , , ,,,,,,,,3011,3043 -4/30/2019,6/3/2019,35,41,,0,1.17,0.75,52.8,80,113.3, , , , , ,,,,,,,,3044,3078 -6/4/2019,6/27/2019,24,11,,0,0.46,0.03,0,0.2,2.2, , , , , ,,,,,,,,3079,3102 -6/28/2019,7/31/2019,34,13,,-1,0.38,-0.04,0,0,0, , , , , ,,,,,,,,3103,3136 -8/1/2019,8/28/2019,28,11,,-1,0.39,-0.03,0,0,0, , , , , ,,,,,,,,3137,3164 -8/29/2019,9/30/2019,33,15,,-1,0.45,0.03,0,1.5,4, , , , , ,,,,,,,,3165,3197 -10/1/2019,10/25/2019,25,14,,0,0.56,0.14,23,43.4,81.9, , , , , ,,,,,,,,3198,3222 -10/26/2019,11/27/2019,33,100,,0,3.03,2.61,407,466.3,528, , , , , ,,,,,,,,3223,3255 -11/28/2019,1/2/2020,36,163,,1,4.53,4.1,744.1,816.1,888.1,769.4,701.5,644.6,718.6,684.4,,,,,,,,3256,3291 -1/3/2020,1/30/2020,28,124,,1,4.43,4,569.1,621.1,673.1,763.5,699.6,645.5,717,682.1,,,,,,,,3292,3319 -1/31/2020,2/28/2020,29,118,,1,4.07,3.65,570,628,686,718.6,652.2,597.1,670.1,634.4,,,,,,,,3320,3348 -2/29/2020,3/30/2020,31,85,0,0,2.74,2.32,362.6,420.1,478.1, , , , , ,,,,,,,,3349,3379 -3/31/2020,4/30/2020,31,93,,0,3,2.58,267.7,327.7,387.7, , , , , ,,,,,,,,3380,3410 -5/1/2020,5/28/2020,28,36,,0,1.29,0.86,47.2,70.8,96.8, , , , , ,,,,,,,,3411,3438 -5/29/2020,6/29/2020,32,13,,0,0.41,-0.02,0,2,4.5, , , , , ,,,,,,,,3439,3470 -6/30/2020,7/29/2020,30,9,,-1,0.3,-0.12,0,0,0, , , , , ,,,,,,,,3471,3500 -7/30/2020,8/27/2020,29,12,,-1,0.41,-0.01,0,0,0, , , , , ,,,,,,,,3501,3529 -8/28/2020,9/28/2020,32,13,,-1,0.41,-0.02,19.8,29.8,39.8, , , , , ,,,,,,,,3530,3561 -9/29/2020,10/27/2020,29,33,,0,1.14,0.71,60.9,85.7,118.4, , , , , ,,,,,,,,3562,3590 -10/28/2020,11/30/2020,34,100,,0,2.94,2.52,352.2,408.1,465, , , , , ,,,,,,,,3591,3624 -12/1/2020,12/29/2020,29,133,,1,4.59,4.16,567,621,677.2,824.9,753.2,690.7,771.3,735.1,,,,,,,,3625,3653 -12/30/2020,1/29/2021,31,172,0,0,5.55,5.12,696.2,758.2,820.2, , , , , ,,,,,,,,3654,3684 -1/30/2021,2/25/2021,27,167,,1,6.19,5.76,719.2,773.2,827.2,838.1,779.6,728.7,793.1,766.1,,,,,,,,3685,3711 \ No newline at end of file +start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_53.5f,hdd_at_55.5f,hdd_at_57.5f,ua_at_53.5f,ua_at_55.5f,ua_at_57.5f,ua_sensitivity_at_0.32_therms,ua_sensitivity_at_0.52_therms +2018-02-28 00:00:00,2018-03-27 00:00:00,28,132,,1,4.714285714285714,4.290372670807454,534.8000000000001,590.8000000000001,646.8,870.429010438685,787.923890965824,719.7053722674843,806.2888198757765,769.5589620558713 +2018-03-28 00:00:00,2018-04-30 00:00:00,34,98,,0,2.8823529411764706,2.45843989769821,332.1000000000001,393.30000000000007,455.40000000000015,,,,, +2018-05-01 00:00:00,2018-05-30 00:00:00,30,23,,0,0.7666666666666667,0.34275362318840585,14,21.799999999999997,38.9,,,,, +2018-05-31 00:00:00,2018-06-28 00:00:00,29,16,,0,0.5517241379310345,0.1278110944527736,2.1000000000000014,4.100000000000001,9.600000000000001,,,,, +2018-06-29 00:00:00,2018-07-29 00:00:00,31,16,,-1,0.5161290322580645,0.09221598877980364,0,0,0,,,,, +2018-07-30 00:00:00,2018-08-27 00:00:00,29,12,,-1,0.41379310344827586,-0.010119940029985008,0,0,0,,,,, +2018-08-28 00:00:00,2018-09-26 00:00:00,30,16,,-1,0.5333333333333333,0.10942028985507246,3.1999999999999957,7.399999999999999,14.600000000000001,,,,, +2018-09-27 00:00:00,2018-10-25 00:00:00,29,37,,0,1.2758620689655173,0.8519490254872565,106.30000000000001,132.7,171.20000000000002,,,,, +2018-10-26 00:00:00,2018-11-27 00:00:00,33,119,,0,3.606060606060606,3.182147562582345,440.50000000000006,500.6,564.6,,,,, +2018-11-28 00:00:00,2018-12-28 00:00:00,31,151,,1,4.870967741935484,4.447054698457223,600.2,660.2,721.3000000000001,890.0407291772307,809.1524472162586,740.6106275504976,827.3476910817537,790.9572033507634 +2018-12-29 00:00:00,2019-01-29 00:00:00,32,183,,1,5.71875,5.294836956521739,781.8000000000001,845.8000000000001,909.8000000000001,839.8052988087691,776.2589058981978,721.6528716296941,790.9195821810068,761.5982296153886 +2019-01-30 00:00:00,2019-02-28 00:00:00,30,158,,1,5.266666666666667,4.842753623188406,714.4,774.4,834.3999999999999,788.0320670431863,726.9758635016171,674.700513777148,741.9874854024436,711.9642416007907 +2019-03-01 00:00:00,2019-03-27 00:00:00,27,128,,1,4.7407407407407405,4.31682769726248,513.1,566.5,620.4999999999999,880.2340631964274,797.2605433823248,727.8776757874087,815.7292106373998,778.7918761272499 +2019-03-28 00:00:00,2019-04-29 00:00:00,33,64,,0,1.9393939393939394,1.5154808959156787,186.2,237.50000000000006,293.50000000000006,,,,, +2019-04-30 00:00:00,2019-06-03 00:00:00,35,41,,0,1.1714285714285715,0.7475155279503106,52.79999999999999,80,113.29999999999998,,,,, +2019-06-04 00:00:00,2019-06-27 00:00:00,24,11,,0,0.4583333333333333,0.03442028985507245,0,0.20000000000000284,2.200000000000003,,,,, +2019-06-28 00:00:00,2019-07-31 00:00:00,34,13,,-1,0.38235294117647056,-0.0415601023017903,0,0,0,,,,, +2019-08-01 00:00:00,2019-08-28 00:00:00,28,11,,-1,0.39285714285714285,-0.031055900621118016,0,0,0,,,,, +2019-08-29 00:00:00,2019-09-30 00:00:00,33,15,,-1,0.45454545454545453,0.030632411067193666,0,1.5,4,,,,, +2019-10-01 00:00:00,2019-10-25 00:00:00,25,14,,0,0.56,0.1360869565217392,23,43.400000000000006,81.9,,,,, +2019-10-26 00:00:00,2019-11-27 00:00:00,33,100,,0,3.0303030303030303,2.6063899868247695,406.99999999999994,466.29999999999995,527.9999999999999,,,,, +2019-11-28 00:00:00,2020-01-02 00:00:00,36,163,,1,4.527777777777778,4.103864734299517,744.0999999999999,816.0999999999999,888.0999999999999,769.371227569927,701.4938493257968,644.6223740961409,718.5873427702275,684.400355881366 +2020-01-03 00:00:00,2020-01-30 00:00:00,28,124,,1,4.428571428571429,4.004658385093168,569.0999999999999,621.1,673.1000000000001,763.4957560755735,699.5740376470918,645.528799261044,717.0430442482832,682.1050310459003 +2020-01-31 00:00:00,2020-02-28 00:00:00,29,118,,1,4.068965517241379,3.6450524737631183,569.9999999999999,627.9999999999998,685.9999999999998,718.6188977879483,652.249636527278,597.103165800482,670.1437448075328,634.3555282470231 +2020-02-29 00:00:00,2020-03-30 00:00:00,31,85,0,0,2.7419354838709675,2.3180224403927068,362.6,420.09999999999997,478.09999999999997,,,,, +2020-03-31 00:00:00,2020-04-30 00:00:00,31,93,,0,3,2.5760869565217392,267.7,327.70000000000005,387.7,,,,, +2020-05-01 00:00:00,2020-05-28 00:00:00,28,36,,0,1.2857142857142858,0.861801242236025,47.2,70.79999999999998,96.79999999999998,,,,, +2020-05-29 00:00:00,2020-06-29 00:00:00,32,13,,0,0.40625,-0.017663043478260865,0,2,4.5,,,,, +2020-06-30 00:00:00,2020-07-29 00:00:00,30,9,,-1,0.3,-0.12391304347826088,0,0,0,,,,, +2020-07-30 00:00:00,2020-08-27 00:00:00,29,12,,-1,0.41379310344827586,-0.010119940029985008,0,0,0,,,,, +2020-08-28 00:00:00,2020-09-28 00:00:00,32,13,,-1,0.40625,-0.017663043478260865,19.799999999999997,29.799999999999997,39.8,,,,, +2020-09-29 00:00:00,2020-10-27 00:00:00,29,33,,0,1.1379310344827587,0.7140179910044978,60.89999999999999,85.69999999999999,118.39999999999998,,,,, +2020-10-28 00:00:00,2020-11-30 00:00:00,34,100,,0,2.9411764705882355,2.5172634271099747,352.20000000000005,408.1,465,,,,, +2020-12-01 00:00:00,2020-12-29 00:00:00,29,133,,1,4.586206896551724,4.1622938530734634,567,621,677.2,824.9343416915881,753.2009206749283,690.6936971930455,771.296733879437,735.1051074704195 +2020-12-30 00:00:00,2021-01-29 00:00:00,31,172,0,0,5.548387096774194,5.124474053295933,696.1999999999999,758.1999999999999,820.1999999999999,,,,, +2021-01-30 00:00:00,2021-02-25 00:00:00,27,167,,1,6.185185185185185,5.761272141706924,719.2000000000002,773.2,827.2000000000002,838.1160982008996,779.5823820823681,728.6908822849214,793.1138099147529,766.0509542499833 diff --git a/rules-engine/tests/test_rules_engine/cases/examples/cali/summary.json b/rules-engine/tests/test_rules_engine/cases/examples/cali/summary.json index d64361d9..6a2a66b3 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/cali/summary.json +++ b/rules-engine/tests/test_rules_engine/cases/examples/cali/summary.json @@ -6,16 +6,16 @@ "heating_system_efficiency": 0.93, "other_fuel_usage": 0.42, "other_fuel_usage_override": null, - "thermostat_set_point": 69.0, - "setback_temperature": 62.0, - "setback_hours_per_day": 8.0, + "thermostat_set_point": 69, + "setback_temperature": 62, + "setback_hours_per_day": 8, "estimated_balance_point": 55.5, - "balance_point_sensitivity": 2.0, + "balance_point_sensitivity": 2, "average_indoor_temperature": 66.7, "difference_between_ti_and_tbp": 11.2, "design_temperature": 8.4, - "whole_home_heat_loss_rate": 748, + "whole_home_heat_loss_rate": 748.0, "standard_deviation_of_heat_loss_rate": 0.0651, - "average_heat_load": 37743, - "maximum_heat_load": 46099 + "average_heat_load": 37743.0, + "maximum_heat_load": 46099.0 } \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/cases/examples/example-1/natural-gas.csv b/rules-engine/tests/test_rules_engine/cases/examples/example-1/natural-gas.csv index 5dc52993..e107b975 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/example-1/natural-gas.csv +++ b/rules-engine/tests/test_rules_engine/cases/examples/example-1/natural-gas.csv @@ -1,37 +1,37 @@ -start_date,end_date,days_in_bill,usage,inclusion_code,inclusion_override,avg_daily_usage,daily_htg_usage -6/11/2021,7/12/2021,32,18,-1,,0.56,0.05 -5/12/2021,6/10/2021,30,42,0,,1.40,0.89 -4/10/2021,5/11/2021,32,147,0,,4.59,4.08 -3/10/2021,4/9/2021,31,227,0,,7.32,6.81 -2/9/2021,3/9/2021,29,369,1,,12.72,12.22 -1/10/2021,2/8/2021,30,380,1,,12.67,12.16 -12/11/2020,1/9/2021,30,336,1,,11.20,10.69 -11/8/2020,12/10/2020,33,238,1,,7.21,6.70 -10/7/2020,11/7/2020,32,144,0,,4.50,3.99 -9/9/2020,10/6/2020,28,39,0,,1.39,0.88 -8/11/2020,9/8/2020,29,13,-1,,0.45,-0.06 -7/11/2020,8/10/2020,31,17,-1,,0.55,0.04 -6/9/2020,7/10/2020,32,29,-1,,0.91,0.40 -5/12/2020,6/8/2020,28,58,0,,2.07,1.56 -4/9/2020,5/11/2020,33,183,0,,5.55,5.04 -3/12/2020,4/8/2020,28,189,0,,6.75,6.24 -2/11/2020,3/11/2020,30,269,1,,8.97,8.46 -1/11/2020,2/10/2020,31,321,1,,10.35,9.85 -12/12/2019,1/10/2020,30,312,1,,10.40,9.89 -11/8/2019,12/11/2019,34,323,1,,9.50,8.99 -10/10/2019,11/7/2019,29,110,0,,3.79,3.28 -9/12/2019,10/9/2019,28,38,0,,1.36,0.85 -8/13/2019,9/11/2019,30,12,-1,,0.40,-0.11 -7/12/2019,8/12/2019,32,14,-1,,0.44,-0.07 -6/11/2019,7/11/2019,31,13,-1,,0.42,-0.09 -5/10/2019,6/10/2019,32,48,0,,1.50,0.99 -4/10/2019,5/9/2019,30,122,0,,4.07,3.56 -3/12/2019,4/9/2019,29,230,0,,7.93,7.42 -2/12/2019,3/11/2019,28,360,1,,12.86,12.35 -1/10/2019,2/11/2019,33,453,1,,13.73,13.22 -12/8/2018,1/9/2019,33,349,1,,10.58,10.07 -11/7/2018,12/7/2018,31,282,1,,9.10,8.59 -10/10/2018,11/6/2018,28,139,0,,4.96,4.46 -9/9/2018,10/9/2018,31,23,0,,0.74,0.23 -8/9/2018,9/8/2018,31,12,-1,,0.39,-0.12 -7/11/2018,8/8/2018,29,13,-1,,0.45,-0.06 \ No newline at end of file +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.41_therms,ua_sensitivity_at_0.61_therms +2021-06-11 00:00:00,2021-07-12 00:00:00,32,18,,-1,0.5625,0.05347472924187724,0.5,1.5,2.700000000000003,,,,, +2021-05-12 00:00:00,2021-06-10 00:00:00,30,42,,0,1.4,0.8909747292418772,35.50000000000001,42.50000000000001,50.70000000000002,,,,, +2021-04-10 00:00:00,2021-05-11 00:00:00,32,147,,0,4.59375,4.084724729241877,219.10000000000002,248.40000000000003,278.4,,,,, +2021-03-10 00:00:00,2021-04-09 00:00:00,31,227,,0,7.32258064516129,6.813555374403167,407.79999999999995,437.69999999999993,467.9999999999999,,,,, +2021-02-09 00:00:00,2021-03-09 00:00:00,29,369,,1,12.724137931034482,12.21511266027636,790.4999999999999,819.4999999999999,848.4999999999999,1680.4471876091768,1620.9804781025678,1565.5786703654146,1634.2507648627875,1607.7101913423483 +2021-01-10 00:00:00,2021-02-08 00:00:00,30,380,,1,12.666666666666666,12.157641395908543,850.2,880.2,910.2,1608.7210739116808,1553.8907714607033,1502.6748594151957,1566.6719575547727,1541.1095853666338 +2020-12-11 00:00:00,2021-01-09 00:00:00,30,336,,1,11.2,10.690974729241876,723.5000000000001,753.5000000000001,783.5000000000001,1662.383769232496,1596.1972887056547,1535.0793325331344,1611.127613854958,1581.2669635563514 +2020-11-08 00:00:00,2020-12-10 00:00:00,33,238,,1,7.212121212121212,6.703095941363089,473.1,504.6,536.6,1753.3462750870478,1643.8924350845866,1545.859341676635,1668.4168108277495,1619.368059341424 +2020-10-07 00:00:00,2020-11-07 00:00:00,32,144,,0,4.5,3.990974729241877,244.7,268,293.79999999999995,,,,, +2020-09-09 00:00:00,2020-10-06 00:00:00,28,39,,0,1.3928571428571428,0.88383187209902,73.30000000000001,85.30000000000001,99.6,,,,, +2020-08-11 00:00:00,2020-09-08 00:00:00,29,13,,-1,0.4482758620689655,-0.060749408689157236,0,0,0.5,,,,, +2020-07-11 00:00:00,2020-08-10 00:00:00,31,17,,-1,0.5483870967741935,0.039361826016070744,0,0,0,,,,, +2020-06-09 00:00:00,2020-07-10 00:00:00,32,29,,-1,0.90625,0.39722472924187724,0,0,1.1000000000000014,,,,, +2020-05-12 00:00:00,2020-06-08 00:00:00,28,58,,0,2.0714285714285716,1.5624033006704487,53.39999999999999,65.89999999999999,78.89999999999999,,,,, +2020-04-09 00:00:00,2020-05-11 00:00:00,33,183,,0,5.545454545454546,5.036429274696423,354.6,384.90000000000003,415.90000000000003,,,,, +2020-03-12 00:00:00,2020-04-08 00:00:00,28,189,,0,6.75,6.240974729241877,424.9000000000001,452.9000000000001,480.90000000000015,,,,, +2020-02-11 00:00:00,2020-03-11 00:00:00,30,269,,1,8.966666666666667,8.457641395908544,569.0999999999999,599.0999999999999,629.0999999999998,1671.911187910229,1588.190046803057,1512.453754633145,1606.9682140539333,1569.4118795521808 +2020-01-11 00:00:00,2020-02-10 00:00:00,31,321,,1,10.35483870967742,9.845813438919297,702.1,731.1,760.1,1630.2176502982027,1565.5530191141677,1505.8226710621866,1581.4537166931582,1549.6523215351772 +2019-12-12 00:00:00,2020-01-10 00:00:00,30,312,,1,10.4,9.890974729241877,680.4,710.4,740.4,1635.412488300575,1566.349460923017,1502.8831132356986,1582.1856095716655,1550.5133122743682 +2019-11-08 00:00:00,2019-12-11 00:00:00,34,323,,1,9.5,8.990974729241877,723.7999999999998,757.7999999999998,791.7999999999998,1583.7928681657081,1512.7332778811553,1447.7763045950235,1529.5582976752962,1495.9082580870145 +2019-10-10 00:00:00,2019-11-07 00:00:00,29,110,,0,3.793103448275862,3.2840781775177392,200.50000000000003,227.50000000000003,255.00000000000003,,,,, +2019-09-12 00:00:00,2019-10-09 00:00:00,28,38,,0,1.3571428571428572,0.8481175863847344,43.59999999999999,55.59999999999999,70,,,,, +2019-08-13 00:00:00,2019-09-11 00:00:00,30,12,,-1,0.4,-0.10902527075812274,0,0,0,,,,, +2019-07-12 00:00:00,2019-08-12 00:00:00,32,14,,-1,0.4375,-0.07152527075812276,0,0,0,,,,, +2019-06-11 00:00:00,2019-07-11 00:00:00,31,13,,-1,0.41935483870967744,-0.08967043204844533,3.200000000000003,4.200000000000003,5.200000000000003,,,,, +2019-05-10 00:00:00,2019-06-10 00:00:00,32,48,,0,1.5,0.9909747292418772,55.4,65.4,76.9,,,,, +2019-04-10 00:00:00,2019-05-09 00:00:00,30,122,,0,4.066666666666666,3.5576413959085436,178.99999999999997,201.99999999999997,226.89999999999998,,,,, +2019-03-12 00:00:00,2019-04-09 00:00:00,29,230,,0,7.931034482758621,7.422009212000498,460.29999999999995,489.29999999999995,518.3,,,,, +2019-02-12 00:00:00,2019-03-11 00:00:00,28,360,,1,12.857142857142858,12.348117586384735,775.6,803.6,831.6,1671.67656855389,1613.429998221002,1559.1057558566586,1626.4962003115945,1600.3637961304098 +2019-01-10 00:00:00,2019-02-11 00:00:00,33,453,,1,13.727272727272727,13.218247456514604,962.2,995.2,1028.2,1700.018834695159,1643.6476313742787,1590.8948869321941,1656.0823178694554,1631.2129448791018 +2018-12-08 00:00:00,2019-01-09 00:00:00,33,349,,1,10.575757575757576,10.066732304999453,738.6999999999999,771.6999999999999,804.6999999999999,1686.4195515685428,1614.303644866765,1548.102550942814,1630.3396692285635,1598.2676205049663 +2018-11-07 00:00:00,2018-12-07 00:00:00,31,282,,1,9.096774193548388,8.587748922790265,602.2,633.2,664.2,1657.7977619966264,1576.6358374516242,1503.0500034242223,1594.9949656891479,1558.2767092141005 +2018-10-10 00:00:00,2018-11-06 00:00:00,28,139,,0,4.964285714285714,4.4552604435275915,264.80000000000007,289.80000000000007,314.80000000000007,,,,, +2018-09-09 00:00:00,2018-10-09 00:00:00,31,23,,0,0.7419354838709677,0.232910213112845,12.900000000000006,20.60000000000001,31.60000000000001,,,,, +2018-08-09 00:00:00,2018-09-08 00:00:00,31,12,,-1,0.3870967741935484,-0.12192849656457438,0,0,0,,,,, +2018-07-11 00:00:00,2018-08-08 00:00:00,29,13,,-1,0.4482758620689655,-0.060749408689157236,0,0,0,,,,, diff --git a/rules-engine/tests/test_rules_engine/cases/examples/example-1/summary.json b/rules-engine/tests/test_rules_engine/cases/examples/example-1/summary.json index fa98b7c3..7c4accb5 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/example-1/summary.json +++ b/rules-engine/tests/test_rules_engine/cases/examples/example-1/summary.json @@ -6,16 +6,16 @@ "heating_system_efficiency": 0.9, "other_fuel_usage": 0.51, "other_fuel_usage_override": null, - "thermostat_set_point": 68.0, - "setback_temperature": 58.0, - "setback_hours_per_day": 7.0, - "estimated_balance_point": 60.0, - "balance_point_sensitivity": 1.0, + "thermostat_set_point": 68, + "setback_temperature": 58, + "setback_hours_per_day": 7, + "estimated_balance_point": 60, + "balance_point_sensitivity": 1, "average_indoor_temperature": 65.1, "difference_between_ti_and_tbp": 5.1, "design_temperature": 9, - "whole_home_heat_loss_rate": 1591, + "whole_home_heat_loss_rate": 1591.0, "standard_deviation_of_heat_loss_rate": 0.0233, - "average_heat_load": 88981, - "maximum_heat_load": 97070 + "average_heat_load": 88981.0, + "maximum_heat_load": 97070.0 } \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/cases/examples/example-2/oil-propane.csv b/rules-engine/tests/test_rules_engine/cases/examples/example-2/oil-propane.csv new file mode 100644 index 00000000..c0440f52 --- /dev/null +++ b/rules-engine/tests/test_rules_engine/cases/examples/example-2/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_51.5f,hdd_at_53.5f,hdd_at_55.5f,ua_at_51.5f,ua_at_53.5f,ua_at_55.5f,ua_sensitivity_at_-0.1_therms,ua_sensitivity_at_0.1_therms +2020-10-27 00:00:00,2020-12-18 00:00:00,126.6,53,1,,2.3886792452830186,2.3886792452830186,610.3000000000001,698.4999999999998,790.3999999999999,965.2826478780926,843.3958482462422,745.3340080971659,, +2020-12-19 00:00:00,2021-01-30 00:00:00,184,43,1,,4.27906976744186,4.27906976744186,878.5,962.4999999999999,1046.5,974.6309998102827,889.5722943722946,818.1684981684982,, +2021-01-31 00:00:00,2021-03-09 00:00:00,164.5,38,1,,4.328947368421052,4.328947368421052,864.5,940.5,1016.5000000000001,885.452091767881,813.9004075846179,753.0480406624034,, +2021-03-10 00:00:00,2021-06-16 00:00:00,122.4,99,0,,1.2363636363636363,1.2363636363636363,314.29999999999984,404.3999999999999,511.90000000000003,,,,, diff --git a/rules-engine/tests/test_rules_engine/cases/examples/example-2/summary.json b/rules-engine/tests/test_rules_engine/cases/examples/example-2/summary.json index 97d26880..b4434206 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/example-2/summary.json +++ b/rules-engine/tests/test_rules_engine/cases/examples/example-2/summary.json @@ -4,18 +4,18 @@ "living_area": 2824, "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, - "setback_temperature": 60.0, - "setback_hours_per_day": 7.0, + "thermostat_set_point": 68, + "setback_temperature": 60, + "setback_hours_per_day": 7, "estimated_balance_point": 53.5, - "balance_point_sensitivity": 2.0, + "balance_point_sensitivity": 2, "average_indoor_temperature": 65.7, "difference_between_ti_and_tbp": 12.2, "design_temperature": 8.4, - "whole_home_heat_loss_rate": 849, + "whole_home_heat_loss_rate": 849.0, "standard_deviation_of_heat_loss_rate": 0.0367, - "average_heat_load": 41967, - "maximum_heat_load": 52296 + "average_heat_load": 41967.0, + "maximum_heat_load": 52296.0 } \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/cases/examples/example-4/natural-gas.csv b/rules-engine/tests/test_rules_engine/cases/examples/example-4/natural-gas.csv index 942bb7f9..3c3bd523 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/example-4/natural-gas.csv +++ b/rules-engine/tests/test_rules_engine/cases/examples/example-4/natural-gas.csv @@ -1,21 +1,21 @@ -start_date,end_date,days_in_bill,usage,inclusion_code,inclusion_override,avg_daily_usage,daily_htg_usage -11/14/2019,12/16/2019,33,216,1,,6.55,6.28 -12/17/2019,1/15/2020,30,194,1,,6.47,6.20 -1/16/2020,2/13/2020,29,220,1,,7.59,7.32 -2/14/2020,3/16/2020,32,176,1,,5.50,5.23 -3/17/2020,4/16/2020,31,144,0,,4.65,4.38 -4/17/2020,5/14/2020,28,95,0,,3.39,3.13 -5/15/2020,6/15/2020,32,25,0,,0.78,0.52 -6/16/2020,7/16/2020,31,13,-1,,0.42,0.15 -7/17/2020,8/14/2020,29,9,-1,,0.31,0.04 -8/15/2020,9/14/2020,31,5,-1,,0.16,-0.10 -9/15/2020,10/13/2020,29,42,0,,1.45,1.18 -10/14/2020,11/13/2020,31,101,0,,3.26,2.99 -11/14/2020,12/16/2020,33,192,1,,5.82,5.55 -12/17/2020,1/14/2021,29,221,1,,7.62,7.35 -1/15/2021,2/12/2021,29,227,1,,7.83,7.56 -2/13/2021,3/16/2021,32,230,1,,7.19,6.92 -3/17/2021,4/16/2021,31,113,0,,3.65,3.38 -4/17/2021,5/18/2021,32,79,0,,2.47,2.20 -5/19/2021,6/16/2021,29,19,0,,0.66,0.39 -6/17/2021,7/19/2021,33,6,-1,,0.18,-0.08 \ No newline at end of file +start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_60.5f,hdd_at_62.5f,hdd_at_64.5f,ua_at_60.5f,ua_at_62.5f,ua_at_64.5f,ua_sensitivity_at_0.17_therms,ua_sensitivity_at_0.37_therms +2019-11-14 00:00:00,2019-12-16 00:00:00,33,216,,1,6.545454545454546,6.279325513196481,833.1,899.1,965.1,994.923739937505,921.8896315670509,858.8446458832613,936.5709795817322,907.2082835523695 +2019-12-17 00:00:00,2020-01-15 00:00:00,30,194,,1,6.466666666666667,6.200537634408603,759.7,819.7,879.7,979.4188707766648,907.7278469306237,845.8162056712882,922.3673491875469,893.0883446737005 +2020-01-16 00:00:00,2020-02-13 00:00:00,29,220,,1,7.586206896551724,7.32007786429366,845.8000000000002,903.8000000000002,961.8000000000002,1003.935956796009,939.5098830029481,882.8540572448164,952.3445809449706,926.6751850609255 +2020-02-14 00:00:00,2020-03-16 00:00:00,32,176,,1,5.5,5.233870967741936,710.1999999999999,774.2,838.2,943.3053842170766,865.3261222823141,799.2549318431969,881.8593178390179,848.7929267256105 +2020-03-17 00:00:00,2020-04-16 00:00:00,31,144,,0,4.645161290322581,4.379032258064516,507.6,569.6,631.6,,,,, +2020-04-17 00:00:00,2020-05-14 00:00:00,28,95,,0,3.392857142857143,3.1267281105990783,351.3999999999999,405.2,459.59999999999997,,,,, +2020-05-15 00:00:00,2020-06-15 00:00:00,32,25,,0,0.78125,0.5151209677419355,41.7,67.10000000000002,101.49999999999997,,,,, +2020-06-16 00:00:00,2020-07-16 00:00:00,31,13,,-1,0.41935483870967744,0.15322580645161293,0,1.1000000000000014,5,,,,, +2020-07-17 00:00:00,2020-08-14 00:00:00,29,9,,-1,0.3103448275862069,0.044215795328142404,0,0,0,,,,, +2020-08-15 00:00:00,2020-09-14 00:00:00,31,5,,-1,0.16129032258064516,-0.10483870967741934,3.3999999999999986,9.599999999999994,22.199999999999996,,,,, +2020-09-15 00:00:00,2020-10-13 00:00:00,29,42,,0,1.4482758620689655,1.182146829810901,134,174.8,221.8,,,,, +2020-10-14 00:00:00,2020-11-13 00:00:00,31,101,,0,3.2580645161290325,2.991935483870968,329.79999999999995,386.29999999999995,446.29999999999995,,,,, +2020-11-14 00:00:00,2020-12-16 00:00:00,33,192,,1,5.818181818181818,5.552052785923754,720.7999999999998,786.7999999999998,852.7999999999998,1016.7466256131182,931.4577627630092,859.3702717424198,948.2345802515704,914.6809452744479 +2020-12-17 00:00:00,2021-01-14 00:00:00,29,221,,1,7.620689655172414,7.354560622914349,832.6,890.6,948.6,1024.6565364617636,957.926153444941,899.3559269007637,970.9510804604361,944.9012264294458 +2021-01-15 00:00:00,2021-02-12 00:00:00,29,227,,1,7.827586206896552,7.5614571746384875,969.6,1027.6,1085.6,904.6297774938784,853.5704868217833,807.967052559013,864.8589259031379,842.2820477404288 +2021-02-13 00:00:00,2021-03-16 00:00:00,32,230,,1,7.1875,6.921370967741936,895.6999999999999,959.6999999999999,1023.6999999999999,989.0984524628423,923.1379429727705,865.4249134228463,936.4754442752608,909.8004416702802 +2021-03-17 00:00:00,2021-04-16 00:00:00,31,113,,0,3.6451612903225805,3.379032258064516,417.80000000000007,479.00000000000006,541.0000000000001,,,,, +2021-04-17 00:00:00,2021-05-18 00:00:00,32,79,,0,2.46875,2.2026209677419355,219.20000000000002,278.80000000000007,342.50000000000006,,,,, +2021-05-19 00:00:00,2021-06-16 00:00:00,29,19,,0,0.6551724137931034,0.3890433815350389,43.1,57.4,81,,,,, +2021-06-17 00:00:00,2021-07-19 00:00:00,33,6,,-1,0.18181818181818182,-0.08431085043988268,3.5,8.600000000000001,21.6,,,,, diff --git a/rules-engine/tests/test_rules_engine/cases/examples/example-4/summary.json b/rules-engine/tests/test_rules_engine/cases/examples/example-4/summary.json index fffc47af..aa778abb 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/example-4/summary.json +++ b/rules-engine/tests/test_rules_engine/cases/examples/example-4/summary.json @@ -6,16 +6,16 @@ "heating_system_efficiency": 0.96, "other_fuel_usage": 0.27, "other_fuel_usage_override": null, - "thermostat_set_point": 70.0, - "setback_temperature": 68.0, - "setback_hours_per_day": 6.0, + "thermostat_set_point": 70, + "setback_temperature": 68, + "setback_hours_per_day": 6, "estimated_balance_point": 62.5, - "balance_point_sensitivity": 0.5, + "balance_point_sensitivity": 2, "average_indoor_temperature": 69.5, - "difference_between_ti_and_tbp": 7.0, + "difference_between_ti_and_tbp": 7, "design_temperature": 8.4, - "whole_home_heat_loss_rate": 913, + "whole_home_heat_loss_rate": 913.0, "standard_deviation_of_heat_loss_rate": 0.0369, - "average_heat_load": 49826, - "maximum_heat_load": 56214 + "average_heat_load": 49826.0, + "maximum_heat_load": 56214.0 } \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/cases/examples/feldman/natural-gas.csv b/rules-engine/tests/test_rules_engine/cases/examples/feldman/natural-gas.csv index 167913dc..6b510f46 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/feldman/natural-gas.csv +++ b/rules-engine/tests/test_rules_engine/cases/examples/feldman/natural-gas.csv @@ -1,37 +1,37 @@ -start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_60.5f,hdd_at_61.5f,hdd_at_62.5f,ua_at_60.5f,ua_at_61.5f,ua_at_62.5f,ua_sensitivity_at_0.36_therms,ua_sensitivity_at_0.56_therms,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/23/2019,2/19/2019,28,200,,1,7.14,6.69,837.6,865.6,893.6,838.2,811.1,785.7,823.2,799,,,,,,,,2947,2974 -2/20/2019,3/20/2019,29,191,,1,6.59,6.13,836.6,865.6,894.6,796.8,770.1,745.2,782.7,757.6,,,,,,,,2975,3003 -3/21/2019,4/19/2019,30,115,,0,3.83,3.38,449.5,477.5,505.5, , , , , ,,,,,,,,3004,3033 -4/20/2019,5/17/2019,28,67,,0,2.39,1.94,231.3,256.6,282.6, , , , , ,,,,,,,,3034,3061 -5/18/2019,6/18/2019,32,30,,0,0.94,0.48,26.3,35.6,49, , , , , ,,,,,,,,3062,3093 -6/19/2019,7/18/2019,30,13,,-1,0.43,-0.02,0,0,0, , , , , ,,,,,,,,3094,3123 -7/19/2019,8/19/2019,32,14,,-1,0.44,-0.02,0,0,0, , , , , ,,,,,,,,3124,3155 -8/20/2019,9/17/2019,29,13,,-1,0.45,-0.01,3.5,7.3,11.3, , , , , ,,,,,,,,3156,3184 -9/18/2019,10/22/2019,35,43,,0,1.23,0.77,146.8,170.1,195.7, , , , , ,,,,,,,,3185,3219 -10/23/2019,11/20/2019,29,115,,0,3.97,3.51,497.8,525.8,553.8, , , , , ,,,,,,,,3220,3248 -11/21/2019,12/17/2019,27,161,,1,5.96,5.51,683.1,710.1,737.1,816.2,785.2,756.4,799.4,770.9,,,,,,,,3249,3275 -12/18/2019,1/21/2020,35,234,,1,6.69,6.23,955.2,990.2,1025.2,856,825.7,797.5,839,812.5,,,,,,,,3276,3310 -1/22/2020,2/19/2020,29,177,,1,6.1,5.65,802.8,831.8,860.8,765,738.3,713.5,751.4,725.2,,,,,,,,3311,3339 -2/20/2020,3/19/2020,29,146,,1,5.03,4.58,583.7,612.7,641.7,853,812.6,775.9,830.4,794.9,,,,,,,,3340,3368 -3/20/2020,4/17/2020,29,118,,0,4.07,3.61,467.6,496.6,525.6, , , , , ,,,,,,,,3369,3397 -4/18/2020,5/19/2020,32,93,,0,2.91,2.45,344.9,373.7,403.7, , , , , ,,,,,,,,3398,3429 -5/20/2020,6/18/2020,30,25,,0,0.83,0.38,29.8,38,49.3, , , , , ,,,,,,,,3430,3459 -6/19/2020,7/17/2020,29,16,,-1,0.55,0.1,0,0,0, , , , , ,,,,,,,,3460,3488 -7/18/2020,8/18/2020,32,16,,-1,0.5,0.04,0,0,0, , , , , ,,,,,,,,3489,3520 -8/19/2020,9/17/2020,30,15,,-1,0.5,0.04,12.4,16.8,22.6, , , , , ,,,,,,,,3521,3550 -9/18/2020,10/20/2020,33,43,,0,1.3,0.85,181.5,205.7,232.3, , , , , ,,,,,,,,3551,3583 -10/21/2020,11/18/2020,29,91,,0,3.14,2.68,383.5,408.9,436, , , , , ,,,,,,,,3584,3612 -11/19/2020,12/21/2020,33,186,,1,5.64,5.18,797.6,830.6,863.6,803.7,771.8,742.3,786.7,756.9,,,,,,,,3613,3645 -12/22/2020,1/20/2021,30,189,,1,6.3,5.84,788.4,818.4,848.4,833.9,803.3,774.9,817.1,789.6,,,,,,,,3646,3675 -1/21/2021,2/18/2021,29,229,,1,7.9,7.44,1022.6,1051.6,1080.6,791.3,769.4,748.8,779.8,759.1,,,,,,,,3676,3704 -2/19/2021,3/17/2021,27,164,,1,6.07,5.62,720.8,747.8,774.8,789.1,760.6,734.1,774.2,747.1,,,,,,,,3705,3731 -3/18/2021,4/16/2021,30,96,,0,3.2,2.74,396.9,426.1,456.1, , , , , ,,,,,,,,3732,3761 -4/17/2021,5/18/2021,32,68,,0,2.13,1.67,219.2,248.3,278.8, , , , , ,,,,,,,,3762,3793 -5/19/2021,6/17/2021,30,23,,0,0.77,0.31,43.1,49.1,57.6, , , , , ,,,,,,,,3794,3823 -6/18/2021,7/19/2021,32,11,,-1,0.34,-0.11,3.5,4.9,8.4, , , , , ,,,,,,,,3824,3855 -7/20/2021,8/17/2021,29,14,,-1,0.48,0.03,0,0,0, , , , , ,,,,,,,,3856,3884 -8/18/2021,9/17/2021,31,13,,-1,0.42,-0.04,0,0,1.5, , , , , ,,,,,,,,3885,3915 -9/18/2021,10/19/2021,32,28,,0,0.88,0.42,62.6,80.4,99.6, , , , , ,,,,,,,,3916,3947 -10/20/2021,11/18/2021,30,89,,0,2.97,2.51,380.3,408.3,436.4, , , , , ,,,,,,,,3948,3977 -11/19/2021,12/17/2021,29,124,,1,4.28,3.82,614.7,643.7,672.7,675.8,645.3,617.5,662.2,628.4,,,,,,,,3978,4006 -12/18/2021,1/18/2022,32,184,,1,5.75,5.29,968.4,1000.4,1032.4,656,635,615.3,647,623,,,,,,,,4007,4038 \ No newline at end of file +start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_60.5f,hdd_at_61.5f,hdd_at_62.5f,ua_at_60.5f,ua_at_61.5f,ua_at_62.5f,ua_sensitivity_at_0.36_therms,ua_sensitivity_at_0.56_therms +2019-01-23 00:00:00,2019-02-19 00:00:00,28,200,,1,7.142857142857143,6.6866527632951,837.6,865.6,893.5999999999999,838.2265283500303,811.1119918507226,785.6966653379426,823.2423060836246,798.9816776178205 +2019-02-20 00:00:00,2019-03-20 00:00:00,29,191,,1,6.586206896551724,6.130002516989681,836.5999999999999,865.5999999999999,894.5999999999999,796.8417089679989,770.1453023597827,745.1797157641715,782.7088421010027,757.5817626185627 +2019-03-21 00:00:00,2019-04-19 00:00:00,30,115,,0,3.8333333333333335,3.37712895377129,449.49999999999994,477.4999999999999,505.4999999999999,,,,, +2019-04-20 00:00:00,2019-05-17 00:00:00,28,67,,0,2.392857142857143,1.936652763295099,231.29999999999998,256.59999999999997,282.59999999999997,,,,, +2019-05-18 00:00:00,2019-06-18 00:00:00,32,30,,0,0.9375,0.4812956204379562,26.300000000000004,35.60000000000001,49.000000000000014,,,,, +2019-06-19 00:00:00,2019-07-18 00:00:00,30,13,,-1,0.43333333333333335,-0.022871046228710445,0,0,0,,,,, +2019-07-19 00:00:00,2019-08-19 00:00:00,32,14,,-1,0.4375,-0.018704379562043794,0,0,0,,,,, +2019-08-20 00:00:00,2019-09-17 00:00:00,29,13,,-1,0.4482758620689655,-0.007928517493078269,3.5,7.299999999999997,11.299999999999997,,,,, +2019-09-18 00:00:00,2019-10-22 00:00:00,35,43,,0,1.2285714285714286,0.7723670490093848,146.8,170.09999999999997,195.7,,,,, +2019-10-23 00:00:00,2019-11-20 00:00:00,29,115,,0,3.9655172413793105,3.509312861817267,497.79999999999995,525.8,553.8,,,,, +2019-11-21 00:00:00,2019-12-17 00:00:00,27,161,,1,5.962962962962963,5.506758583400919,683.1,710.1,737.1,816.2191576187132,785.1842086598268,756.422882335291,799.4427637929067,770.925653526747 +2019-12-18 00:00:00,2020-01-21 00:00:00,35,234,,1,6.685714285714286,6.229509906152242,955.1999999999999,990.1999999999999,1025.2,855.9706607856803,825.7151839855401,797.5255317815858,838.970081985944,812.4602859851361 +2020-01-22 00:00:00,2020-02-19 00:00:00,29,177,,1,6.103448275862069,5.647243896300026,802.8000000000001,831.8000000000001,860.8000000000001,764.9947355787592,738.3238443407404,713.4500159417146,751.3979006042651,725.2497880772156 +2020-02-20 00:00:00,2020-03-19 00:00:00,29,146,,1,5.0344827586206895,4.578278379058646,583.7000000000002,612.7000000000002,641.7,852.985735348,812.6126550067368,775.8886921032066,830.361961355684,794.8633486577896 +2020-03-20 00:00:00,2020-04-17 00:00:00,29,118,,0,4.068965517241379,3.6127611376793354,467.59999999999997,496.59999999999997,525.6,,,,, +2020-04-18 00:00:00,2020-05-19 00:00:00,32,93,,0,2.90625,2.4500456204379564,344.8999999999999,373.69999999999993,403.69999999999993,,,,, +2020-05-20 00:00:00,2020-06-18 00:00:00,30,25,,0,0.8333333333333334,0.3771289537712896,29.800000000000004,38.00000000000001,49.300000000000004,,,,, +2020-06-19 00:00:00,2020-07-17 00:00:00,29,16,,-1,0.5517241379310345,0.09551975836899068,0,0,0,,,,, +2020-07-18 00:00:00,2020-08-18 00:00:00,32,16,,-1,0.5,0.043795620437956206,0,0,0,,,,, +2020-08-19 00:00:00,2020-09-17 00:00:00,30,15,,-1,0.5,0.043795620437956206,12.399999999999999,16.799999999999997,22.599999999999994,,,,, +2020-09-18 00:00:00,2020-10-20 00:00:00,33,43,,0,1.303030303030303,0.8468259234682591,181.5,205.7,232.3,,,,, +2020-10-21 00:00:00,2020-11-18 00:00:00,29,91,,0,3.1379310344827585,2.681726654920715,383.4999999999999,408.89999999999986,435.9999999999999,,,,, +2020-11-19 00:00:00,2020-12-21 00:00:00,33,186,,1,5.636363636363637,5.180159256801593,797.5999999999999,830.5999999999999,863.5999999999998,803.7170361449313,771.7851047787108,742.2935479726694,786.6839730666953,756.8862364907262 +2020-12-22 00:00:00,2021-01-20 00:00:00,30,189,,1,6.3,5.843795620437956,788.4000000000001,818.4000000000001,848.4000000000001,833.8749458387493,803.3076824282381,774.9021773918788,817.0540167390884,789.5613481173876 +2021-01-21 00:00:00,2021-02-18 00:00:00,29,229,,1,7.896551724137931,7.440347344575887,1022.6,1051.6,1080.6,791.2554016454408,769.4349312691403,748.7856503078178,779.776315826006,759.0935467122746 +2021-02-19 00:00:00,2021-03-17 00:00:00,27,164,,1,6.074074074074074,5.617869694512031,720.7999999999998,747.7999999999998,774.7999999999998,789.1361078930955,760.6436300740081,734.136947043551,774.1833465757464,747.1039135722697 +2021-03-18 00:00:00,2021-04-16 00:00:00,30,96,,0,3.2,2.7437956204379566,396.90000000000003,426.1000000000001,456.1000000000001,,,,, +2021-04-17 00:00:00,2021-05-18 00:00:00,32,68,,0,2.125,1.6687956204379562,219.20000000000002,248.30000000000004,278.80000000000007,,,,, +2021-05-19 00:00:00,2021-06-17 00:00:00,30,23,,0,0.7666666666666667,0.3104622871046229,43.1,49.1,57.6,,,,, +2021-06-18 00:00:00,2021-07-19 00:00:00,32,11,,-1,0.34375,-0.1124543795620438,3.5,4.899999999999999,8.399999999999999,,,,, +2021-07-20 00:00:00,2021-08-17 00:00:00,29,14,,-1,0.4827586206896552,0.0265542411276114,0,0,0,,,,, +2021-08-18 00:00:00,2021-09-17 00:00:00,31,13,,-1,0.41935483870967744,-0.03684954085236636,0,0,1.5,,,,, +2021-09-18 00:00:00,2021-10-19 00:00:00,32,28,,0,0.875,0.4187956204379562,62.6,80.39999999999999,99.60000000000001,,,,, +2021-10-20 00:00:00,2021-11-18 00:00:00,30,89,,0,2.966666666666667,2.510462287104623,380.30000000000007,408.30000000000007,436.40000000000003,,,,, +2021-11-19 00:00:00,2021-12-17 00:00:00,29,124,,1,4.275862068965517,3.8196576894034733,614.7,643.7,672.6999999999999,675.7569118637183,645.3126824959261,617.4933458044115,662.2071985748448,628.4181664170073 +2021-12-18 00:00:00,2022-01-18 00:00:00,32,184,,1,5.75,5.293795620437956,968.4000000000001,1000.4000000000001,1032.4,655.9845874148643,635.0014738630094,615.3191344949192,646.9966757822417,623.0062719437772 diff --git a/rules-engine/tests/test_rules_engine/cases/examples/feldman/summary.json b/rules-engine/tests/test_rules_engine/cases/examples/feldman/summary.json index a2cc9d1b..f5ec9bec 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/feldman/summary.json +++ b/rules-engine/tests/test_rules_engine/cases/examples/feldman/summary.json @@ -3,19 +3,19 @@ "design_temperature_override": null, "living_area": 1662, "fuel_type": "GAS", - "heating_system_efficiency": 0.90, + "heating_system_efficiency": 0.9, "other_fuel_usage": 0.46, "other_fuel_usage_override": null, - "thermostat_set_point": 67.0, - "setback_temperature": 63.0, - "setback_hours_per_day": 7.0, + "thermostat_set_point": 67, + "setback_temperature": 63, + "setback_hours_per_day": 7, "estimated_balance_point": 61.5, - "balance_point_sensitivity": 1.0, + "balance_point_sensitivity": 1, "average_indoor_temperature": 65.8, "difference_between_ti_and_tbp": 4.3, "design_temperature": 8.4, - "whole_home_heat_loss_rate": 761, + "whole_home_heat_loss_rate": 761.0, "standard_deviation_of_heat_loss_rate": 0.0776, - "average_heat_load": 43564, - "maximum_heat_load": 46860 + "average_heat_load": 43564.0, + "maximum_heat_load": 46860.0 } \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/cases/examples/lewitus/natural-gas.csv b/rules-engine/tests/test_rules_engine/cases/examples/lewitus/natural-gas.csv index 0764197d..1a62dc81 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/lewitus/natural-gas.csv +++ b/rules-engine/tests/test_rules_engine/cases/examples/lewitus/natural-gas.csv @@ -1,37 +1,37 @@ -start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_57.5f,hdd_at_59.5f,hdd_at_61.5f,ua_at_57.5f,ua_at_59.5f,ua_at_61.5f,ua_sensitivity_at_0.42_therms,ua_sensitivity_at_0.62_therms,unused1,estimated_heating_use_therms,estimated_other_use_therms,estimated_total_use_therms,estimated_savings_therms,estimated_savings_percent,unused2,start_row,end_row -3/17/2018,4/17/2018,32,222,,0,6.94,6.41,625.8,689.8,753.8, , , , , ,,,,,,,,2635,2666 -4/18/2018,5/17/2018,30,72,,0,2.4,1.88,137.2,175.3,221.9, , , , , ,,,,,,,,2667,2696 -5/18/2018,6/19/2018,33,48,,0,1.45,0.93,24.9,40.3,59.9, , , , , ,,,,,,,,2697,2729 -6/20/2018,7/17/2018,28,13,,-1,0.46,-0.06,0,0,1.8, , , , , ,,,,,,,,2730,2757 -7/18/2018,8/16/2018,30,11,,-1,0.37,-0.16,0,0,0, , , , , ,,,,,,,,2758,2787 -8/17/2018,9/18/2018,33,17,,-1,0.52,-0.01,2.2,5.3,9.3, , , , , ,,,,,,,,2788,2820 -9/19/2018,10/16/2018,28,35,,0,1.25,0.73,63.3,97.3,131.7, , , , , ,,,,,,,,2821,2848 -10/17/2018,11/15/2018,30,167,,0,5.57,5.04,404.7,462.7,520.7, , , , , ,,,,,,,,2849,2878 -11/16/2018,12/15/2018,30,278,,1,9.27,8.74,720.4,780.4,840.4,"1,365.30","1,260.30","1,170.40","1,274.80","1,245.90",,,,,,,,2879,2908 -12/16/2018,1/16/2019,32,303,,1,9.47,8.94,790.7,854.7,918.7,"1,357.50","1,255.90","1,168.40","1,269.90","1,241.80",,,,,,,,2909,2940 -1/17/2019,2/15/2019,30,329,,1,10.97,10.44,860.7,920.7,980.7,"1,365.00","1,276.00","1,197.90","1,288.20","1,263.80",,,,,,,,2941,2970 -2/16/2019,3/18/2019,31,268,,1,8.65,8.12,822,884,946,"1,148.50","1,068.00",998,"1,081.10","1,054.80",,,,,,,,2971,3001 -3/19/2019,4/17/2019,30,147,,0,4.9,4.38,400.9,457.8,515.8, , , , , ,,,,,,,,3002,3031 -4/18/2019,5/17/2019,30,85,,0,2.83,2.31,168.4,218.7,271, , , , , ,,,,,,,,3032,3061 -5/18/2019,6/18/2019,32,51,,0,1.59,1.07,12.1,19.2,35.6, , , , , ,,,,,,,,3062,3093 -6/19/2019,7/19/2019,31,17,,-1,0.55,0.02,0,0,0, , , , , ,,,,,,,,3094,3124 -7/20/2019,8/19/2019,31,11,,-1,0.35,-0.17,0,0,0, , , , , ,,,,,,,,3125,3155 -8/20/2019,9/17/2019,29,17,,-1,0.59,0.06,0.1,2.1,7.3, , , , , ,,,,,,,,3156,3184 -9/18/2019,10/17/2019,30,39,,0,1.3,0.78,52.7,85.1,121.4, , , , , ,,,,,,,,3185,3214 -10/18/2019,11/14/2019,28,127,,0,4.54,4.01,316.1,366.1,419.8, , , , , ,,,,,,,,3215,3242 -11/15/2019,12/18/2019,34,276,,1,8.12,7.59,760.4,828.4,896.4,"1,273.30","1,168.80","1,080.10","1,184.20","1,153.40",,,,,,,,3243,3276 -12/19/2019,1/16/2020,29,235,,1,8.1,7.58,638.2,692.9,750.8,"1,291.60","1,189.60","1,097.90","1,205.30","1,173.90",,,,,,,,3277,3305 -1/17/2020,2/19/2020,34,306,,1,9,8.48,903.6,971.6,1039.6,"1,196.00","1,112.30","1,039.50","1,125.40","1,099.20",,,,,,,,3306,3339 -2/20/2020,3/18/2020,28,170,,1,6.07,5.55,483.4,537.1,593,"1,205.00","1,084.50",982.3,"1,104.10","1,065.00",,,,,,,,3340,3367 -3/19/2020,4/21/2020,34,165,,0,4.85,4.33,454.7,522,590, , , , , ,,,,,,,,3368,3401 -4/22/2020,5/15/2020,24,82,,0,3.42,2.89,201.7,242.3,285.1, , , , , ,,,,,,,,3402,3425 -5/16/2020,6/16/2020,32,60,,0,1.88,1.35,17.3,32.6,52.9, , , , , ,,,,,,,,3426,3457 -6/17/2020,7/17/2020,31,25,,-1,0.81,0.28,0,0,0, , , , , ,,,,,,,,3458,3488 -7/18/2020,8/14/2020,28,13,,-1,0.46,-0.06,0,0,0, , , , , ,,,,,,,,3489,3516 -8/15/2020,9/15/2020,32,19,,-1,0.59,0.07,5,8.9,14.8, , , , , ,,,,,,,,3517,3548 -9/16/2020,10/14/2020,29,41,,0,1.41,0.89,84.1,114.1,150.1, , , , , ,,,,,,,,3549,3577 -10/15/2020,11/16/2020,33,142,,0,4.3,3.78,301.5,353.3,411.7, , , , , ,,,,,,,,3578,3610 -11/17/2020,12/16/2020,30,243,,1,8.1,7.58,573.4,633.4,693.4,"1,486.40","1,345.60","1,229.20","1,363.40","1,327.90",,,,,,,,3611,3640 -12/17/2020,1/19/2021,34,335,,1,9.85,9.33,844,912,980,"1,409.30","1,304.20","1,213.70","1,318.20","1,290.30",,,,,,,,3641,3674 -1/20/2021,2/17/2021,29,335,,1,11.55,11.03,929.8,987.8,1045.8,"1,289.80","1,214.10","1,146.80","1,225.10","1,203.10",,,,,,,,3675,3703 -2/18/2021,3/18/2021,29,255,,1,8.79,8.27,688.8,746.8,804.8,"1,305.60","1,204.20","1,117.40","1,218.70","1,189.60",,,,,,,,3704,3732 \ No newline at end of file +start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_57.5f,hdd_at_59.5f,hdd_at_61.5f,ua_at_57.5f,ua_at_59.5f,ua_at_61.5f,ua_sensitivity_at_0.42_therms,ua_sensitivity_at_0.62_therms +2018-03-17 00:00:00,2018-04-17 00:00:00,32,222,,0,6.9375,6.413690476190476,625.8,689.8,753.7999999999998,,,,, +2018-04-18 00:00:00,2018-05-17 00:00:00,30,72,,0,2.4,1.8761904761904762,137.19999999999996,175.29999999999998,221.89999999999992,,,,, +2018-05-18 00:00:00,2018-06-19 00:00:00,33,48,,0,1.4545454545454546,0.9307359307359307,24.9,40.3,59.9,,,,, +2018-06-20 00:00:00,2018-07-17 00:00:00,28,13,,-1,0.4642857142857143,-0.059523809523809534,0,0,1.7999999999999972,,,,, +2018-07-18 00:00:00,2018-08-16 00:00:00,30,11,,-1,0.36666666666666664,-0.1571428571428572,0,0,0,,,,, +2018-08-17 00:00:00,2018-09-18 00:00:00,33,17,,-1,0.5151515151515151,-0.008658008658008698,2.200000000000003,5.300000000000004,9.300000000000004,,,,, +2018-09-19 00:00:00,2018-10-16 00:00:00,28,35,,0,1.25,0.7261904761904762,63.300000000000004,97.30000000000001,131.7,,,,, +2018-10-17 00:00:00,2018-11-15 00:00:00,30,167,,0,5.566666666666666,5.042857142857143,404.70000000000005,462.70000000000005,520.7,,,,, +2018-11-16 00:00:00,2018-12-15 00:00:00,30,278,,1,9.266666666666667,8.742857142857144,720.4,780.4,840.4,1365.3129213928773,1260.3426814088018,1170.3610525600059,1274.7583656732816,1245.9269971443223 +2018-12-16 00:00:00,2019-01-16 00:00:00,32,303,,1,9.46875,8.944940476190476,790.6999999999998,854.6999999999998,918.6999999999999,1357.5222677916497,1255.8708987280418,1168.3823415074096,1269.9109127680556,1241.8308846880277 +2019-01-17 00:00:00,2019-02-15 00:00:00,30,329,,1,10.966666666666667,10.442857142857143,860.7000000000002,920.7000000000002,980.7000000000002,1364.9604142807348,1276.0089372992597,1197.9417034479743,1288.2279011311268,1263.7899734673927 +2019-02-16 00:00:00,2019-03-18 00:00:00,31,268,,1,8.64516129032258,8.121351766513056,822,884,945.9999999999999,1148.5488355926313,1067.9945054945056,997.9990939293267,1081.1449579831933,1054.8440530058178 +2019-03-19 00:00:00,2019-04-17 00:00:00,30,147,,0,4.9,4.376190476190477,400.9,457.7999999999999,515.8,,,,, +2019-04-18 00:00:00,2019-05-17 00:00:00,30,85,,0,2.8333333333333335,2.3095238095238098,168.39999999999995,218.69999999999996,271,,,,, +2019-05-18 00:00:00,2019-06-18 00:00:00,32,51,,0,1.59375,1.0699404761904763,12.100000000000001,19.200000000000003,35.60000000000001,,,,, +2019-06-19 00:00:00,2019-07-19 00:00:00,31,17,,-1,0.5483870967741935,0.02457757296466967,0,0,0,,,,, +2019-07-20 00:00:00,2019-08-19 00:00:00,31,11,,-1,0.3548387096774194,-0.16897081413210446,0,0,0,,,,, +2019-08-20 00:00:00,2019-09-17 00:00:00,29,17,,-1,0.5862068965517241,0.06239737274220025,0.10000000000000142,2.1000000000000014,7.299999999999997,,,,, +2019-09-18 00:00:00,2019-10-17 00:00:00,30,39,,0,1.3,0.7761904761904762,52.699999999999996,85.10000000000001,121.39999999999999,,,,, +2019-10-18 00:00:00,2019-11-14 00:00:00,28,127,,0,4.535714285714286,4.011904761904762,316.1,366.09999999999997,419.79999999999995,,,,, +2019-11-15 00:00:00,2019-12-18 00:00:00,34,276,,1,8.117647058823529,7.593837535014005,760.4000000000001,828.4000000000001,896.4000000000001,1273.2960096189975,1168.7762985445263,1080.114107222541,1184.1674139477132,1153.3851831413394 +2019-12-19 00:00:00,2020-01-16 00:00:00,29,235,,1,8.10344827586207,7.579638752052546,638.2,692.9000000000001,750.8000000000001,1291.5789944934413,1189.6171370843037,1097.8765507268436,1205.3120425540685,1173.9222316145392 +2020-01-17 00:00:00,2020-02-19 00:00:00,34,306,,1,9,8.476190476190476,903.6000000000003,971.6000000000004,1039.6000000000004,1196.0096123442734,1112.3037111098038,1039.5481778706092,1125.4263953419982,1099.1810268776094 +2020-02-20 00:00:00,2020-03-18 00:00:00,28,170,,1,6.071428571428571,5.5476190476190474,483.4000000000001,537.1000000000001,593.0000000000001,1205.006206040546,1084.5280208527274,982.2934232715006,1104.0774529882701,1064.9785887171847 +2020-03-19 00:00:00,2020-04-21 00:00:00,34,165,,0,4.852941176470588,4.329131652661064,454.69999999999993,521.9999999999999,590,,,,, +2020-04-22 00:00:00,2020-05-15 00:00:00,24,82,,0,3.4166666666666665,2.892857142857143,201.7,242.29999999999995,285.09999999999997,,,,, +2020-05-16 00:00:00,2020-06-16 00:00:00,32,60,,0,1.875,1.3511904761904763,17.300000000000004,32.6,52.900000000000006,,,,, +2020-06-17 00:00:00,2020-07-17 00:00:00,31,25,,-1,0.8064516129032258,0.2826420890937019,0,0,0,,,,, +2020-07-18 00:00:00,2020-08-14 00:00:00,28,13,,-1,0.4642857142857143,-0.059523809523809534,0,0,0,,,,, +2020-08-15 00:00:00,2020-09-15 00:00:00,32,19,,-1,0.59375,0.06994047619047616,5,8.899999999999999,14.799999999999997,,,,, +2020-09-16 00:00:00,2020-10-14 00:00:00,29,41,,0,1.4137931034482758,0.889983579638752,84.1,114.1,150.1,,,,, +2020-10-15 00:00:00,2020-11-16 00:00:00,33,142,,0,4.303030303030303,3.779220779220779,301.49999999999994,353.2999999999999,411.69999999999993,,,,, +2020-11-17 00:00:00,2020-12-16 00:00:00,30,243,,1,8.1,7.576190476190476,573.4,633.3999999999999,693.3999999999999,1486.4343016592757,1345.629031530516,1229.1915612509788,1363.3903198159596,1327.8677432450722 +2020-12-17 00:00:00,2021-01-19 00:00:00,34,335,,1,9.852941176470589,9.329131652661065,844.0000000000001,912.0000000000001,980.0000000000001,1409.3178740690587,1304.237155388471,1213.7390670553934,1318.2174185463655,1290.2568922305763 +2021-01-20 00:00:00,2021-02-17 00:00:00,29,335,,1,11.551724137931034,11.02791461412151,929.8000000000001,987.8,1045.8,1289.831914697477,1214.0977063026062,1146.7639264541158,1225.1070199288463,1203.088392676366 +2021-02-18 00:00:00,2021-03-18 00:00:00,29,255,,1,8.793103448275861,8.269293924466337,688.7999999999998,746.7999999999998,804.7999999999997,1305.5832088933137,1204.185477083174,1117.4027264981542,1218.7476088453593,1189.6233453209886 diff --git a/rules-engine/tests/test_rules_engine/cases/examples/lewitus/summary.json b/rules-engine/tests/test_rules_engine/cases/examples/lewitus/summary.json index 6c4259e1..a5d43d8a 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/lewitus/summary.json +++ b/rules-engine/tests/test_rules_engine/cases/examples/lewitus/summary.json @@ -3,19 +3,19 @@ "design_temperature_override": null, "living_area": 3000, "fuel_type": "GAS", - "heating_system_efficiency": 0.90, + "heating_system_efficiency": 0.9, "other_fuel_usage": 0.52, "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": 59.5, - "balance_point_sensitivity": 0.5, - "average_indoor_temperature": 68.0, + "balance_point_sensitivity": 2, + "average_indoor_temperature": 68, "difference_between_ti_and_tbp": 8.5, "design_temperature": 8.4, - "whole_home_heat_loss_rate": 1207, + "whole_home_heat_loss_rate": 1207.0, "standard_deviation_of_heat_loss_rate": 0.0692, - "average_heat_load": 64090, - "maximum_heat_load": 74349 + "average_heat_load": 64090.0, + "maximum_heat_load": 74349.0 } \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/cases/examples/quateman/natural-gas.csv b/rules-engine/tests/test_rules_engine/cases/examples/quateman/natural-gas.csv index db83596c..89884c19 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/quateman/natural-gas.csv +++ b/rules-engine/tests/test_rules_engine/cases/examples/quateman/natural-gas.csv @@ -1,26 +1,26 @@ -start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_51f,hdd_at_52f,hdd_at_53f,ua_at_51f,ua_at_52f,ua_at_53f,ua_sensitivity_at_0.2_therms,ua_sensitivity_at_0.4_therms,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/2020,11/4/2020,34,29,,0,0.85,0.57,112.6,128.6,144.9, , , , , ,,,,,,,,3565,3598 -11/5/2020,12/3/2020,29,36,,1,1.24,0.96,161.6,180.6,199.7, 693.1 , 620.2 , 560.9 , 685.1 , 555.3 ,,,,,,,,3599,3627 -12/4/2020,1/7/2021,35,97,,1,2.77,2.49,577.5,611.5,645.5, 608.9 , 575.0 , 544.7 , 598.2 , 551.9 ,,,,,,,,3628,3662 -1/8/2021,2/5/2021,29,105,,1,3.62,3.33,603.9,632.9,661.9, 647.3 , 617.6 , 590.6 , 636.1 , 599.1 ,,,,,,,,3663,3691 -2/6/2021,3/5/2021,28,98,,1,3.50,3.21,579.8,607.8,635.8, 627.4 , 598.5 , 572.1 , 617.1 , 579.9 ,,,,,,,,3692,3719 -3/6/2021,4/6/2021,32,66,,0,2.06,1.78,311.0,338.0,365.8, , , , , ,,,,,,,,3720,3751 -4/7/2021,5/5/2021,29,22,,0,0.76,0.47,77.9,96.0,116.7, , , , , ,,,,,,,,3752,3780 -5/6/2021,6/7/2021,33,19,,0,0.58,0.29,13.8,17.8,21.8, , , , , ,,,,,,,,3781,3813 -6/8/2021,7/6/2021,29,7,,-1,0.24,-0.04,0.0,0.0,0.0, , , , , ,,,,,,,,3814,3842 -7/7/2021,8/4/2021,29,10,,-1,0.34,0.06,0.0,0.0,0.0, , , , , ,,,,,,,,3843,3871 -8/5/2021,9/8/2021,35,11,,-1,0.31,0.03,0.0,0.0,0.0, , , , , ,,,,,,,,3872,3906 -9/9/2021,10/5/2021,27,8,,0,0.30,0.01,0.0,0.0,0.0, , , , , ,,,,,,,,3907,3933 -10/6/2021,11/3/2021,29,13,,0,0.45,0.16,24.9,31.5,40.4, , , , , ,,,,,,,,3934,3962 -11/4/2021,12/6/2021,33,41,0,0,1.24,0.96,337.6,367.6,397.6, , , , , ,,,,,,,,3963,3995 -12/7/2021,1/5/2022,30,86,,1,2.87,2.58,459.9,487.9,516.8, 680.5 , 641.4 , 605.5 , 666.3 , 616.6 ,,,,,,,,3996,4025 -1/6/2022,2/3/2022,29,132,,1,4.55,4.27,763.3,792.3,821.3, 655.1 , 631.1 , 608.8 , 645.9 , 616.3 ,,,,,,,,4026,4054 -2/4/2022,3/7/2022,32,116,,1,3.63,3.34,617.8,646.8,676.2, 699.1 , 667.7 , 638.7 , 687.7 , 647.7 ,,,,,,,,4055,4086 -3/8/2022,4/4/2022,28,49,,0,1.75,1.46,280.7,305.7,331.2, , , , , ,,,,,,,,4087,4114 -4/5/2022,5/5/2022,31,39,,0,1.26,0.97,107.7,132.5,157.5, , , , , ,,,,,,,,4115,4145 -5/6/2022,6/6/2022,32,20,,0,0.63,0.34,14.6,18.7,23.7, , , , , ,,,,,,,,4146,4177 -6/7/2022,7/5/2022,29,9,,-1,0.31,0.02,0.0,0.0,0.0, , , , , ,,,,,,,,4178,4206 -7/6/2022,8/3/2022,29,7,,-1,0.24,-0.04,0.0,0.0,0.0, , , , , ,,,,,,,,4207,4235 -8/4/2022,9/3/2022,31,8,,-1,0.26,-0.03,0.0,0.0,0.0, , , , , ,,,,,,,,4236,4266 -9/4/2022,10/3/2022,30,8,,0,0.27,-0.02,1.1,4.1,8.0, , , , , ,,,,,,,,4267,4296 -10/4/2022,11/3/2022,31,19,,0,0.61,0.33,45.3,57.5,70.7, , , , , ,,,,,,,,4297,4327 \ No newline at end of file +start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_50.5f,hdd_at_51.5f,hdd_at_52.5f,ua_at_50.5f,ua_at_51.5f,ua_at_52.5f,ua_sensitivity_at_0.2_therms,ua_sensitivity_at_0.4_therms +2020-10-03 00:00:00,2020-11-04 00:00:00,33,29,,0,0.8787878787878788,0.5833333333333333,104.89999999999999,120.59999999999998,136.59999999999997,,,,, +2020-11-06 00:00:00,2020-12-03 00:00:00,28,36,,1,1.2857142857142858,0.9902597402597404,152.09999999999997,171.10000000000002,190.10000000000002,736.7810252425638,654.9643129128809,589.5023352940239,721.1049713971981,588.8236544285637 +2020-12-05 00:00:00,2021-01-07 00:00:00,34,97,,1,2.8529411764705883,2.557486631016043,559.6999999999999,592.6999999999999,625.6999999999999,627.910108770391,592.9497011621189,561.6769823857885,616.1345614061996,569.7648409180381 +2021-01-09 00:00:00,2021-02-05 00:00:00,28,105,,1,3.75,3.4545454545454546,569.6000000000001,597.6000000000001,625.6000000000001,686.3402281239358,654.1823861100968,624.9031233046577,673.1192446553891,635.2455275648044 +2021-02-07 00:00:00,2021-03-05 00:00:00,27,98,,1,3.6296296296296298,3.3341750841750843,550.3000000000001,577.3000000000001,604.3000000000001,661.170009196086,630.24745550079,602.0881285133313,649.1501057692813,611.3448052322987 +2021-03-07 00:00:00,2021-04-06 00:00:00,31,66,,0,2.129032258064516,1.8335777126099706,272.8999999999999,298.8999999999999,324.8999999999999,,,,, +2021-04-08 00:00:00,2021-05-05 00:00:00,28,22,,0,0.7857142857142857,0.49025974025974023,68.1,84.1,102.89999999999998,,,,, +2021-05-07 00:00:00,2021-06-07 00:00:00,32,19,,0,0.59375,0.29829545454545453,11.799999999999997,15.799999999999997,19.799999999999997,,,,, +2021-06-09 00:00:00,2021-07-06 00:00:00,28,7,,-1,0.25,-0.04545454545454547,0,0,0,,,,, +2021-07-08 00:00:00,2021-08-04 00:00:00,28,10,,-1,0.35714285714285715,0.06168831168831168,0,0,0,,,,, +2021-08-06 00:00:00,2021-09-08 00:00:00,34,11,,-1,0.3235294117647059,0.02807486631016043,0,0,0,,,,, +2021-09-10 00:00:00,2021-10-05 00:00:00,26,8,,0,0.3076923076923077,0.01223776223776224,0,0,0,,,,, +2021-10-07 00:00:00,2021-11-03 00:00:00,28,13,,0,0.4642857142857143,0.16883116883116883,21.900000000000006,27.900000000000006,35.800000000000004,,,,, +2021-11-05 00:00:00,2021-12-06 00:00:00,32,41,0,0,1.28125,0.9857954545454546,310.4000000000001,339.1000000000001,368.1000000000001,,,,, +2021-12-08 00:00:00,2022-01-05 00:00:00,29,86,,1,2.9655172413793105,2.670062695924765,432.1000000000001,459.1000000000001,486.4000000000001,724.2619728878695,681.6676072421006,643.4078916218101,707.1976297499058,656.1375847342955 +2022-01-07 00:00:00,2022-02-03 00:00:00,28,132,,1,4.714285714285714,4.4188311688311686,732.9,760.9,788.9,682.3091744295183,657.201201129444,633.8755151976093,672.0739395532403,642.3284627056477 +2022-02-05 00:00:00,2022-03-07 00:00:00,31,116,,1,3.7419354838709675,3.446480938416422,581.3000000000001,609.3000000000001,637.3000000000001,742.8442128145377,708.7072721304625,677.5699684749582,729.27048674833,688.1440575125949 +2022-03-09 00:00:00,2022-04-04 00:00:00,27,49,,0,1.8148148148148149,1.5193602693602695,255.60000000000005,279.6,303.5999999999999,,,,, +2022-04-06 00:00:00,2022-05-05 00:00:00,30,39,,0,1.3,1.0045454545454546,92.6,115.9,139.89999999999998,,,,, +2022-05-07 00:00:00,2022-06-06 00:00:00,31,20,,0,0.6451612903225806,0.34970674486803516,12.600000000000001,16.6,21.200000000000003,,,,, +2022-06-08 00:00:00,2022-07-05 00:00:00,28,9,,-1,0.32142857142857145,0.025974025974025983,0,0,0,,,,, +2022-07-07 00:00:00,2022-08-03 00:00:00,28,7,,-1,0.25,-0.04545454545454547,0,0,0,,,,, +2022-08-05 00:00:00,2022-09-03 00:00:00,30,8,,-1,0.26666666666666666,-0.028787878787878807,0,0,0,,,,, +2022-09-05 00:00:00,2022-10-03 00:00:00,29,8,,0,0.27586206896551724,-0.019592476489028232,0.3999999999999986,2.6000000000000014,6,,,,, +2022-10-05 00:00:00,2022-11-03 00:00:00,30,19,,0,0.6333333333333333,0.33787878787878783,39.6,51.300000000000004,64,,,,, diff --git a/rules-engine/tests/test_rules_engine/cases/examples/quateman/summary.json b/rules-engine/tests/test_rules_engine/cases/examples/quateman/summary.json index 8d548634..e6386dca 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/quateman/summary.json +++ b/rules-engine/tests/test_rules_engine/cases/examples/quateman/summary.json @@ -4,18 +4,18 @@ "living_area": 2155, "fuel_type": "GAS", "heating_system_efficiency": 0.97, - "other_fuel_usage": 0.286, + "other_fuel_usage": 0.3, "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": 52, - "balance_point_sensitivity": 0.5, - "average_indoor_temperature": 68.0, - "difference_between_ti_and_tbp": 16, + "estimated_balance_point": 51.5, + "balance_point_sensitivity": 1, + "average_indoor_temperature": 68, + "difference_between_ti_and_tbp": 16.5, "design_temperature": 9.5, - "whole_home_heat_loss_rate": 621.65, - "standard_deviation_of_heat_loss_rate": 0.04, - "average_heat_load": 27663.3, - "maximum_heat_load": 37609.7 + "whole_home_heat_loss_rate": 654.0, + "standard_deviation_of_heat_loss_rate": 0.0519, + "average_heat_load": 28788.0, + "maximum_heat_load": 39584.0 } \ No newline at end of file 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 724ba54f..91d19bf4 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,unused1,estimated_heating_use_therms,estimated_other_use_therms,estimated_total_use_therms,estimated_savings_therms,estimated_savings_percent,unused2,start_row,end_row -12/8/2021,1/7/2022,31,218,,1,7.03,6.43,751.8,782.8,813.8,994.9,955.5,919.1,970.4,940.7,,,,,,,,3997,4027 -1/8/2022,2/8/2022,32,312,,1,9.75,9.15,1145.3,1177.3,1209.3,958.9,932.9,908.2,943.1,922.7,,,,,,,,4028,4059 -2/9/2022,3/9/2022,29,200,,1,6.9,6.3,772.3,801.3,830.3,886.9,854.8,825,868.4,841.3,,,,,,,,4060,4088 -3/10/2022,4/7/2022,29,128,,0,4.41,3.82,477.8,506.8,535.8, , , , , ,,,,,,,,4089,4117 -4/8/2022,5/9/2022,32,80,,0,2.5,1.9,301.4,333.4,365.4, , , , , ,,,,,,,,4118,4149 -5/10/2022,6/8/2022,30,30,,0,1,0.4,24.3,34.4,46.5, , , , , ,,,,,,,,4150,4179 -6/9/2022,7/8/2022,30,22,,-1,0.73,0.14,3.5,4.5,6.2, , , , , ,,,,,,,,4180,4209 -7/9/2022,8/9/2022,32,17,,-1,0.53,-0.07,0,0,0, , , , , ,,,,,,,,4210,4241 -8/10/2022,9/8/2022,30,16,,-1,0.53,-0.06,0,0,1.4, , , , , ,,,,,,,,4242,4271 -8/17/2022,10/7/2022,52,29,,0,0.56,-0.04,75.5,89.1,107.4, , , , , ,,,,,,,,4249,4300 -10/8/2022,11/8/2022,32,66,,0,2.06,1.46,219.2,244.2,270.8, , , , , ,,,,,,,,4301,4332 -11/9/2022,12/9/2022,31,157,,1,5.06,4.47,551.4,580.4,609.4,941.7,894.6,852.1,914.7,874.6,,,,,,,,4333,4363 -12/10/2022,1/10/2023,32,221,,1,6.91,6.31,814.8,846.8,878.8,929.1,894,861.4,908.1,879.8,,,,,,,,4364,4395 -1/11/2023,2/8/2023,29,215,,1,7.41,6.82,756.6,785.6,814.6,979.7,943.5,909.9,957.4,929.7,,,,,,,,4396,4424 -2/9/2023,3/10/2023,30,199,,1,6.63,6.04,697.3,727.3,757.3,973.7,933.6,896.6,949.1,918.1,,,,,,,,4425,4454 -3/11/2023,4/10/2023,31,138,,0,4.45,3.85,548,579,610, , , , , ,,,,,,,,4455,4485 -4/11/2023,5/9/2023,29,62,,0,2.14,1.54,220.8,244.8,268.8, , , , , ,,,,,,,,4486,4514 -5/10/2023,6/9/2023,31,20,,0,0.65,0.05,81.6,100.8,121.6, , , , , ,,,,,,,,4515,4545 \ No newline at end of file +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,,,,, +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,,,,, 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 cef45072..565ef119 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 @@ -3,19 +3,19 @@ "design_temperature_override": null, "living_area": 3173, "fuel_type": "GAS", - "heating_system_efficiency": 0.90, - "other_fuel_usage": 0.60, + "heating_system_efficiency": 0.9, + "other_fuel_usage": 0.6, "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.0, - "balance_point_sensitivity": 1.0, - "average_indoor_temperature": 68.0, - "difference_between_ti_and_tbp": 8.0, + "estimated_balance_point": 61, + "balance_point_sensitivity": 1, + "average_indoor_temperature": 68, + "difference_between_ti_and_tbp": 7, "design_temperature": 8.4, - "whole_home_heat_loss_rate": 952, - "standard_deviation_of_heat_loss_rate": 0.0355, - "average_heat_load": 51035, - "maximum_heat_load": 58652 + "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 } \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/cases/examples/vitti/natural-gas.csv b/rules-engine/tests/test_rules_engine/cases/examples/vitti/natural-gas.csv index dd83f5c0..2edb1861 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/vitti/natural-gas.csv +++ b/rules-engine/tests/test_rules_engine/cases/examples/vitti/natural-gas.csv @@ -1,37 +1,37 @@ -start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_62.5f,hdd_at_63.5f,hdd_at_64.5f,ua_at_62.5f,ua_at_63.5f,ua_at_64.5f,ua_sensitivity_at_0.49_therms,ua_sensitivity_at_0.69_therms,unused1,estimated_heating_use_therms,estimated_other_use_therms,estimated_total_use_therms,estimated_savings_therms,estimated_savings_percent,unused2,start_row,end_row -12/30/2018,1/29/2019,31,247,,1,7.97,7.37,1047.9,1078.9,1109.9,818.1,794.6,772.4,805.4,783.8,,,,,,,,2923,2953 -1/31/2019,2/28/2019,29,234,,1,8.07,7.48,945.4,974.4,1003.4,859.9,834.3,810.2,845.5,823.2,,,,,,,,2955,2983 -3/2/2019,3/27/2019,26,195,0,0,7.5,6.91,719,745,771, , , , , ,,,,,,,,2985,3010 -3/29/2019,4/29/2019,32,135,,0,4.22,3.63,416.8,445.8,475.7, , , , , ,,,,,,,,3012,3043 -5/1/2019,6/3/2019,34,83,,0,2.44,1.85,210.9,239.9,270, , , , , ,,,,,,,,3045,3078 -6/5/2019,6/27/2019,23,16,,0,0.7,0.1,7.4,9.4,12.3, , , , , ,,,,,,,,3080,3102 -6/29/2019,7/31/2019,33,21,,-1,0.64,0.04,0,0,0, , , , , ,,,,,,,,3104,3136 -8/2/2019,8/28/2019,27,15,,-1,0.56,-0.04,1.8,4,7.5, , , , , ,,,,,,,,3138,3164 -8/30/2019,10/1/2019,33,27,,0,0.82,0.22,34.7,47.2,62.7, , , , , ,,,,,,,,3166,3198 -10/3/2019,10/25/2019,23,66,,0,2.87,2.28,187.8,209.8,231.8, , , , , ,,,,,,,,3200,3222 -10/27/2019,11/27/2019,32,169,,0,5.28,4.69,676.2,707.2,738.2, , , , , ,,,,,,,,3224,3255 -11/29/2019,1/2/2020,35,242,,1,6.91,6.32,1046.8,1081.8,1116.8,792.5,766.9,742.9,779,754.8,,,,,,,,3257,3291 -1/4/2020,1/30/2020,27,193,,1,7.15,6.55,790.5,817.5,844.5,839.6,811.8,785.9,824.2,799.5,,,,,,,,3293,3319 -2/1/2020,2/28/2020,28,197,,1,7.04,6.44,799.7,827.7,855.7,845.9,817.3,790.5,830,804.6,,,,,,,,3321,3348 -3/1/2020,3/30/2020,30,160,0,0,5.33,4.74,595.4,625.4,655.4, , , , , ,,,,,,,,3350,3379 -4/1/2020,4/30/2020,30,138,,0,4.6,4.01,517.7,547.7,577.7, , , , , ,,,,,,,,3381,3410 -5/2/2020,5/28/2020,27,68,,0,2.52,1.93,187.4,208.9,231.3, , , , , ,,,,,,,,3412,3438 -5/30/2020,6/29/2020,31,22,,0,0.71,0.12,20.6,29.5,39.4, , , , , ,,,,,,,,3440,3470 -7/1/2020,7/29/2020,29,16,,-1,0.55,-0.04,0,0,0, , , , , ,,,,,,,,3472,3500 -7/31/2020,8/27/2020,28,15,,-1,0.54,-0.06,2.5,3.8,6.7, , , , , ,,,,,,,,3502,3529 -8/29/2020,9/28/2020,31,29,,-1,0.94,0.34,81.4,96.3,111.9, , , , , ,,,,,,,,3531,3561 -9/30/2020,10/29/2020,30,73,,0,2.43,1.84,265.4,293.4,322.3, , , , , ,,,,,,,,3563,3592 -10/31/2020,11/30/2020,31,143,,0,4.61,4.02,556.1,586.1,616.1, , , , , ,,,,,,,,3594,3624 -12/2/2020,12/29/2020,28,189,,1,6.75,6.16,816.7,844.7,872.7,791.6,765.3,740.8,777.7,752.9,,,,,,,,3626,3653 -12/31/2020,1/29/2021,30,225,,1,7.5,6.91,942.3,972.3,1002.3,824.6,799.1,775.2,810.7,787.6,,,,,,,,3655,3684 -1/31/2021,2/25/2021,26,214,,1,8.23,7.64,912.2,938.2,964.2,816.3,793.7,772.3,804.1,783.3,,,,,,,,3686,3711 -2/27/2021,3/30/2021,32,185,,1,5.78,5.19,737.5,769.5,801.5,844.2,809,776.7,824.6,793.5,,,,,,,,3713,3744 -4/1/2021,4/29/2021,29,106,,0,3.66,3.06,397,426,455, , , , , ,,,,,,,,3746,3774 -5/1/2021,5/28/2021,28,51,,0,1.82,1.23,131.6,153.3,176.7, , , , , ,,,,,,,,3776,3803 -5/30/2021,6/29/2021,31,27,,0,0.87,0.28,28,36.4,46.9, , , , , ,,,,,,,,3805,3835 -7/1/2021,7/29/2021,29,15,,-1,0.52,-0.08,7.9,10.9,14.2, , , , , ,,,,,,,,3837,3865 -7/31/2021,9/1/2021,33,15,,-1,0.45,-0.14,0,0.8,2.1, , , , , ,,,,,,,,3867,3899 -9/3/2021,9/28/2021,26,14,,-1,0.54,-0.05,5.8,10.7,18.3, , , , , ,,,,,,,,3901,3926 -9/30/2021,10/27/2021,28,41,,0,1.46,0.87,153.4,179,205, , , , , ,,,,,,,,3928,3955 -10/29/2021,11/29/2021,32,154,,0,4.81,4.22,620.5,652.5,684.5, , , , , ,,,,,,,,3957,3988 -12/1/2021,12/27/2021,27,167,,1,6.19,5.59,689.1,716.1,743.1,821.6,790.7,761.9,804.8,776.5,,,,,,,,3990,4016 \ No newline at end of file +start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_62.5f,hdd_at_63.5f,hdd_at_64.5f,ua_at_62.5f,ua_at_63.5f,ua_at_64.5f,ua_sensitivity_at_0.49_therms,ua_sensitivity_at_0.69_therms +2018-12-30 00:00:00,2019-01-29 00:00:00,31,247,,1,7.967741935483871,7.37452159650082,1047.9,1078.9,1109.9,818.1010932276175,794.5946200697194,772.4012393848278,805.3694833564002,783.8197567830385 +2019-01-31 00:00:00,2019-02-28 00:00:00,29,234,,1,8.068965517241379,7.475745178258328,945.3999999999999,974.3999999999999,1003.3999999999999,859.9400128364641,834.3465600734742,810.2324976436049,845.5072743591884,823.18584578776 +2019-03-02 00:00:00,2019-03-27 00:00:00,26,195,0,0,7.5,6.906779661016949,718.9999999999999,744.9999999999999,770.9999999999999,,,,, +2019-03-29 00:00:00,2019-04-29 00:00:00,32,135,,0,4.21875,3.625529661016949,416.8,445.8,475.7,,,,, +2019-05-01 00:00:00,2019-06-03 00:00:00,34,83,,0,2.4411764705882355,1.8479561316051847,210.89999999999998,239.89999999999998,269.99999999999994,,,,, +2019-06-05 00:00:00,2019-06-27 00:00:00,23,16,,0,0.6956521739130435,0.10243183492999264,7.400000000000006,9.400000000000006,12.300000000000004,,,,, +2019-06-29 00:00:00,2019-07-31 00:00:00,33,21,,-1,0.6363636363636364,0.04314329738058553,0,0,0,,,,, +2019-08-02 00:00:00,2019-08-28 00:00:00,27,15,,-1,0.5555555555555556,-0.03766478342749524,1.7999999999999972,4,7.5,,,,, +2019-08-30 00:00:00,2019-10-01 00:00:00,33,27,,0,0.8181818181818182,0.2249614791987674,34.69999999999999,47.19999999999999,62.69999999999998,,,,, +2019-10-03 00:00:00,2019-10-25 00:00:00,23,66,,0,2.869565217391304,2.2763448784082536,187.8,209.8,231.8,,,,, +2019-10-27 00:00:00,2019-11-27 00:00:00,32,169,,0,5.28125,4.688029661016949,676.1999999999999,707.1999999999999,738.1999999999999,,,,, +2019-11-29 00:00:00,2020-01-02 00:00:00,35,242,,1,6.914285714285715,6.3210653753026635,1046.8,1081.8000000000002,1116.8000000000002,792.5485579943397,766.9068501649792,742.8723410713419,779.0394070146741,754.7742933152844 +2020-01-04 00:00:00,2020-01-30 00:00:00,27,193,,1,7.148148148148148,6.554927809165097,790.5000000000002,817.5000000000002,844.5000000000001,839.578040073328,811.8488570984291,785.892765752476,824.2341781993465,799.4635359975117 +2020-02-01 00:00:00,2020-02-28 00:00:00,28,197,,1,7.035714285714286,6.4424939467312345,799.6999999999997,827.6999999999997,855.6999999999998,845.8945409613355,817.2790436230275,790.5362444861281,829.9647993316175,804.5932879144375 +2020-03-01 00:00:00,2020-03-30 00:00:00,30,160,0,0,5.333333333333333,4.740112994350282,595.4000000000002,625.4000000000001,655.4000000000001,,,,, +2020-04-01 00:00:00,2020-04-30 00:00:00,30,138,,0,4.6,4.006779661016949,517.6999999999999,547.6999999999998,577.6999999999998,,,,, +2020-05-02 00:00:00,2020-05-28 00:00:00,27,68,,0,2.5185185185185186,1.9252981795354678,187.39999999999998,208.9,231.29999999999998,,,,, +2020-05-30 00:00:00,2020-06-29 00:00:00,31,22,,0,0.7096774193548387,0.11645708037178792,20.6,29.5,39.4,,,,, +2020-07-01 00:00:00,2020-07-29 00:00:00,29,16,,-1,0.5517241379310345,-0.041496201052016346,0,0,0,,,,, +2020-07-31 00:00:00,2020-08-27 00:00:00,28,15,,-1,0.5357142857142857,-0.05750605326876512,2.5,3.799999999999997,6.699999999999996,,,,, +2020-08-29 00:00:00,2020-09-28 00:00:00,31,29,,-1,0.9354838709677419,0.34226353198469106,81.39999999999999,96.29999999999998,111.89999999999998,,,,, +2020-09-30 00:00:00,2020-10-29 00:00:00,30,73,,0,2.433333333333333,1.8401129943502823,265.4,293.4,322.29999999999995,,,,, +2020-10-31 00:00:00,2020-11-30 00:00:00,31,143,,0,4.612903225806452,4.019682886823401,556.0999999999999,586.0999999999999,616.0999999999998,,,,, +2020-12-02 00:00:00,2020-12-29 00:00:00,28,189,,1,6.75,6.156779661016949,816.7,844.7,872.7000000000002,791.5536481042973,765.3153361036813,740.7607017380309,777.745784783686,752.8848874236766 +2020-12-31 00:00:00,2021-01-29 00:00:00,30,225,,1,7.5,6.906779661016949,942.3,972.3,1002.3,824.5916500736568,799.1491431290824,775.2296835921449,810.7196460602765,787.5786401978884 +2021-01-31 00:00:00,2021-02-25 00:00:00,26,214,,1,8.23076923076923,7.637548891786179,912.2,938.2,964.2000000000002,816.3352520819475,793.7124461193268,772.3097043654351,804.104686579783,783.3202056588706 +2021-02-27 00:00:00,2021-03-30 00:00:00,32,185,,1,5.78125,5.188029661016949,737.4999999999999,769.4999999999999,801.4999999999999,844.1539787417411,809.0494598077115,776.7480465652327,824.6440017180428,793.4549178973801 +2021-04-01 00:00:00,2021-04-29 00:00:00,29,106,,0,3.6551724137931036,3.061952074810053,396.99999999999983,425.99999999999994,454.99999999999994,,,,, +2021-05-01 00:00:00,2021-05-28 00:00:00,28,51,,0,1.8214285714285714,1.2282082324455206,131.59999999999997,153.3,176.69999999999993,,,,, +2021-05-30 00:00:00,2021-06-29 00:00:00,31,27,,0,0.8709677419354839,0.27774740295243305,28,36.4,46.9,,,,, +2021-07-01 00:00:00,2021-07-29 00:00:00,29,15,,-1,0.5172413793103449,-0.07597895967270596,7.899999999999999,10.899999999999999,14.199999999999996,,,,, +2021-07-31 00:00:00,2021-09-01 00:00:00,33,15,,-1,0.45454545454545453,-0.1386748844375963,0,0.7999999999999972,2.0999999999999943,,,,, +2021-09-03 00:00:00,2021-09-28 00:00:00,26,14,,-1,0.5384615384615384,-0.054758800521512385,5.799999999999997,10.699999999999996,18.299999999999997,,,,, +2021-09-30 00:00:00,2021-10-27 00:00:00,28,41,,0,1.4642857142857142,0.8710653753026634,153.39999999999998,179,205,,,,, +2021-10-29 00:00:00,2021-11-29 00:00:00,32,154,,0,4.8125,4.219279661016949,620.5000000000001,652.5000000000001,684.5,,,,, +2021-12-01 00:00:00,2021-12-27 00:00:00,27,167,,1,6.185185185185185,5.591964846202134,689.1,716.1000000000001,743.1000000000001,821.6317525438486,790.6527589414412,761.9249639052161,804.791845661173,776.5136722217095 diff --git a/rules-engine/tests/test_rules_engine/cases/examples/vitti/summary.json b/rules-engine/tests/test_rules_engine/cases/examples/vitti/summary.json index 32f02520..87a909f3 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/vitti/summary.json +++ b/rules-engine/tests/test_rules_engine/cases/examples/vitti/summary.json @@ -3,19 +3,19 @@ "design_temperature_override": null, "living_area": 2100, "fuel_type": "GAS", - "heating_system_efficiency": 0.90, + "heating_system_efficiency": 0.9, "other_fuel_usage": 0.59, "other_fuel_usage_override": null, - "thermostat_set_point": 68.0, - "setback_temperature": 60.0, - "setback_hours_per_day": 8.0, + "thermostat_set_point": 68, + "setback_temperature": 60, + "setback_hours_per_day": 8, "estimated_balance_point": 63.5, - "balance_point_sensitivity": 0.5, + "balance_point_sensitivity": 1, "average_indoor_temperature": 65.3, "difference_between_ti_and_tbp": 1.8, "design_temperature": 8.4, - "whole_home_heat_loss_rate": 798, + "whole_home_heat_loss_rate": 798.0, "standard_deviation_of_heat_loss_rate": 0.0254, - "average_heat_load": 47711, - "maximum_heat_load": 49174 + "average_heat_load": 47711.0, + "maximum_heat_load": 49174.0 } \ No newline at end of file diff --git a/rules-engine/tests/test_rules_engine/cases/examples/yellepeddi/natural-gas.csv b/rules-engine/tests/test_rules_engine/cases/examples/yellepeddi/natural-gas.csv index 4dbcdf4e..6ac8a96d 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/yellepeddi/natural-gas.csv +++ b/rules-engine/tests/test_rules_engine/cases/examples/yellepeddi/natural-gas.csv @@ -1,21 +1,21 @@ -start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_56.5f,hdd_at_57.5f,hdd_at_58.5f,ua_at_56.5f,ua_at_57.5f,ua_at_58.5f,ua_sensitivity_at_0.2_therms,ua_sensitivity_at_0.4_therms,unused1,estimated_heating_use_therms,estimated_other_use_therms,estimated_total_use_therms,estimated_savings_therms,estimated_savings_percent,unused2,start_row,end_row -6/15/2021,7/14/2021,30,9,,-1,0.3,0,0,0.5,1.5, , , , , ,,,,,,,,3821,3850 -7/15/2021,8/12/2021,29,9,,-1,0.31,0.01,0,0,0, , , , , ,,,,,,,,3851,3879 -8/13/2021,9/14/2021,33,11,,-1,0.33,0.03,0,0,0, , , , , ,,,,,,,,3880,3912 -9/15/2021,10/13/2021,29,23,,0,0.79,0.49,8.2,12.5,18.1, , , , , ,,,,,,,,3913,3941 -10/14/2021,11/10/2021,28,75,,0,2.68,2.38,199.3,220.3,242, , , , , ,,,,,,,,3942,3969 -11/11/2021,12/13/2021,33,140,0,0,4.24,3.94,543.9,575.9,607.9, , , , , ,,,,,,,,3970,4002 -12/14/2021,1/12/2022,30,142,,1,4.73,4.43,696.7,726.7,756.7,755.8,724.6,695.9,741,708.3,,,,,,,,4003,4032 -1/13/2022,2/10/2022,29,177,,1,6.1,5.8,906.1,935.1,964.1,735.4,712.6,691.1,724.8,700.3,,,,,,,,4033,4061 -2/11/2022,3/14/2022,32,131,,1,4.09,3.79,730.7,762.7,794.7,657.8,630.2,604.9,646.8,613.6,,,,,,,,4062,4093 -3/15/2022,4/13/2022,30,55,,0,1.83,1.53,312.1,339.9,368.9, , , , , ,,,,,,,,4094,4123 -4/14/2022,5/13/2022,30,22,,0,0.73,0.43,164,190,217.5, , , , , ,,,,,,,,4124,4153 -5/14/2022,6/13/2022,31,14,,0,0.45,0.15,0.4,1.4,3.8, , , , , ,,,,,,,,4154,4184 -6/14/2022,7/14/2022,31,11,,-1,0.35,0.06,0,1,2, , , , , ,,,,,,,,4185,4215 -7/15/2022,8/11/2022,28,6,,-1,0.21,-0.08,0,0,0, , , , , ,,,,,,,,4216,4243 -8/12/2022,9/13/2022,33,9,,-1,0.27,-0.03,0,0,0, , , , , ,,,,,,,,4244,4276 -9/14/2022,10/12/2022,29,24,,0,0.83,0.53,60.8,76.2,93.1, , , , , ,,,,,,,,4277,4305 -10/13/2022,11/10/2022,29,52,,0,1.79,1.49,130.2,149.2,168.3, , , , , ,,,,,,,,4306,4334 -11/11/2022,12/13/2022,33,111,,1,3.36,3.06,543.1,574.1,605.1,737.1,697.3,661.6,720.1,674.6,,,,,,,,4335,4367 -12/14/2022,1/12/2023,30,137,,1,4.57,4.27,641.2,671.2,701.2,790.4,755.1,722.8,772.8,737.4,,,,,,,,4368,4397 -1/13/2023,2/10/2023,29,132,,1,4.55,4.25,634.4,663.4,692.4,769.5,735.9,705.1,753.2,718.6,,,,,,,,4398,4426 \ No newline at end of file +start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_56.5f,hdd_at_57.5f,hdd_at_58.5f,ua_at_56.5f,ua_at_57.5f,ua_at_58.5f,ua_sensitivity_at_0.2_therms,ua_sensitivity_at_0.4_therms +2021-06-15 00:00:00,2021-07-14 00:00:00,30,9,,-1,0.3,0.0010869565217391242,0,0.5,1.5,,,,, +2021-07-15 00:00:00,2021-08-12 00:00:00,29,9,,-1,0.3103448275862069,0.011431784107946041,0,0,0,,,,, +2021-08-13 00:00:00,2021-09-14 00:00:00,33,11,,-1,0.3333333333333333,0.03442028985507245,0,0,0,,,,, +2021-09-15 00:00:00,2021-10-13 00:00:00,29,23,,0,0.7931034482758621,0.49419040479760123,8.200000000000003,12.5,18.1,,,,, +2021-10-14 00:00:00,2021-11-10 00:00:00,28,75,,0,2.6785714285714284,2.3796583850931676,199.29999999999998,220.29999999999998,242,,,,, +2021-11-11 00:00:00,2021-12-13 00:00:00,33,140,0,0,4.242424242424242,3.9435111989459815,543.9000000000001,575.9000000000001,607.9000000000001,,,,, +2021-12-14 00:00:00,2022-01-12 00:00:00,30,142,,1,4.733333333333333,4.434420289855073,696.7,726.7,756.7,755.8309307022962,724.6283327649509,695.8998406505746,740.9693262973576,708.2873392325441 +2022-01-13 00:00:00,2022-02-10 00:00:00,29,177,,1,6.103448275862069,5.804535232383809,906.0999999999999,935.0999999999999,964.0999999999999,735.3628446647441,712.5572383175326,691.1236111925367,724.8331089909008,700.2813676441643 +2022-02-11 00:00:00,2022-03-14 00:00:00,32,131,,1,4.09375,3.7948369565217392,730.7,762.7,794.6999999999999,657.8340602519323,630.2338374538966,604.8563581553882,646.8415032027713,613.626171705022 +2022-03-15 00:00:00,2022-04-13 00:00:00,30,55,,0,1.8333333333333333,1.5344202898550723,312.09999999999997,339.9,368.9,,,,, +2022-04-14 00:00:00,2022-05-13 00:00:00,30,22,,0,0.7333333333333333,0.4344202898550724,164,190,217.5,,,,, +2022-05-14 00:00:00,2022-06-13 00:00:00,31,14,,0,0.45161290322580644,0.15269985974754557,0.3999999999999986,1.3999999999999986,3.799999999999997,,,,, +2022-06-14 00:00:00,2022-07-14 00:00:00,31,11,,-1,0.3548387096774194,0.05592566619915851,0,1,2,,,,, +2022-07-15 00:00:00,2022-08-11 00:00:00,28,6,,-1,0.21428571428571427,-0.08462732919254659,0,0,0,,,,, +2022-08-12 00:00:00,2022-09-13 00:00:00,33,9,,-1,0.2727272727272727,-0.026185770750988158,0,0,0,,,,, +2022-09-14 00:00:00,2022-10-12 00:00:00,29,24,,0,0.8275862068965517,0.5286731634182908,60.8,76.19999999999999,93.1,,,,, +2022-10-13 00:00:00,2022-11-10 00:00:00,29,52,,0,1.793103448275862,1.4941904047976013,130.2,149.2,168.3,,,,, +2022-11-11 00:00:00,2022-12-13 00:00:00,33,111,,1,3.3636363636363638,3.064723320158103,543.1,574.1,605.1,737.1192850223755,697.3166411699218,661.5922718487062,720.0696458729353,674.5636364669084 +2022-12-14 00:00:00,2023-01-12 00:00:00,30,137,,1,4.566666666666666,4.267753623188406,641.2,671.2,701.2,790.3863736020321,755.059211492287,722.7549098026568,772.7514045792952,737.3670184052787 +2023-01-13 00:00:00,2023-02-10 00:00:00,29,132,,1,4.551724137931035,4.252811094452774,634.3999999999999,663.3999999999999,692.4,769.5259671354424,735.8867554276827,705.0653864106364,753.1902927606139,718.5832180947514 diff --git a/rules-engine/tests/test_rules_engine/cases/examples/yellepeddi/summary.json b/rules-engine/tests/test_rules_engine/cases/examples/yellepeddi/summary.json index dd0ff05c..18f2da4a 100644 --- a/rules-engine/tests/test_rules_engine/cases/examples/yellepeddi/summary.json +++ b/rules-engine/tests/test_rules_engine/cases/examples/yellepeddi/summary.json @@ -4,18 +4,18 @@ "living_area": 2133, "fuel_type": "GAS", "heating_system_efficiency": 0.95, - "other_fuel_usage": 0.30, + "other_fuel_usage": 0.3, "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": 57.5, - "balance_point_sensitivity": 0.5, - "average_indoor_temperature": 68.0, + "balance_point_sensitivity": 1, + "average_indoor_temperature": 68, "difference_between_ti_and_tbp": 10.5, "design_temperature": 8.4, - "whole_home_heat_loss_rate": 709, + "whole_home_heat_loss_rate": 709.0, "standard_deviation_of_heat_loss_rate": 0.0559, - "average_heat_load": 36244, - "maximum_heat_load": 43692 + "average_heat_load": 36244.0, + "maximum_heat_load": 43692.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 new file mode 100644 index 00000000..8d3998a6 --- /dev/null +++ b/rules-engine/tests/test_rules_engine/generate_example_data.py @@ -0,0 +1,198 @@ +""" +This module is designed to be called at "build time" to read example excel files and generate the following test input files: + A summary.json file containing info from the Summary tab of the spreadsheet + An energy usage csv file containing info from either the Natural Gas or Oil-Propane tab of the spreadsheet +We intend to call this code infrequently, rather than with each test run because the excel sheets are not changed often and +the effort to ingest the excel sheets inline significantly slows down our tests by 10x + +Test example spreadsheets are provided in separate household folders within the "cases/examples" directory +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. +""" + +import csv +import json +import os +import pathlib +import re +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: + """ + 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 + Return the fuel_type to the caller so that our csv generator function can read the fuel billing information + """ + # Choose the Summary worksheet as the source for summary.json data + worksheet = workbook["Summary"] + data = {} + + for row in worksheet.iter_rows(min_row=1, max_col=2, values_only=True): + match row[0], row[1]: + case ["Local Weather Station", value]: + data["local_weather_station"] = value + case ["Design temperature override", value]: + data["design_temperature_override"] = value or None + case ["Living area", value]: + data["living_area"] = value + case ["Fuel type", value]: + if "Gas" in value: + data["fuel_type"] = fuel_type = "GAS" + elif "Oil" in value: + data["fuel_type"] = fuel_type = "OIL" + else: + raise ValueError("Expected: 'Gas' or 'Oil'; Instead found:", value) + case ["Heating system efficiency", value]: + data["heating_system_efficiency"] = round(value, 2) + case ["Other fuel usage (DHW, cooking)", value]: + data["other_fuel_usage"] = round(value or 0, 2) + case ["Other fuel usage OVERRIDE", value]: + data["other_fuel_usage_override"] = value or None + case ["Thermostat set point", value]: + data["thermostat_set_point"] = value + case ["Setback temp (nights,…)", value]: + data["setback_temperature"] = value or None + case ["Setback hours per day", value]: + data["setback_hours_per_day"] = value or None + case ["Estimated balance point, Tbp", value]: + data["estimated_balance_point"] = value + case ["Balance point sensitivity", value]: + data["balance_point_sensitivity"] = value + case ["Average Indoor Temperature, Ti", value]: + data["average_indoor_temperature"] = round(value, 1) + case ["Difference between Ti and Tbp", value]: + data["difference_between_ti_and_tbp"] = round(value, 1) + case ["Design temperature", value]: + data["design_temperature"] = round(value, 1) + case ["Whole-home UA", value]: + data["whole_home_heat_loss_rate"] = round(value, 0) + case ["Standard deviation of UA", value]: + data["standard_deviation_of_heat_loss_rate"] = round(value, 4) + case ["Avg Heat Load @ Design temp.", value]: + data["average_heat_load"] = round(value, 0) + case ["Max Heat Load @ Design temp.", value]: + data["maximum_heat_load"] = round(value, 0) + 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: + 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 + return fuel_type + + +def generate_billing_record_input_csv( + workbook: Any, fuel_type: str, folder: str +) -> None: + """ + Read the heat load analysis spreadsheet and write data from the appropriate "fuel type" worksheet into a csv file + We do this so our test runners use the csv file for faster processing of our example data + """ + # 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" + worksheet = workbook["Natural Gas"] + header_row = 4 + billing_row = 5 + # Setup the column header names in the appropriate positions for the Natural Gas worksheet + header = [ + "start_date", + "end_date", + "days_in_bill", + "usage", + "inclusion_override", + "inclusion_code", + "avg_daily_usage", + "daily_htg_usage", + ] + elif fuel_type == "OIL": + output_file_path = ROOT_DIR / folder / "oil-propane.csv" + worksheet = workbook["Oil-Propane"] + header_row = 5 + billing_row = 7 + # Setup the column header names in the appropriate positions for the Oil-Propane worksheet + header = [ + "start_date", + "end_date", + "usage", + "days_in_bill", + "inclusion_code", + "inclusion_override", + "avg_daily_usage", + "daily_htg_usage", + ] + else: + raise ValueError("Expected: 'GAS' or 'OIL'; Instead found:", fuel_type) + + # Read just the column headers for processing into more readable forms for our csv output + row = next( + worksheet.iter_rows( + min_row=header_row, + max_row=header_row, + min_col=1, + max_col=16, + values_only=False, + ) + ) + + # Find just the digits portion of the hdd, ua, and ua_sensitivity to generate unique headers + for i in range(3): + temp = re.search(r"[-+]?\d*\.\d+|\d+", row[8 + i].value) + if temp is None: + raise ValueError("Expected to find a temperature, found none") + header.append("hdd_at_" + str(temp.group()) + "f") + + for i in range(3): + temp = re.search(r"[-+]?\d*\.\d+|\d+", row[11 + i].value) + if temp is None: + raise ValueError("Expected to find a temperature, found none") + header.append("ua_at_" + str(temp.group()) + "f") + + for i in range(2): + temp = re.search(r"[-+]?\d*\.\d+|\d+", row[14 + i].value) + if temp is None: + raise ValueError("Expected to find a temperature, found none") + header.append("ua_sensitivity_at_" + str(temp.group()) + "_therms") + + # Write the header information first, then copy billing data row by row into the csv file + with open(output_file_path, mode="w", newline="") as csv_file: + writer = csv.writer(csv_file) + writer.writerow(header) + + # Now extract and write all the row data from excel to csv + for row in worksheet.iter_rows( + min_row=billing_row, max_col=16, values_only=True + ): + if row[0] == None: + break + writer.writerow(row) + + +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) + workbook.close() + del workbook diff --git a/rules-engine/tests/test_rules_engine/test_examples.py b/rules-engine/tests/test_rules_engine/test_examples.py index 28b51d65..69fb003e 100644 --- a/rules-engine/tests/test_rules_engine/test_examples.py +++ b/rules-engine/tests/test_rules_engine/test_examples.py @@ -23,8 +23,8 @@ # 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; need to find the source data for example-1 and example-4 for Natural Gas and update csv -YET_TO_BE_UPDATED_EXAMPLES = ("example-1", "example-2", "example-4") +# TODO: example-2 is OIL; shen is misbehaving +YET_TO_BE_UPDATED_EXAMPLES = ("example-2", "shen") # 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] @@ -98,9 +98,11 @@ def load_natural_gas( item = NaturalGasBillingRecordExampleInput( period_start_date=datetime.strptime( - row["start_date"], "%m/%d/%Y" + row["start_date"].split(maxsplit=1)[0], "%Y-%m-%d" + ).date(), + period_end_date=datetime.strptime( + row["end_date"].split(maxsplit=1)[0], "%Y-%m-%d" ).date(), - period_end_date=datetime.strptime(row["end_date"], "%m/%d/%Y").date(), usage_therms=row["usage"], inclusion_override=inclusion_override, whole_home_heat_loss_rate=whole_home_heat_loss_rate,