From 8b0c489e299d66b3ea386363a06e699455703b0a Mon Sep 17 00:00:00 2001 From: Weili Xu Date: Wed, 4 Sep 2024 12:53:13 -0700 Subject: [PATCH 1/4] update 5_2 --- rct229/rulesets/ashrae9012019/section5/section5rule2.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rct229/rulesets/ashrae9012019/section5/section5rule2.py b/rct229/rulesets/ashrae9012019/section5/section5rule2.py index b87adf863..bc7bd1581 100644 --- a/rct229/rulesets/ashrae9012019/section5/section5rule2.py +++ b/rct229/rulesets/ashrae9012019/section5/section5rule2.py @@ -1,4 +1,4 @@ -from rct229.rule_engine.partial_rule_definition import PartialRuleDefinition +from rct229.rule_engine.rule_base import RuleDefinitionBase from rct229.rule_engine.rule_list_indexed_base import RuleDefinitionListIndexedBase from rct229.rule_engine.ruleset_model_factory import produce_ruleset_model_description from rct229.rulesets.ashrae9012019 import BASELINE_0 @@ -29,7 +29,7 @@ def __init__(self): rmd_context="ruleset_model_descriptions/0/buildings", ) - class BuildingRule(PartialRuleDefinition): + class BuildingRule(RuleDefinitionBase): def __init__(self): super(Section5Rule2.BuildingRule, self).__init__( rmds_used=produce_ruleset_model_description( @@ -51,7 +51,7 @@ def get_calc_vals(self, context, data=None): "baseline_surfaces_casting_shade_ids": baseline_surfaces_casting_shade_ids } - def applicability_check(self, context, calc_vals, data): + def rule_check(self, context, calc_vals=None, data=None): # if there are surfaces casting shade, set to undetermined # if there are no surfaces casting shade, set to not applicable. return not len(calc_vals["baseline_surfaces_casting_shade_ids"]) == 0 From 3d103a9e337838dad0aefc061f74ccd954a95617 Mon Sep 17 00:00:00 2001 From: Jackson Jarboe <122476654+JacksonJ-KC@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:06:54 -0400 Subject: [PATCH 2/4] 5-2 rule test update --- .../ashrae9012019/section5/rule_5_2.json | 26 ++++++------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/rct229/ruletest_engine/ruletest_jsons/ashrae9012019/section5/rule_5_2.json b/rct229/ruletest_engine/ruletest_jsons/ashrae9012019/section5/rule_5_2.json index 0dad2a468..73d96daa1 100644 --- a/rct229/ruletest_engine/ruletest_jsons/ashrae9012019/section5/rule_5_2.json +++ b/rct229/ruletest_engine/ruletest_jsons/ashrae9012019/section5/rule_5_2.json @@ -4,7 +4,7 @@ "Rule": 2, "Test": "a", "test_description": "Project has one building segment with two zones. Zones include both interior and exterior surfaces. All exterior surfaces are correctly modeled as not casting shade in the baseline.", - "expected_rule_outcome": "not_applicable", + "expected_rule_outcome": "pass", "standard": { "rule_id": "5-2", "ruleset_reference": "Table G3.1(5) Baseline Building Performance (a)", @@ -25,15 +25,12 @@ "buildings": [ { "id": "Building 1", - "building_open_schedule": "Required Schedule 1", "building_segments": [ { "id": "Building Segment 1", "zones": [ { "id": "Zone 1", - "thermostat_cooling_setpoint_schedule": "Cooling Schedule 1", - "thermostat_heating_setpoint_schedule": "Heating Schedule 1", "surfaces": [ { "id": "Surface 1", @@ -44,29 +41,27 @@ "id": "Surface 2", "adjacent_to": "INTERIOR", "adjacent_zone": "Zone 2", - "does_cast_shade": true + "does_cast_shade": false }, { "id": "Surface 3", "adjacent_to": "IDENTICAL", - "does_cast_shade": true + "does_cast_shade": false }, { "id": "Surface 4", "adjacent_to": "GROUND", - "does_cast_shade": true + "does_cast_shade": false }, { "id": "Surface 5", "adjacent_to": "UNDEFINED", - "does_cast_shade": true + "does_cast_shade": false } ] }, { - "id": "Zone 2", - "thermostat_cooling_setpoint_schedule": "Cooling Schedule 1", - "thermostat_heating_setpoint_schedule": "Heating Schedule 1" + "id": "Zone 2" } ] } @@ -84,7 +79,7 @@ "Rule": 2, "Test": "b", "test_description": "Project has one building segment with two zones. Zones include both interior and exterior surfaces. One exterior surface is incorrectly modeled as casting shade in the baseline.", - "expected_rule_outcome": "undetermined", + "expected_rule_outcome": "fail", "standard": { "rule_id": "5-2", "ruleset_reference": "Table G3.1(5) Baseline Building Performance (a)", @@ -105,15 +100,12 @@ "buildings": [ { "id": "Building 1", - "building_open_schedule": "Required Schedule 1", "building_segments": [ { "id": "Building Segment 1", "zones": [ { "id": "Zone 1", - "thermostat_cooling_setpoint_schedule": "Cooling Schedule 1", - "thermostat_heating_setpoint_schedule": "Heating Schedule 1", "surfaces": [ { "id": "Surface 1", @@ -144,9 +136,7 @@ ] }, { - "id": "Zone 2", - "thermostat_cooling_setpoint_schedule": "Cooling Schedule 1", - "thermostat_heating_setpoint_schedule": "Heating Schedule 1" + "id": "Zone 2" } ] } From 475f2a21c08642af6929967bbf939ae13a8760b7 Mon Sep 17 00:00:00 2001 From: Jackson Jarboe <122476654+JacksonJ-KC@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:14:08 -0400 Subject: [PATCH 3/4] correct 5-2 evaluation --- rct229/rulesets/ashrae9012019/section5/section5rule2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rct229/rulesets/ashrae9012019/section5/section5rule2.py b/rct229/rulesets/ashrae9012019/section5/section5rule2.py index bc7bd1581..0e2a9e2e2 100644 --- a/rct229/rulesets/ashrae9012019/section5/section5rule2.py +++ b/rct229/rulesets/ashrae9012019/section5/section5rule2.py @@ -54,4 +54,4 @@ def get_calc_vals(self, context, data=None): def rule_check(self, context, calc_vals=None, data=None): # if there are surfaces casting shade, set to undetermined # if there are no surfaces casting shade, set to not applicable. - return not len(calc_vals["baseline_surfaces_casting_shade_ids"]) == 0 + return len(calc_vals["baseline_surfaces_casting_shade_ids"]) == 0 From a009f59b54cbd3c468377ebc06e6d1fc66dfe701 Mon Sep 17 00:00:00 2001 From: Jackson Jarboe <122476654+JacksonJ-KC@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:16:50 -0400 Subject: [PATCH 4/4] remove outdated comments --- rct229/rulesets/ashrae9012019/section5/section5rule2.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/rct229/rulesets/ashrae9012019/section5/section5rule2.py b/rct229/rulesets/ashrae9012019/section5/section5rule2.py index 0e2a9e2e2..63de9fe47 100644 --- a/rct229/rulesets/ashrae9012019/section5/section5rule2.py +++ b/rct229/rulesets/ashrae9012019/section5/section5rule2.py @@ -52,6 +52,4 @@ def get_calc_vals(self, context, data=None): } def rule_check(self, context, calc_vals=None, data=None): - # if there are surfaces casting shade, set to undetermined - # if there are no surfaces casting shade, set to not applicable. return len(calc_vals["baseline_surfaces_casting_shade_ids"]) == 0