-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
added fuel oil test cases
Co-authored-by: Debajyoti Debnath <debajyotid2@users.noreply.github.com> Co-authored-by: eriksynn <eriksynn@users.noreply.github.com> Co-authored-by: Jonathan Kwan <jkwan2011@users.noreply.github.com> Co-authored-by: thatoldplatitude <thatoldplatitude@users.noreply.github.com> Co-authored-by: Steve Breit <stevebreit@users.noreply.github.com> Co-authored-by: AdamFinkle <AdamFinkle@users.noreply.github.com>
1 parent
adf4b28
commit 9857762
Showing
10 changed files
with
176 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/cowen/fuel-oil.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_58f,hdd_at_60f,hdd_at_62f,ua_at_58f,ua_at_60f,ua_at_62f,ua_sensitivity_at_0.1_gal,ua_sensitivity_at_0.1_gal,unused1,estimated_heating_use_therms,estimated_other_use_therms,estimated_total_use_therms,estimated_savings_therms,estimated_savings_percent,unused2,start_row,end_row,,,,, | ||
8/30/2019,12/11/2019,149,104,0,,1.43,1.43,1000.5,1146.2,1306.1, , , , , ,,,,,,,,3166,3269,,0,,,0 | ||
12/12/2019,1/17/2020,105,37,1,,2.84,2.84,829.2,900.6,974.6,589.2,542.5,501.3, , ,,,,,,,,3270,3306,,1,542.5,,1 | ||
1/18/2020,3/21/2020,141,64,1,,2.2,2.2,1394.5,1522.5,1650.5,470.5,430.9,397.5, , ,,,,,,,,3307,3370,,1,430.9,,1 | ||
3/22/2020,6/4/2020,82,75,0,,1.09,1.09,726.8,849.3,980.2, , , , , ,,,,,,,,3371,3445,,0,,,0 |
21 changes: 21 additions & 0 deletions
21
rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/cowen/summary.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"local_weather_station": "KBVY-Beverly", | ||
"design_temperature_override": null, | ||
"living_area": 1205, | ||
"fuel_type": "OIL", | ||
"heating_system_efficiency": 0.8, | ||
"other_fuel_usage": null, | ||
"other_fuel_usage_override": null, | ||
"thermostat_set_point": 68.0, | ||
"setback_temperature": null, | ||
"setback_hours_per_day": null, | ||
"estimated_balance_point": 60, | ||
"balance_point_sensitivity": 2.0, | ||
"average_indoor_temperature": 68.0, | ||
"difference_between_ti_and_tbp": 8.0, | ||
"design_temperature": 9.5, | ||
"whole_home_heat_loss_rate": 487, | ||
"standard_deviation_of_heat_loss_rate": 0.1146, | ||
"average_heat_load": 25554, | ||
"maximum_heat_load": 29448 | ||
} |
9 changes: 9 additions & 0 deletions
9
rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/gelfand/fuel-oil.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_57f,hdd_at_58f,hdd_at_59f,ua_at_57f,ua_at_58f,ua_at_59f,ua_sensitivity_at_0.3_gal,ua_sensitivity_at_0.5_gal,unused1,estimated_heating_use_therms,estimated_other_use_therms,estimated_total_use_therms,estimated_savings_therms,estimated_savings_percent,unused2,start_row,end_row,,,,, | ||
10/2/2019,11/18/2019,191.1,48,0,,3.98,3.58,439.5,481.5,523.5, , , , , ,,,,,,,,3199,3246,,1,1661.3,ERROR,0 | ||
11/19/2019,12/23/2019,154.6,35,1,,4.42,4.02,803.1,838.1,873.1,814.7,780.6,749.4,800.1,761.2,,,,,,,,3247,3281,,1,780.6,,1 | ||
12/24/2019,2/7/2020,197,46,1,,4.28,3.88,1054.1,1098.1,1142.3,788.4,756.8,727.6,776.3,737.3,,,,,,,,3282,3327,,1,756.8,,1 | ||
2/8/2020,3/23/2020,163,45,1,,3.62,3.22,856.4,899.6,943.6,787.9,750,715.1,773.3,726.8,,,,,,,,3328,3372,,1,750,,1 | ||
3/24/2020,5/15/2020,128,53,0,,2.42,2.02,548.3,595.4,644.7, , , , , ,,,,,,,,3373,3425,,0,,,0 | ||
5/16/2020,10/15/2020,66.4,153,0,,0.43,0.03,95.8,119.2,145, , , , , ,,,,,,,,3426,3578,,0,,,0 | ||
10/16/2020,12/7/2020,132.5,53,1,,2.5,2.1,628.8,672,717.8,823.7,770.7,721.5,807.4,734,,,,,,,,3579,3631,,1,770.7,,1 | ||
12/8/2020,1/18/2021,194.2,42,1,,4.62,4.22,1021.3,1063.3,1105.3,808.3,776.4,746.9,794.7,758,,,,,,,,3632,3673,,1,776.4,,1 |
21 changes: 21 additions & 0 deletions
21
rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/gelfand/summary.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"local_weather_station": "KBED-Bedford", | ||
"design_temperature_override": null, | ||
"living_area": 1500, | ||
"fuel_type": "OIL", | ||
"heating_system_efficiency": 0.8, | ||
"other_fuel_usage": null, | ||
"other_fuel_usage_override": 0.40, | ||
"thermostat_set_point": 68.0, | ||
"setback_temperature": null, | ||
"setback_hours_per_day": null, | ||
"estimated_balance_point": 58.0, | ||
"balance_point_sensitivity": 1.0, | ||
"average_indoor_temperature": 68.0, | ||
"difference_between_ti_and_tbp": 10.0, | ||
"design_temperature": 8.4, | ||
"whole_home_heat_loss_rate": 767, | ||
"standard_deviation_of_heat_loss_rate": 0.0152, | ||
"average_heat_load": 39573, | ||
"maximum_heat_load": 47242 | ||
} |
17 changes: 17 additions & 0 deletions
17
rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/harris/fuel-oil.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_58f,hdd_at_60f,hdd_at_62f,ua_at_58f,ua_at_60f,ua_at_62f,ua_sensitivity_at_0.2_gal,ua_sensitivity_at_0.4_gal,unused1,estimated_heating_use_therms,estimated_other_use_therms,estimated_total_use_therms,estimated_savings_therms,estimated_savings_percent,unused2,start_row,end_row,,,,, | ||
8/9/2018,11/16/2018,137.4,100,0,,1.37,1.07,516.6,614.2,713.9, , , , , ,,,,,,,,2780,2879,,0,,,0 | ||
11/17/2018,12/17/2018,140.8,31,1,,4.54,4.24,752.8,814.8,876.8,812.8,751,697.9,768.7,733.3,,,,,,,,2880,2910,,1,751,,1 | ||
12/18/2018,1/15/2019,123.1,29,1,,4.24,3.94,737.5,795.5,853.5,721.8,669.2,623.7,686.2,652.2,,,,,,,,2911,2939,,1,669.2,,1 | ||
1/16/2019,2/9/2019,133.1,25,1,,5.32,5.02,745.8,795.8,845.8,783.7,734.4,691,749,719.8,,,,,,,,2940,2964,,1,734.4,,1 | ||
2/10/2019,3/12/2019,147.9,31,1,,4.77,4.47,888.8,950.8,1012.8,725.6,678.3,636.8,693.5,663.2,,,,,,,,2965,2995,,1,678.3,,1 | ||
3/13/2019,5/16/2019,135.8,65,0,,2.09,1.79,699.9,818.1,938.9, , , , , ,,,,,,,,2996,3060,,0,,,0 | ||
5/17/2019,11/13/2019,129.7,181,0,,0.72,0.42,375.5,470.8,588.4, , , , , ,,,,,,,,3061,3241,,0,,,0 | ||
11/14/2019,12/17/2019,121,34,1,,3.56,3.26,780.5,848.5,916.5,660.6,607.6,562.6,626.3,589,,,,,,,,3242,3275,,1,607.6,,1 | ||
12/18/2019,1/16/2020,111.5,30,1,,3.72,3.42,679.8,737.4,797.4,701.6,646.8,598.2,665.8,627.9,,,,,,,,3276,3305,,1,646.8,,1 | ||
1/17/2020,2/20/2020,170.6,35,1,,4.87,4.57,952.4,1022.4,1092.4,782.2,728.7,682,744.6,712.7,,,,,,,,3306,3340,,1,728.7,,1 | ||
2/21/2020,3/27/2020,121.3,36,1,,3.37,3.07,608.6,679,751,844.9,757.3,684.7,782,732.6,,,,,,,,3341,3376,,1,757.3,,1 | ||
3/28/2020,6/25/2020,119.1,90,0,,1.32,1.02,559,667.1,783.6, , , , , ,,,,,,,,3377,3466,,0,,,0 | ||
6/26/2020,11/12/2020,111.7,140,0,,0.8,0.5,345.4,426.7,523.3, , , , , ,,,,,,,,3467,3606,,0,,,0 | ||
11/13/2020,12/18/2020,111.5,36,1,,3.1,2.8,724.2,796.2,868.2,647,588.5,539.7,609.6,567.5,,,,,,,,3607,3642,,1,588.5,,1 | ||
12/19/2020,1/14/2021,109.6,27,1,,4.06,3.76,689.7,743.7,797.7,684.8,635.1,592.1,652,618.2,,,,,,,,3643,3669,,1,635.1,,1 | ||
1/15/2021,2/13/2021,113.8,30,0,,3.79,3.49,932.7,992.7,1052.7, , , , , ,,,,,,,,3670,3699,,1,491.3,ERROR,0 |
21 changes: 21 additions & 0 deletions
21
rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/harris/summary.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"local_weather_station": "KBED-Bedford", | ||
"design_temperature_override": null, | ||
"living_area": 2200, | ||
"fuel_type": "OIL", | ||
"heating_system_efficiency": 0.8, | ||
"other_fuel_usage": null, | ||
"other_fuel_usage_override": 0.30, | ||
"thermostat_set_point": 68.0, | ||
"setback_temperature": null, | ||
"setback_hours_per_day": null, | ||
"estimated_balance_point": 60.0, | ||
"balance_point_sensitivity": 2.0, | ||
"average_indoor_temperature": 68.0, | ||
"difference_between_ti_and_tbp": 8.0, | ||
"design_temperature": 8.4, | ||
"whole_home_heat_loss_rate": 680, | ||
"standard_deviation_of_heat_loss_rate": 0.0847, | ||
"average_heat_load": 36432, | ||
"maximum_heat_load": 41869 | ||
} |
17 changes: 17 additions & 0 deletions
17
rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/karle/fuel-oil.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
start_date,end_date,days_in_bill,usage,inclusion_override,inclusion_code,avg_daily_usage,daily_htg_usage,hdd_at_58.5f,hdd_at_60.5f,hdd_at_62.5f,ua_at_58.5f,ua_at_60.5f,ua_at_62.5f,ua_sensitivity_at_0.1_gal,ua_sensitivity_at_0.1_gal,unused1,estimated_heating_use_therms,estimated_other_use_therms,estimated_total_use_therms,estimated_savings_therms,estimated_savings_percent,unused2,start_row,end_row,,,,, | ||
1/16/2019,2/1/2019,132,17,1,,7.76,7.76,576.1,610.1,644.1,"1,066.20","1,006.80",953.6, , ,,,,,,,,2940,2956,,1,1006.8,,1 | ||
2/2/2019,2/21/2019,130,20,1,,6.5,6.5,524.8,564.8,604.8,"1,152.70","1,071.10","1,000.20", , ,,,,,,,,2957,2976,,1,1071.1,,1 | ||
2/22/2019,3/12/2019,129,19,1,,6.79,6.79,561.7,599.7,637.7,"1,068.70","1,001.00",941.3, , ,,,,,,,,2977,2995,,1,1001,,1 | ||
3/13/2019,4/8/2019,105,27,1,,3.89,3.89,446.5,500.5,554.5,"1,094.30",976.2,881.2, , ,,,,,,,,2996,3022,,1,976.2,,1 | ||
4/9/2019,10/25/2019,36,200,0,,0.18,0.18,411.2,541.4,696.1, , , , , ,,,,,,,,3023,3222,,0,,,0 | ||
10/26/2019,11/25/2019,143,31,1,,4.61,4.61,530.2,589,649,"1,255.00","1,129.80","1,025.30", , ,,,,,,,,3223,3253,,1,1129.8,,1 | ||
11/26/2019,12/17/2019,129,22,1,,5.86,5.86,536.6,580.6,624.6,"1,118.70","1,033.90",961.1, , ,,,,,,,,3254,3275,,1,1033.9,,1 | ||
12/18/2019,1/12/2021,205,392,0,,0.52,0.52,4634.7,5150.4,5696.2, , , , , ,,,,,,,,3276,3667,,1,185.2,ERROR,0 | ||
1/13/2021,2/4/2021,162,23,1,,7.04,7.04,682.2,728.2,774.2,"1,105.00","1,035.20",973.7, , ,,,,,,,,3668,3690,,1,1035.2,,1 | ||
2/5/2021,2/25/2021,147,21,1,,7,7,648.2,690.2,732.2,"1,055.30",991.1,934.2, , ,,,,,,,,3691,3711,,1,991.1,,1 | ||
2/26/2021,3/23/2021,141,26,1,,5.42,5.42,579.3,631.3,683.3,"1,132.60","1,039.30",960.2, , ,,,,,,,,3712,3737,,1,1039.3,,1 | ||
3/24/2021,12/1/2021,157,253,0,,0.62,0.62,1075.7,1294.9,1541.7, , , , , ,,,,,,,,3738,3990,,0,,,0 | ||
12/2/2021,1/6/2022,202,36,1,,5.61,5.61,783.5,855.5,927.5,"1,199.70","1,098.70","1,013.40", , ,,,,,,,,3991,4026,,1,1098.7,,1 | ||
1/7/2022,1/25/2022,165,19,1,,8.68,8.68,641.3,679.3,717.3,"1,197.30","1,130.30","1,070.40", , ,,,,,,,,4027,4045,,1,1130.3,,1 | ||
1/26/2022,2/15/2022,172,21,1,,8.19,8.19,675.1,717.1,759.1,"1,185.60","1,116.10","1,054.40", , ,,,,,,,,4046,4066,,1,1116.1,,1 | ||
2/16/2022,3/10/2022,146,23,1,,6.35,6.35,562.7,608.7,654.7,"1,207.40","1,116.10","1,037.70", , ,,,,,,,,4067,4089,,1,1116.1,,1 |
21 changes: 21 additions & 0 deletions
21
rules-engine/tests/test_rules_engine/cases/examples/fuel_oil/karle/summary.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"local_weather_station": "KBED-Bedford", | ||
"design_temperature_override": null, | ||
"living_area": 3800, | ||
"fuel_type": "OIL", | ||
"heating_system_efficiency": 0.8, | ||
"other_fuel_usage": null, | ||
"other_fuel_usage_override": 0.00, | ||
"thermostat_set_point": 67.0, | ||
"setback_temperature": 55.0, | ||
"setback_hours_per_day": 7.0, | ||
"estimated_balance_point": 60.5, | ||
"balance_point_sensitivity": 2.0, | ||
"average_indoor_temperature": 63.5, | ||
"difference_between_ti_and_tbp": 3.0, | ||
"design_temperature": 8.4, | ||
"whole_home_heat_loss_rate": 1057, | ||
"standard_deviation_of_heat_loss_rate": 0.0508, | ||
"average_heat_load": 61961, | ||
"maximum_heat_load": 65133 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
""" | ||
Tests for fuel-oil related methods. | ||
""" | ||
|
||
# Test inputs are provided as separate directory within the "cases/examples" directory | ||
# 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" | ||
NATURAL_GAS_DIR = ROOT_DIR / "fuel_oil" | ||
|
||
|
||
class Example(BaseModel): | ||
summary: Summary | ||
natural_gas_usage: NaturalGasBillingExampleInput | ||
temperature_data: TemperatureInput | ||
|
||
|
||
@pytest.fixture(scope="module", params=INPUT_DATA) | ||
def data(request): | ||
""" | ||
Loads the usage and temperature data and summary inputs into an | ||
Example instance. | ||
""" | ||
summary = load_summary(request.param) | ||
|
||
if summary.fuel_type == engine.FuelType.GAS: | ||
natural_gas_usage = load_natural_gas( | ||
request.param, summary.estimated_balance_point | ||
) | ||
else: | ||
natural_gas_usage = None | ||
|
||
weather_station_short_name = summary.local_weather_station[:4] | ||
temperature_data = load_temperature_data(weather_station_short_name) | ||
|
||
example = Example( | ||
summary=summary, | ||
natural_gas_usage=natural_gas_usage, | ||
temperature_data=temperature_data, | ||
) | ||
yield example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters