Skip to content

Commit

Permalink
Merge pull request #1518 from pnnl/RD/rule5_2_update
Browse files Browse the repository at this point in the history
update 5_2
  • Loading branch information
weilixu authored Sep 5, 2024
2 parents 84f02f2 + a009f59 commit 1c597c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
10 changes: 4 additions & 6 deletions rct229/rulesets/ashrae9012019/section5/section5rule2.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand All @@ -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",
Expand All @@ -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"
}
]
}
Expand All @@ -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)",
Expand All @@ -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",
Expand Down Expand Up @@ -144,9 +136,7 @@
]
},
{
"id": "Zone 2",
"thermostat_cooling_setpoint_schedule": "Cooling Schedule 1",
"thermostat_heating_setpoint_schedule": "Heating Schedule 1"
"id": "Zone 2"
}
]
}
Expand Down

0 comments on commit 1c597c2

Please sign in to comment.