From a4bb2b1ec12eaa20013995d40d72a55aeec25f57 Mon Sep 17 00:00:00 2001 From: jugonzal07 Date: Fri, 6 Feb 2026 16:17:39 -0500 Subject: [PATCH 1/2] First cut at ruletest 6-7 update to account for not-applicable zoens --- .../ashrae9012019/LTG/rule_6_7.json | 126 +++++++++++++++--- .../ashrae9012022/LTG/rule_6_7.json | 126 +++++++++++++++--- 2 files changed, 214 insertions(+), 38 deletions(-) diff --git a/rct229/ruletest_engine/ruletest_jsons/ashrae9012019/LTG/rule_6_7.json b/rct229/ruletest_engine/ruletest_jsons/ashrae9012019/LTG/rule_6_7.json index a26a531464..1e6487f792 100644 --- a/rct229/ruletest_engine/ruletest_jsons/ashrae9012019/LTG/rule_6_7.json +++ b/rct229/ruletest_engine/ruletest_jsons/ashrae9012019/LTG/rule_6_7.json @@ -3,10 +3,8 @@ "Section": 6, "Rule": 7, "Test": "a", - "test_description": "The project has one building segment with one zone and one space. The zone has a window subsurface and the interior lighting has daylighting control. Schedules are not used to model daylight schedules.", - "expected_rule_outcome": "undetermined", - "expected_raised_message_includes": "Some of the spaces in zone are modeled with window(s) and/or skylight(s) and have daylighting controls modeled explicitly in the simulation tool. Verify that the mandatory lighting control requirements are met.", "standard": { + "ruleset": "ashrae9012019", "rule_id": "6-7", "ruleset_reference": "Table G3.1(6) Proposed Building Performance (h)", "rule_description": "Automatic daylighting responsive controls shall be modeled directly in the proposed design or through schedule adjustments determined by a separate daylighting analysis. Modeling and schedule adjustments shall separately account for primary sidelighted areas, secondary sidelighted areas, and toplighted areas.", @@ -17,6 +15,9 @@ "mandatory_rule": "Full", "schema_version": "0.1.7" }, + "test_description": "The project has one building segment with one zone and one space. The building has a zone with a not-applicable space type.", + "expected_rule_outcome": "undetermined", + "expected_raised_message_includes": "The zone contains a not-applicable space type", "rmd_transformations": { "proposed": { "id": "ASHRAE229 1", @@ -35,10 +36,12 @@ "spaces": [ { "id": "Space 1", + "lighting_space_type": "DORMITORY_LIVING_QUARTERS", "floor_area": 92.90303999999999, "interior_lighting": [ { "id": "Lighting 1", + "power_per_area": 10.763910416709724, "daylighting_control_type": "STEPPED", "are_schedules_used_for_modeling_daylighting_control": false } @@ -73,10 +76,81 @@ "Section": 6, "Rule": 7, "Test": "b", - "test_description": "The project has one building segment with one zone and one space. The zone has two windows. The interior lighting has daylighting control, and schedules are used to model daylight schedules.", + "standard": { + "ruleset": "ashrae9012019", + "rule_id": "6-7", + "ruleset_reference": "Table G3.1(6) Proposed Building Performance (h)", + "rule_description": "Automatic daylighting responsive controls shall be modeled directly in the proposed design or through schedule adjustments determined by a separate daylighting analysis. Modeling and schedule adjustments shall separately account for primary sidelighted areas, secondary sidelighted areas, and toplighted areas.", + "applicable_rmr": "Proposed Design", + "rule_assertion": "=", + "comparison_value": "Expected Value", + "rule_dependency": "-", + "mandatory_rule": "Full", + "schema_version": "0.1.7" + }, + "test_description": "The project has one building segment with one zone and one space. The zone has a window subsurface and the interior lighting has daylighting control. Schedules are not used to model daylight schedules.", "expected_rule_outcome": "undetermined", - "expected_raised_message_includes": "Some of the spaces in zone are modeled with window(s) and/or skylight(s) and have daylighting controls modeled via schedule adjustment. Verify that the mandatory lighting control requirements are met, and that the supporting documentation is provided for the schedule adjustment.", + "expected_raised_message_includes": "Some of the spaces in zone are modeled with window(s) and/or skylight(s) and have daylighting controls modeled explicitly in the simulation tool. Verify that the mandatory lighting control requirements are met.", + "rmd_transformations": { + "proposed": { + "id": "ASHRAE229 1", + "ruleset_model_descriptions": [ + { + "id": "RMD 1", + "buildings": [ + { + "id": "Building 1", + "building_segments": [ + { + "id": "Building Segment 1", + "zones": [ + { + "id": "Thermal Zone 1", + "spaces": [ + { + "id": "Space 1", + "lighting_space_type": "OFFICE_ENCLOSED", + "floor_area": 92.90303999999999, + "interior_lighting": [ + { + "id": "Lighting 1", + "power_per_area": 10.763910416709724, + "daylighting_control_type": "STEPPED", + "are_schedules_used_for_modeling_daylighting_control": false + } + ] + } + ], + "surfaces": [ + { + "id": "surface_1", + "adjacent_to": "EXTERIOR", + "subsurfaces": [ + { + "id": "window_1", + "classification": "WINDOW" + } + ] + } + ] + } + ] + } + ] + } + ], + "type": "PROPOSED" + } + ] + } + } + }, + "rule-6-7-c": { + "Section": 6, + "Rule": 7, + "Test": "c", "standard": { + "ruleset": "ashrae9012019", "rule_id": "6-7", "ruleset_reference": "Table G3.1(6) Proposed Building Performance (h)", "rule_description": "Automatic daylighting responsive controls shall be modeled directly in the proposed design or through schedule adjustments determined by a separate daylighting analysis. Modeling and schedule adjustments shall separately account for primary sidelighted areas, secondary sidelighted areas, and toplighted areas.", @@ -87,6 +161,9 @@ "mandatory_rule": "Full", "schema_version": "0.1.7" }, + "test_description": "The project has one building segment with one zone and one space. The zone has two windows. The interior lighting has daylighting control, and schedules are used to model daylight schedules.", + "expected_rule_outcome": "undetermined", + "expected_raised_message_includes": "Some of the spaces in zone are modeled with window(s) and/or skylight(s) and have daylighting controls modeled via schedule adjustment. Verify that the mandatory lighting control requirements are met, and that the supporting documentation is provided for the schedule adjustment.", "rmd_transformations": { "proposed": { "id": "ASHRAE229 1", @@ -105,12 +182,14 @@ "spaces": [ { "id": "Space 1", + "lighting_space_type": "OFFICE_ENCLOSED", "floor_area": 92.90303999999999, "interior_lighting": [ { "id": "Lighting 1", + "power_per_area": 10.763910416709724, "daylighting_control_type": "STEPPED", - "are_schedules_used_for_modeling_daylighting_control": true + "are_schedules_used_for_modeling_daylighting_control": 1 } ] } @@ -148,14 +227,12 @@ } } }, - "rule-6-7-c": { + "rule-6-7-d": { "Section": 6, "Rule": 7, - "Test": "c", - "test_description": "The project has one building segment with one zone and one space. The zone has two windows. The interior lighting doesn't have daylighting control, and schedules are not used to model daylight schedules.", - "expected_rule_outcome": "fail", - "expected_raised_message_includes": "Some of the spaces in zone are modeled with fenestration but no daylighting controls. The design must include mandatory daylighting controls unless any of the exceptions to 90.1 section 9.4.1.1 apply.", + "Test": "d", "standard": { + "ruleset": "ashrae9012019", "rule_id": "6-7", "ruleset_reference": "Table G3.1(6) Proposed Building Performance (h)", "rule_description": "Automatic daylighting responsive controls shall be modeled directly in the proposed design or through schedule adjustments determined by a separate daylighting analysis. Modeling and schedule adjustments shall separately account for primary sidelighted areas, secondary sidelighted areas, and toplighted areas.", @@ -166,6 +243,9 @@ "mandatory_rule": "Full", "schema_version": "0.1.7" }, + "test_description": "The project has one building segment with one zone and one space. The zone has two windows. The interior lighting doesn't have daylighting control, and schedules are not used to model daylight schedules.", + "expected_rule_outcome": "fail", + "expected_raised_message_includes": "Some of the spaces in zone are modeled with fenestration but no daylighting controls. The design must include mandatory daylighting controls unless any of the exceptions to 90.1 section 9.4.1.1 apply.", "rmd_transformations": { "proposed": { "id": "ASHRAE229 1", @@ -184,10 +264,12 @@ "spaces": [ { "id": "Space 1", + "lighting_space_type": "OFFICE_ENCLOSED", "floor_area": 92.90303999999999, "interior_lighting": [ { "id": "Lighting 1", + "power_per_area": 10.763910416709724, "daylighting_control_type": "NONE", "are_schedules_used_for_modeling_daylighting_control": false } @@ -227,13 +309,12 @@ } } }, - "rule-6-7-d": { + "rule-6-7-e": { "Section": 6, "Rule": 7, - "Test": "d", - "test_description": "The project has one building segment with one zone and one space. The building has a door subsurface and no windows, the interior lighting has daylighting control, and schedules are not used to model daylight schedules.", - "expected_rule_outcome": "fail", + "Test": "e", "standard": { + "ruleset": "ashrae9012019", "rule_id": "6-7", "ruleset_reference": "Table G3.1(6) Proposed Building Performance (h)", "rule_description": "Automatic daylighting responsive controls shall be modeled directly in the proposed design or through schedule adjustments determined by a separate daylighting analysis. Modeling and schedule adjustments shall separately account for primary sidelighted areas, secondary sidelighted areas, and toplighted areas.", @@ -244,6 +325,8 @@ "mandatory_rule": "Full", "schema_version": "0.1.7" }, + "test_description": "The project has one building segment with one zone and one space. The building has a door subsurface and no windows, the interior lighting has daylighting control, and schedules are not used to model daylight schedules.", + "expected_rule_outcome": "fail", "rmd_transformations": { "proposed": { "id": "ASHRAE229 1", @@ -262,10 +345,12 @@ "spaces": [ { "id": "Space 1", + "lighting_space_type": "OFFICE_ENCLOSED", "floor_area": 92.90303999999999, "interior_lighting": [ { "id": "Lighting 1", + "power_per_area": 10.763910416709724, "daylighting_control_type": "STEPPED", "are_schedules_used_for_modeling_daylighting_control": false } @@ -300,13 +385,12 @@ } } }, - "rule-6-7-e": { + "rule-6-7-f": { "Section": 6, "Rule": 7, - "Test": "e", - "test_description": "The project has one building segment with one zone and one space. The zone has only interior walls. The building doesn\u2019t have a door subsurface, the interior lighting doesn't have daylighting control, and schedules are not used to model daylight schedules.", - "expected_rule_outcome": "pass", + "Test": "f", "standard": { + "ruleset": "ashrae9012019", "rule_id": "6-7", "ruleset_reference": "Table G3.1(6) Proposed Building Performance (h)", "rule_description": "Automatic daylighting responsive controls shall be modeled directly in the proposed design or through schedule adjustments determined by a separate daylighting analysis. Modeling and schedule adjustments shall separately account for primary sidelighted areas, secondary sidelighted areas, and toplighted areas.", @@ -317,6 +401,8 @@ "mandatory_rule": "Full", "schema_version": "0.1.7" }, + "test_description": "The project has one building segment with one zone and one space. The zone has only interior walls. The building doesn\u2019t have a door subsurface, the interior lighting doesn't have daylighting control, and schedules are not used to model daylight schedules.", + "expected_rule_outcome": "pass", "rmd_transformations": { "proposed": { "id": "ASHRAE229 1", @@ -335,10 +421,12 @@ "spaces": [ { "id": "Space 1", + "lighting_space_type": "OFFICE_ENCLOSED", "floor_area": 92.90303999999999, "interior_lighting": [ { "id": "Lighting 1", + "power_per_area": 10.763910416709724, "daylighting_control_type": "NONE", "are_schedules_used_for_modeling_daylighting_control": false } diff --git a/rct229/ruletest_engine/ruletest_jsons/ashrae9012022/LTG/rule_6_7.json b/rct229/ruletest_engine/ruletest_jsons/ashrae9012022/LTG/rule_6_7.json index a26a531464..51286c47a0 100644 --- a/rct229/ruletest_engine/ruletest_jsons/ashrae9012022/LTG/rule_6_7.json +++ b/rct229/ruletest_engine/ruletest_jsons/ashrae9012022/LTG/rule_6_7.json @@ -3,10 +3,8 @@ "Section": 6, "Rule": 7, "Test": "a", - "test_description": "The project has one building segment with one zone and one space. The zone has a window subsurface and the interior lighting has daylighting control. Schedules are not used to model daylight schedules.", - "expected_rule_outcome": "undetermined", - "expected_raised_message_includes": "Some of the spaces in zone are modeled with window(s) and/or skylight(s) and have daylighting controls modeled explicitly in the simulation tool. Verify that the mandatory lighting control requirements are met.", "standard": { + "ruleset": "ashrae9012022", "rule_id": "6-7", "ruleset_reference": "Table G3.1(6) Proposed Building Performance (h)", "rule_description": "Automatic daylighting responsive controls shall be modeled directly in the proposed design or through schedule adjustments determined by a separate daylighting analysis. Modeling and schedule adjustments shall separately account for primary sidelighted areas, secondary sidelighted areas, and toplighted areas.", @@ -17,6 +15,9 @@ "mandatory_rule": "Full", "schema_version": "0.1.7" }, + "test_description": "The project has one building segment with one zone and one space. The building has a zone with a not-applicable space type.", + "expected_rule_outcome": "undetermined", + "expected_raised_message_includes": "The zone contains a not-applicable space type", "rmd_transformations": { "proposed": { "id": "ASHRAE229 1", @@ -35,10 +36,12 @@ "spaces": [ { "id": "Space 1", + "lighting_space_type": "DORMITORY_LIVING_QUARTERS", "floor_area": 92.90303999999999, "interior_lighting": [ { "id": "Lighting 1", + "power_per_area": 10.763910416709724, "daylighting_control_type": "STEPPED", "are_schedules_used_for_modeling_daylighting_control": false } @@ -73,10 +76,81 @@ "Section": 6, "Rule": 7, "Test": "b", - "test_description": "The project has one building segment with one zone and one space. The zone has two windows. The interior lighting has daylighting control, and schedules are used to model daylight schedules.", + "standard": { + "ruleset": "ashrae9012022", + "rule_id": "6-7", + "ruleset_reference": "Table G3.1(6) Proposed Building Performance (h)", + "rule_description": "Automatic daylighting responsive controls shall be modeled directly in the proposed design or through schedule adjustments determined by a separate daylighting analysis. Modeling and schedule adjustments shall separately account for primary sidelighted areas, secondary sidelighted areas, and toplighted areas.", + "applicable_rmr": "Proposed Design", + "rule_assertion": "=", + "comparison_value": "Expected Value", + "rule_dependency": "-", + "mandatory_rule": "Full", + "schema_version": "0.1.7" + }, + "test_description": "The project has one building segment with one zone and one space. The zone has a window subsurface and the interior lighting has daylighting control. Schedules are not used to model daylight schedules.", "expected_rule_outcome": "undetermined", - "expected_raised_message_includes": "Some of the spaces in zone are modeled with window(s) and/or skylight(s) and have daylighting controls modeled via schedule adjustment. Verify that the mandatory lighting control requirements are met, and that the supporting documentation is provided for the schedule adjustment.", + "expected_raised_message_includes": "Some of the spaces in zone are modeled with window(s) and/or skylight(s) and have daylighting controls modeled explicitly in the simulation tool. Verify that the mandatory lighting control requirements are met.", + "rmd_transformations": { + "proposed": { + "id": "ASHRAE229 1", + "ruleset_model_descriptions": [ + { + "id": "RMD 1", + "buildings": [ + { + "id": "Building 1", + "building_segments": [ + { + "id": "Building Segment 1", + "zones": [ + { + "id": "Thermal Zone 1", + "spaces": [ + { + "id": "Space 1", + "lighting_space_type": "OFFICE_ENCLOSED", + "floor_area": 92.90303999999999, + "interior_lighting": [ + { + "id": "Lighting 1", + "power_per_area": 10.763910416709724, + "daylighting_control_type": "STEPPED", + "are_schedules_used_for_modeling_daylighting_control": false + } + ] + } + ], + "surfaces": [ + { + "id": "surface_1", + "adjacent_to": "EXTERIOR", + "subsurfaces": [ + { + "id": "window_1", + "classification": "WINDOW" + } + ] + } + ] + } + ] + } + ] + } + ], + "type": "PROPOSED" + } + ] + } + } + }, + "rule-6-7-c": { + "Section": 6, + "Rule": 7, + "Test": "c", "standard": { + "ruleset": "ashrae9012022", "rule_id": "6-7", "ruleset_reference": "Table G3.1(6) Proposed Building Performance (h)", "rule_description": "Automatic daylighting responsive controls shall be modeled directly in the proposed design or through schedule adjustments determined by a separate daylighting analysis. Modeling and schedule adjustments shall separately account for primary sidelighted areas, secondary sidelighted areas, and toplighted areas.", @@ -87,6 +161,9 @@ "mandatory_rule": "Full", "schema_version": "0.1.7" }, + "test_description": "The project has one building segment with one zone and one space. The zone has two windows. The interior lighting has daylighting control, and schedules are used to model daylight schedules.", + "expected_rule_outcome": "undetermined", + "expected_raised_message_includes": "Some of the spaces in zone are modeled with window(s) and/or skylight(s) and have daylighting controls modeled via schedule adjustment. Verify that the mandatory lighting control requirements are met, and that the supporting documentation is provided for the schedule adjustment.", "rmd_transformations": { "proposed": { "id": "ASHRAE229 1", @@ -105,12 +182,14 @@ "spaces": [ { "id": "Space 1", + "lighting_space_type": "OFFICE_ENCLOSED", "floor_area": 92.90303999999999, "interior_lighting": [ { "id": "Lighting 1", + "power_per_area": 10.763910416709724, "daylighting_control_type": "STEPPED", - "are_schedules_used_for_modeling_daylighting_control": true + "are_schedules_used_for_modeling_daylighting_control": 1 } ] } @@ -148,14 +227,12 @@ } } }, - "rule-6-7-c": { + "rule-6-7-d": { "Section": 6, "Rule": 7, - "Test": "c", - "test_description": "The project has one building segment with one zone and one space. The zone has two windows. The interior lighting doesn't have daylighting control, and schedules are not used to model daylight schedules.", - "expected_rule_outcome": "fail", - "expected_raised_message_includes": "Some of the spaces in zone are modeled with fenestration but no daylighting controls. The design must include mandatory daylighting controls unless any of the exceptions to 90.1 section 9.4.1.1 apply.", + "Test": "d", "standard": { + "ruleset": "ashrae9012022", "rule_id": "6-7", "ruleset_reference": "Table G3.1(6) Proposed Building Performance (h)", "rule_description": "Automatic daylighting responsive controls shall be modeled directly in the proposed design or through schedule adjustments determined by a separate daylighting analysis. Modeling and schedule adjustments shall separately account for primary sidelighted areas, secondary sidelighted areas, and toplighted areas.", @@ -166,6 +243,9 @@ "mandatory_rule": "Full", "schema_version": "0.1.7" }, + "test_description": "The project has one building segment with one zone and one space. The zone has two windows. The interior lighting doesn't have daylighting control, and schedules are not used to model daylight schedules.", + "expected_rule_outcome": "fail", + "expected_raised_message_includes": "Some of the spaces in zone are modeled with fenestration but no daylighting controls. The design must include mandatory daylighting controls unless any of the exceptions to 90.1 section 9.4.1.1 apply.", "rmd_transformations": { "proposed": { "id": "ASHRAE229 1", @@ -184,10 +264,12 @@ "spaces": [ { "id": "Space 1", + "lighting_space_type": "OFFICE_ENCLOSED", "floor_area": 92.90303999999999, "interior_lighting": [ { "id": "Lighting 1", + "power_per_area": 10.763910416709724, "daylighting_control_type": "NONE", "are_schedules_used_for_modeling_daylighting_control": false } @@ -227,13 +309,12 @@ } } }, - "rule-6-7-d": { + "rule-6-7-e": { "Section": 6, "Rule": 7, - "Test": "d", - "test_description": "The project has one building segment with one zone and one space. The building has a door subsurface and no windows, the interior lighting has daylighting control, and schedules are not used to model daylight schedules.", - "expected_rule_outcome": "fail", + "Test": "e", "standard": { + "ruleset": "ashrae9012022", "rule_id": "6-7", "ruleset_reference": "Table G3.1(6) Proposed Building Performance (h)", "rule_description": "Automatic daylighting responsive controls shall be modeled directly in the proposed design or through schedule adjustments determined by a separate daylighting analysis. Modeling and schedule adjustments shall separately account for primary sidelighted areas, secondary sidelighted areas, and toplighted areas.", @@ -244,6 +325,8 @@ "mandatory_rule": "Full", "schema_version": "0.1.7" }, + "test_description": "The project has one building segment with one zone and one space. The building has a door subsurface and no windows, the interior lighting has daylighting control, and schedules are not used to model daylight schedules.", + "expected_rule_outcome": "fail", "rmd_transformations": { "proposed": { "id": "ASHRAE229 1", @@ -262,10 +345,12 @@ "spaces": [ { "id": "Space 1", + "lighting_space_type": "OFFICE_ENCLOSED", "floor_area": 92.90303999999999, "interior_lighting": [ { "id": "Lighting 1", + "power_per_area": 10.763910416709724, "daylighting_control_type": "STEPPED", "are_schedules_used_for_modeling_daylighting_control": false } @@ -300,13 +385,12 @@ } } }, - "rule-6-7-e": { + "rule-6-7-f": { "Section": 6, "Rule": 7, - "Test": "e", - "test_description": "The project has one building segment with one zone and one space. The zone has only interior walls. The building doesn\u2019t have a door subsurface, the interior lighting doesn't have daylighting control, and schedules are not used to model daylight schedules.", - "expected_rule_outcome": "pass", + "Test": "f", "standard": { + "ruleset": "ashrae9012022", "rule_id": "6-7", "ruleset_reference": "Table G3.1(6) Proposed Building Performance (h)", "rule_description": "Automatic daylighting responsive controls shall be modeled directly in the proposed design or through schedule adjustments determined by a separate daylighting analysis. Modeling and schedule adjustments shall separately account for primary sidelighted areas, secondary sidelighted areas, and toplighted areas.", @@ -317,6 +401,8 @@ "mandatory_rule": "Full", "schema_version": "0.1.7" }, + "test_description": "The project has one building segment with one zone and one space. The zone has only interior walls. The building doesn\u2019t have a door subsurface, the interior lighting doesn't have daylighting control, and schedules are not used to model daylight schedules.", + "expected_rule_outcome": "pass", "rmd_transformations": { "proposed": { "id": "ASHRAE229 1", @@ -335,10 +421,12 @@ "spaces": [ { "id": "Space 1", + "lighting_space_type": "OFFICE_ENCLOSED", "floor_area": 92.90303999999999, "interior_lighting": [ { "id": "Lighting 1", + "power_per_area": 10.763910416709724, "daylighting_control_type": "NONE", "are_schedules_used_for_modeling_daylighting_control": false } From e01029de3faea744dd62127b27513f438476fe2c Mon Sep 17 00:00:00 2001 From: yunjoonjung Date: Thu, 12 Feb 2026 13:25:55 -0800 Subject: [PATCH 2/2] Updated 6-7 rule logic --- .../ashrae9012019/section6/section6rule7.py | 74 ++++++++++++++----- .../ashrae9012022/section6/section6rule7.py | 74 ++++++++++++++----- .../ashrae9012019/LTG/rule_6_7.json | 2 +- .../ashrae9012022/LTG/rule_6_7.json | 2 +- 4 files changed, 116 insertions(+), 36 deletions(-) diff --git a/rct229/rulesets/ashrae9012019/section6/section6rule7.py b/rct229/rulesets/ashrae9012019/section6/section6rule7.py index 6b8402f3f9..d2baa70071 100644 --- a/rct229/rulesets/ashrae9012019/section6/section6rule7.py +++ b/rct229/rulesets/ashrae9012019/section6/section6rule7.py @@ -2,9 +2,11 @@ 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 PROPOSED +from rct229.schema.config import ureg from rct229.schema.schema_enums import SchemaEnums from rct229.utils.jsonpath_utils import find_all +MSG_WARN_NA_LTG_POWER = "The zone contains a not-applicable space type with lighting power. Verify that the mandatory daylighting control requirements are met, if applicable." MSG_WARN_DAYLIGHT_NO_SCHEDULE = "Some of the spaces in zone are modeled with window(s) and/or skylight(s) and have daylighting controls modeled explicitly in the simulation tool. Verify that the mandatory lighting control requirements are met." MSG_WARN_DAYLIGHT = "Some of the spaces in zone are modeled with window(s) and/or skylight(s) and have daylighting controls modeled via schedule adjustment. Verify that the mandatory lighting control requirements are met, and that the supporting documentation is provided for the schedule adjustment." MSG_WARN_NO_DAYLIGHT = "Some of the spaces in zone are modeled with fenestration but no daylighting controls. The design must include mandatory daylighting controls unless any of the exceptions to 90.1 section 9.4.1.1 apply." @@ -12,6 +14,19 @@ DOOR = SchemaEnums.schema_enums["SubsurfaceClassificationOptions"].DOOR EXTERIOR = SchemaEnums.schema_enums["SurfaceAdjacencyOptions"].EXTERIOR NONE = SchemaEnums.schema_enums["LightingDaylightingControlOptions"].NONE +LIGHTING_SPACE = SchemaEnums.schema_enums["LightingSpaceOptions2019ASHRAE901TG37"] + +NOT_APPLICABLE_SPACE_TYPES = [ + LIGHTING_SPACE.DORMITORY_LIVING_QUARTERS, + LIGHTING_SPACE.FIRE_STATION_SLEEPING_QUARTERS, + LIGHTING_SPACE.HEALTHCARE_FACILITY_OPERATING_ROOM, + # LIGHTING_SPACE.OUTPATIENT_HEALTH_CARE_FACILITIES_CLASS_1_IMAGING_ROOMS, + LIGHTING_SPACE.DWELLING_UNIT, + LIGHTING_SPACE.GUEST_ROOM, + LIGHTING_SPACE.STORAGE_ROOM_SMALL, + LIGHTING_SPACE.PARKING_AREA_INTERIOR, + LIGHTING_SPACE.NONE, +] class PRM9012019Rule66m62(RuleDefinitionListIndexedBase): @@ -55,7 +70,7 @@ def get_calc_vals(self, context, data=None): > 0 ) - has_daylight_control_flag = ( + has_daylight_control_flag_p = ( len( find_all( # interior_lighting instances with daylighting_control_type set to NONE @@ -66,7 +81,7 @@ def get_calc_vals(self, context, data=None): > 0 ) - daylight_schedule_adjustment_flag = any( + daylight_schedule_adjustment_flag_p = any( find_all( # interior_lighting instances with are_schedules_used_for_modeling_daylighting_control set to True "$.spaces[*].interior_lighting[*][?(@.are_schedules_used_for_modeling_daylighting_control = true)]", @@ -74,41 +89,66 @@ def get_calc_vals(self, context, data=None): ) ) + na_space_with_lighting_power_flag_P = any( + [ + space_p.get("lighting_space_type") in NOT_APPLICABLE_SPACE_TYPES + and sum( + [ + int_ltg_p.get("power_per_area", 0 * ureg("W/m2")) + for int_ltg_p in find_all("$.interior_lighting[*]", space_p) + ] + ) + for space_p in find_all("$.spaces[*]", zone_p) + ] + ) + return { "daylight_flag_p": daylight_flag_p, - "has_daylight_control_flag": has_daylight_control_flag, - "daylight_schedule_adjustment_flag": daylight_schedule_adjustment_flag, + "has_daylight_control_flag_p": has_daylight_control_flag_p, + "daylight_schedule_adjustment_flag_p": daylight_schedule_adjustment_flag_p, + "na_space_with_lighting_power_flag_P": na_space_with_lighting_power_flag_P, } def manual_check_required(self, context, calc_vals=None, data=None): + na_space_with_lighting_power_flag_P = calc_vals[ + "na_space_with_lighting_power_flag_P" + ] daylight_flag_p = calc_vals["daylight_flag_p"] - has_daylight_control_flag = calc_vals["has_daylight_control_flag"] + has_daylight_control_flag_p = calc_vals["has_daylight_control_flag_p"] - return daylight_flag_p and has_daylight_control_flag + return na_space_with_lighting_power_flag_P or ( + daylight_flag_p and has_daylight_control_flag_p + ) def get_manual_check_required_msg(self, context, calc_vals=None, data=None): - daylight_schedule_adjustment_flag = calc_vals[ - "daylight_schedule_adjustment_flag" + na_space_with_lighting_power_flag_P = calc_vals[ + "na_space_with_lighting_power_flag_P" + ] + daylight_schedule_adjustment_flag_p = calc_vals[ + "daylight_schedule_adjustment_flag_p" ] - return ( - MSG_WARN_DAYLIGHT - if daylight_schedule_adjustment_flag - else MSG_WARN_DAYLIGHT_NO_SCHEDULE - ) + if na_space_with_lighting_power_flag_P: + UNDETERMINED_MSG = MSG_WARN_NA_LTG_POWER + elif daylight_schedule_adjustment_flag_p: + UNDETERMINED_MSG = MSG_WARN_DAYLIGHT + elif not daylight_schedule_adjustment_flag_p: + UNDETERMINED_MSG = MSG_WARN_DAYLIGHT_NO_SCHEDULE + + return UNDETERMINED_MSG def rule_check(self, context, calc_vals, data=None): daylight_flag_p = calc_vals["daylight_flag_p"] - has_daylight_control_flag = calc_vals["has_daylight_control_flag"] + has_daylight_control_flag_p = calc_vals["has_daylight_control_flag_p"] - return not daylight_flag_p and not has_daylight_control_flag + return not daylight_flag_p and not has_daylight_control_flag_p def get_fail_msg(self, context, calc_vals=None, data=None): daylight_flag_p = calc_vals["daylight_flag_p"] - has_daylight_control_flag = calc_vals["has_daylight_control_flag"] + has_daylight_control_flag_p = calc_vals["has_daylight_control_flag_p"] return ( MSG_WARN_NO_DAYLIGHT - if daylight_flag_p and not has_daylight_control_flag + if daylight_flag_p and not has_daylight_control_flag_p else "" ) diff --git a/rct229/rulesets/ashrae9012022/section6/section6rule7.py b/rct229/rulesets/ashrae9012022/section6/section6rule7.py index a09b877eeb..5bff29d8ca 100644 --- a/rct229/rulesets/ashrae9012022/section6/section6rule7.py +++ b/rct229/rulesets/ashrae9012022/section6/section6rule7.py @@ -2,9 +2,11 @@ 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.ashrae9012022 import PROPOSED +from rct229.schema.config import ureg from rct229.schema.schema_enums import SchemaEnums from rct229.utils.jsonpath_utils import find_all +MSG_WARN_NA_LTG_POWER = "The zone contains a not-applicable space type with lighting power. Verify that the mandatory daylighting control requirements are met, if applicable." MSG_WARN_DAYLIGHT_NO_SCHEDULE = "Some of the spaces in zone are modeled with window(s) and/or skylight(s) and have daylighting controls modeled explicitly in the simulation tool. Verify that the mandatory lighting control requirements are met." MSG_WARN_DAYLIGHT = "Some of the spaces in zone are modeled with window(s) and/or skylight(s) and have daylighting controls modeled via schedule adjustment. Verify that the mandatory lighting control requirements are met, and that the supporting documentation is provided for the schedule adjustment." MSG_WARN_NO_DAYLIGHT = "Some of the spaces in zone are modeled with fenestration but no daylighting controls. The design must include mandatory daylighting controls unless any of the exceptions to 90.1 section 9.4.1.1 apply." @@ -12,6 +14,19 @@ DOOR = SchemaEnums.schema_enums["SubsurfaceClassificationOptions"].DOOR EXTERIOR = SchemaEnums.schema_enums["SurfaceAdjacencyOptions"].EXTERIOR NONE = SchemaEnums.schema_enums["LightingDaylightingControlOptions"].NONE +LIGHTING_SPACE = SchemaEnums.schema_enums["LightingSpaceOptions2019ASHRAE901TG37"] + +NOT_APPLICABLE_SPACE_TYPES = [ + LIGHTING_SPACE.DORMITORY_LIVING_QUARTERS, + LIGHTING_SPACE.FIRE_STATION_SLEEPING_QUARTERS, + LIGHTING_SPACE.HEALTHCARE_FACILITY_OPERATING_ROOM, + # LIGHTING_SPACE.OUTPATIENT_HEALTH_CARE_FACILITIES_CLASS_1_IMAGING_ROOMS, + LIGHTING_SPACE.DWELLING_UNIT, + LIGHTING_SPACE.GUEST_ROOM, + LIGHTING_SPACE.STORAGE_ROOM_SMALL, + LIGHTING_SPACE.PARKING_AREA_INTERIOR, + LIGHTING_SPACE.NONE, +] class PRM9012022Rule66m62(RuleDefinitionListIndexedBase): @@ -55,7 +70,7 @@ def get_calc_vals(self, context, data=None): > 0 ) - has_daylight_control_flag = ( + has_daylight_control_flag_p = ( len( find_all( # interior_lighting instances with daylighting_control_type set to NONE @@ -66,7 +81,7 @@ def get_calc_vals(self, context, data=None): > 0 ) - daylight_schedule_adjustment_flag = any( + daylight_schedule_adjustment_flag_p = any( find_all( # interior_lighting instances with are_schedules_used_for_modeling_daylighting_control set to True "$.spaces[*].interior_lighting[*][?(@.are_schedules_used_for_modeling_daylighting_control = true)]", @@ -74,41 +89,66 @@ def get_calc_vals(self, context, data=None): ) ) + na_space_with_lighting_power_flag_P = any( + [ + space_p.get("lighting_space_type") in NOT_APPLICABLE_SPACE_TYPES + and sum( + [ + int_ltg_p.get("power_per_area", 0 * ureg("W/m2")) + for int_ltg_p in find_all("$.interior_lighting[*]", space_p) + ] + ) + for space_p in find_all("$.spaces[*]", zone_p) + ] + ) + return { "daylight_flag_p": daylight_flag_p, - "has_daylight_control_flag": has_daylight_control_flag, - "daylight_schedule_adjustment_flag": daylight_schedule_adjustment_flag, + "has_daylight_control_flag_p": has_daylight_control_flag_p, + "daylight_schedule_adjustment_flag_p": daylight_schedule_adjustment_flag_p, + "na_space_with_lighting_power_flag_P": na_space_with_lighting_power_flag_P, } def manual_check_required(self, context, calc_vals=None, data=None): + na_space_with_lighting_power_flag_P = calc_vals[ + "na_space_with_lighting_power_flag_P" + ] daylight_flag_p = calc_vals["daylight_flag_p"] - has_daylight_control_flag = calc_vals["has_daylight_control_flag"] + has_daylight_control_flag_p = calc_vals["has_daylight_control_flag_p"] - return daylight_flag_p and has_daylight_control_flag + return na_space_with_lighting_power_flag_P or ( + daylight_flag_p and has_daylight_control_flag_p + ) def get_manual_check_required_msg(self, context, calc_vals=None, data=None): - daylight_schedule_adjustment_flag = calc_vals[ - "daylight_schedule_adjustment_flag" + na_space_with_lighting_power_flag_P = calc_vals[ + "na_space_with_lighting_power_flag_P" + ] + daylight_schedule_adjustment_flag_p = calc_vals[ + "daylight_schedule_adjustment_flag_p" ] - return ( - MSG_WARN_DAYLIGHT - if daylight_schedule_adjustment_flag - else MSG_WARN_DAYLIGHT_NO_SCHEDULE - ) + if na_space_with_lighting_power_flag_P: + UNDETERMINED_MSG = MSG_WARN_NA_LTG_POWER + elif daylight_schedule_adjustment_flag_p: + UNDETERMINED_MSG = MSG_WARN_DAYLIGHT + elif not daylight_schedule_adjustment_flag_p: + UNDETERMINED_MSG = MSG_WARN_DAYLIGHT_NO_SCHEDULE + + return UNDETERMINED_MSG def rule_check(self, context, calc_vals, data=None): daylight_flag_p = calc_vals["daylight_flag_p"] - has_daylight_control_flag = calc_vals["has_daylight_control_flag"] + has_daylight_control_flag_p = calc_vals["has_daylight_control_flag_p"] - return not daylight_flag_p and not has_daylight_control_flag + return not daylight_flag_p and not has_daylight_control_flag_p def get_fail_msg(self, context, calc_vals=None, data=None): daylight_flag_p = calc_vals["daylight_flag_p"] - has_daylight_control_flag = calc_vals["has_daylight_control_flag"] + has_daylight_control_flag_p = calc_vals["has_daylight_control_flag_p"] return ( MSG_WARN_NO_DAYLIGHT - if daylight_flag_p and not has_daylight_control_flag + if daylight_flag_p and not has_daylight_control_flag_p else "" ) diff --git a/rct229/ruletest_engine/ruletest_jsons/ashrae9012019/LTG/rule_6_7.json b/rct229/ruletest_engine/ruletest_jsons/ashrae9012019/LTG/rule_6_7.json index 1e6487f792..7423a12d57 100644 --- a/rct229/ruletest_engine/ruletest_jsons/ashrae9012019/LTG/rule_6_7.json +++ b/rct229/ruletest_engine/ruletest_jsons/ashrae9012019/LTG/rule_6_7.json @@ -189,7 +189,7 @@ "id": "Lighting 1", "power_per_area": 10.763910416709724, "daylighting_control_type": "STEPPED", - "are_schedules_used_for_modeling_daylighting_control": 1 + "are_schedules_used_for_modeling_daylighting_control": true } ] } diff --git a/rct229/ruletest_engine/ruletest_jsons/ashrae9012022/LTG/rule_6_7.json b/rct229/ruletest_engine/ruletest_jsons/ashrae9012022/LTG/rule_6_7.json index 51286c47a0..d0d65c2f03 100644 --- a/rct229/ruletest_engine/ruletest_jsons/ashrae9012022/LTG/rule_6_7.json +++ b/rct229/ruletest_engine/ruletest_jsons/ashrae9012022/LTG/rule_6_7.json @@ -189,7 +189,7 @@ "id": "Lighting 1", "power_per_area": 10.763910416709724, "daylighting_control_type": "STEPPED", - "are_schedules_used_for_modeling_daylighting_control": 1 + "are_schedules_used_for_modeling_daylighting_control": true } ] }