diff --git a/rct229/rulesets/ashrae9012019/section5/section5rule2.py b/rct229/rulesets/ashrae9012019/section5/section5rule2.py index b87adf863..63de9fe47 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,5 @@ 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): - # 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 + def rule_check(self, context, calc_vals=None, data=None): + return len(calc_vals["baseline_surfaces_casting_shade_ids"]) == 0 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" } ] }