From b3d3b3b1e5fbd7768b2df09396df55f1da8f1a78 Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Thu, 21 Mar 2024 14:00:43 -0400 Subject: [PATCH 01/21] Create Rule11-3 --- docs/Section 11/Rule11-3 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 docs/Section 11/Rule11-3 diff --git a/docs/Section 11/Rule11-3 b/docs/Section 11/Rule11-3 new file mode 100644 index 0000000000..227321ea57 --- /dev/null +++ b/docs/Section 11/Rule11-3 @@ -0,0 +1,32 @@ +# Section 11 - SHW - Rule 11-3 +**Schema Version:** 0.0.36 +**Mandatory Rule:** True +**Rule ID:** 11-3 +**Rule Description:** Where no service water-heating system exists or has been designed and submitted with design documents but the building will have service water-heating loads, a service water-heating system shall be modeled that matches the system type in the baseline building design +**Rule Assertion:** Options are Pass/Fail/NOT_APPLICABLE +**Appendix G Section:** Table G3.1.11(c) + +**Data Lookup:** None + +**Evaluation Context:** RMD + +**Applicability Checks:** Check that the User model doesn't have any ServiceWaterHeatingEquipment, and that the user model has at least one ServiceWaterHeatingUse + +**Function Calls:** None + +## Applicability: +- look for ServiceWaterHeatingEquipment in the user model: `if len(U_RMD.service_water_heating_equipment) > 0:` + - look for ServiceWaterHeatingUse in the spaces in the proposed model: `for space in U_RMD:` + - check for any service_water_heating_uses in the space: `if len(space.service_water_heating_uses) > 0: CONTINUE TO RULE LOGIC` +- if the program reaches this line without going to the rule logic, the project is not applicable: `NOT_APPLICABLE` + +## Rule Logic: +- create a variable that describes the type of SHW system found and initialize it by setting it to NONE: `shw_system_found = "NONE"` +- now look for ServiceWaterHeatingEquipment in the P_RMD - we want to find exactly one system per building + + **Rule Assertion:** + + - Case 1: + - Case 2: + +**[Back](../_toc.md)** From 3e73554cd81ab05437e94ab176a3ff7c058b5c21 Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Wed, 17 Apr 2024 13:08:46 -0400 Subject: [PATCH 02/21] Create 11-1.md --- docs/section11/11-1.md | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 docs/section11/11-1.md diff --git a/docs/section11/11-1.md b/docs/section11/11-1.md new file mode 100644 index 0000000000..b16d2de2a7 --- /dev/null +++ b/docs/section11/11-1.md @@ -0,0 +1,46 @@ +- create a boolean to keep track of whether everything matches: `all_match = TRUE` +- create an error string: `error_str = ""` +- create the compare context string: `compare_context_str = "AppG 11-1 P_RMD Equals U_RMD"` +- check if the ServiceWaterHeatingDistributionSystem matches between the propoesd and user models. First check whether there are the same number of systems: `if len(P_RMD.service_water_heating_distribution_systems) == len(B_RMD.service_water_heating_distribution_systems):` + - look at each SHW distribution system in the proposed model and see if there is one that is the same in the user model. This check relies on the understanding that the RCT team has a method for comparing all elements within an object match (compare_context_pair): `for p_SHW_dist_system in P_RMD.service_water_heating_distribution_systems:` + - if this system is in B_RMD.service_water_heating_distribution_systems, compare the systems: `if p_SHW_dist_system in B_RMD.service_water_heating_distribution_systems:` + - use compare_context_pair to compare systems and set all_match to FALSE if the systems don't compare: `if !compare_context_pair(p_SHW_dist_system, B_RMD.get_component_by_id(p_SHW_dist_system.id),$,extra_schema_for_SHW_comparison.json,true,compare_context_str,error_str): all_match = FALSE` + - otherwise, set all_match to false: `else: all_match = FALSE` +- otherwise, all_match is false: `all_match = FALSE` +- continue if all_match is still true: `if all_match:` + - do the same comparison for ServiceWaterHeatingEquipment in the proposed and user models: `if len(P_RMD.service_water_heating_distribution_systems) == len(B_RMD.service_water_heating_distribution_systems):` + - look at each SHW system in the proposed model and see if there is one that is the same in the user model. This check relies on the understanding that the RCT team has a method for comparing all elements within an object match (compare_context_pair): `for p_SHW_equipment in P_RMD.service_water_heating_equipment:` + - use compare_context_pair to compare systems and set all_match to FALSE if the systems don't compare: `if !compare_context_pair(p_SHW_equipment, B_RMD.get_component_by_id(p_SHW_equipment.id),$,extra_schema_for_SHW_comparison.json,true,compare_context_str,error_str): all_match = FALSE` + - otherwise, set all_match to false: `else: all_match = FALSE` + - otherwise, all_match is false: `all_match = FALSE` + +- we also need to compare the pumps connected to the DHW system, but not all pumps in the models are DHW pumps. Create a list of the SHW pumps `shw_pumps_list = []` +- Iterate through the pumps in the proposed model: `for pump_p in P_RMI.pumps:` + - check that the pump is connected to a ServiceWaterPiping object: `if type(pump_p.loop_or_piping) == ServiceWaterPiping:` + - add the pump to the SHW pumps list: `shw_pumps_list.append(pump_p.id)` +- Iterate through the pumps in the user model: `for pump_u in U_RMI.pumps:` + - check that the pump is connected to a ServiceWaterPiping object: `if type(pump_u.loop_or_piping) == ServiceWaterPiping:` + - add the pump to the SHW pumps list: `shw_pumps_list.append(pump_u.id)` +- Iterate through the pump ids in the shw pumps list: `for pump_id in set(shw_pumps_list):` + - find the pump in the proposed model: `pump_p = get_component_by_id(pump_id, P_RMI)` + - find the pump in the user model: `pump_u = get_component_by_id(pump_id, U_RMI)` + - if both pump_p and pump_u exist, we compare them using compare_context_pair: `if !compare_context_pair(pump_p, pump_u,$,extra_schema_for_SHW_comparison.json,true,compare_context_str,error_str): all_match = FALSE` + - otherwise, the pump exists in only one of the two models, set all_match to false: `all_match = FALSE` + +## Rule Assertion: +- Case1: all elements are equal: PASS: `if all_match: PASS` +- Case2: all elements don't match, FAIL: if !all_match: FAIL` + + + + + **Rule Assertion:** + - if all_match is TRUE, then return PASS: `if all_match: return PASS` + - if all_match is FALSE, return FAIL, one of the elements does not match, provide the error_str from the compare_context_pair function: `if not all_match: return FAIL; note = error_str` + + + **Notes:** + 1. using compare_context_pair might not be the correct approach - this function requires data elements in the extra schema to have a tag "AppG P_RMD Equals U_RMD" - is it possible to pass in a custom json created for this rule which identifies which elements need to be equal? + 2. using compare_context_pair - how are sub-components like [{Tank}] (in ServiceWaterHeatingDistributionSystem) and {Tank} (in SolarThermal and ServiceWaterHeatingEquipment) evaluated? - also {Pump} and {ServiceWaterPiping} + +**[Back](../_toc.md)** From b6cfa31ac3b98fd92865a499040a08b2661fed9d Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Wed, 17 Apr 2024 13:11:31 -0400 Subject: [PATCH 03/21] Update 11-1.md --- docs/section11/11-1.md | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/docs/section11/11-1.md b/docs/section11/11-1.md index b16d2de2a7..a01511b554 100644 --- a/docs/section11/11-1.md +++ b/docs/section11/11-1.md @@ -1,6 +1,30 @@ +# Section 11 - SHW - Rule 11-3 +**Schema Version:** 0.0.36 +**Mandatory Rule:** True +**Rule ID:** 11-3 +**Rule Description:** Where no service water-heating system exists or has been designed and submitted with design documents but the building will have service water-heating loads, a service water-heating system shall be modeled that matches the system type in the baseline building design +**Rule Assertion:** Options are Pass/Fail/NOT_APPLICABLE +**Appendix G Section:** Table G3.1.11(c) + +**Data Lookup:** None + +**Evaluation Context:** RMD + +**Applicability Checks:** Check that the User model doesn't have any ServiceWaterHeatingEquipment, and that the user model has at least one ServiceWaterHeatingUse + +**Function Calls:** None + +## Applicability: +- look for ServiceWaterHeatingEquipment in the user model: `if len(U_RMD.service_water_heating_equipment) > 0:` + - look for ServiceWaterHeatingUse in the spaces in the proposed model: `for space in U_RMD:` + - check for any service_water_heating_uses in the space: `if len(space.service_water_heating_uses) > 0: CONTINUE TO RULE LOGIC` +- if the program reaches this line without going to the rule logic, the project is not applicable: `NOT_APPLICABLE` + +## Rule Logic: + - create a boolean to keep track of whether everything matches: `all_match = TRUE` - create an error string: `error_str = ""` -- create the compare context string: `compare_context_str = "AppG 11-1 P_RMD Equals U_RMD"` +- create the compare context string: `compare_context_str = "AppG 11-3 P_RMD Equals B_RMD"` - check if the ServiceWaterHeatingDistributionSystem matches between the propoesd and user models. First check whether there are the same number of systems: `if len(P_RMD.service_water_heating_distribution_systems) == len(B_RMD.service_water_heating_distribution_systems):` - look at each SHW distribution system in the proposed model and see if there is one that is the same in the user model. This check relies on the understanding that the RCT team has a method for comparing all elements within an object match (compare_context_pair): `for p_SHW_dist_system in P_RMD.service_water_heating_distribution_systems:` - if this system is in B_RMD.service_water_heating_distribution_systems, compare the systems: `if p_SHW_dist_system in B_RMD.service_water_heating_distribution_systems:` @@ -18,13 +42,13 @@ - Iterate through the pumps in the proposed model: `for pump_p in P_RMI.pumps:` - check that the pump is connected to a ServiceWaterPiping object: `if type(pump_p.loop_or_piping) == ServiceWaterPiping:` - add the pump to the SHW pumps list: `shw_pumps_list.append(pump_p.id)` -- Iterate through the pumps in the user model: `for pump_u in U_RMI.pumps:` - - check that the pump is connected to a ServiceWaterPiping object: `if type(pump_u.loop_or_piping) == ServiceWaterPiping:` - - add the pump to the SHW pumps list: `shw_pumps_list.append(pump_u.id)` +- Iterate through the pumps in the user model: `for pump_b in B_RMD.pumps:` + - check that the pump is connected to a ServiceWaterPiping object: `if type(pump_b.loop_or_piping) == ServiceWaterPiping:` + - add the pump to the SHW pumps list: `shw_pumps_list.append(pump_b.id)` - Iterate through the pump ids in the shw pumps list: `for pump_id in set(shw_pumps_list):` - - find the pump in the proposed model: `pump_p = get_component_by_id(pump_id, P_RMI)` - - find the pump in the user model: `pump_u = get_component_by_id(pump_id, U_RMI)` - - if both pump_p and pump_u exist, we compare them using compare_context_pair: `if !compare_context_pair(pump_p, pump_u,$,extra_schema_for_SHW_comparison.json,true,compare_context_str,error_str): all_match = FALSE` + - find the pump in the proposed model: `pump_p = get_component_by_id(pump_id, P_RMD)` + - find the pump in the user model: `pump_b = get_component_by_id(pump_id, B_RMD)` + - if both pump_p and pump_u exist, we compare them using compare_context_pair: `if !compare_context_pair(pump_p, pump_b,$,extra_schema_for_SHW_comparison.json,true,compare_context_str,error_str): all_match = FALSE` - otherwise, the pump exists in only one of the two models, set all_match to false: `all_match = FALSE` ## Rule Assertion: From d2c3c5f16ffae14ef96cb34a34884654675afbc5 Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Wed, 17 Apr 2024 13:12:05 -0400 Subject: [PATCH 04/21] Delete docs/Section 11 directory --- docs/Section 11/Rule11-3 | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 docs/Section 11/Rule11-3 diff --git a/docs/Section 11/Rule11-3 b/docs/Section 11/Rule11-3 deleted file mode 100644 index 227321ea57..0000000000 --- a/docs/Section 11/Rule11-3 +++ /dev/null @@ -1,32 +0,0 @@ -# Section 11 - SHW - Rule 11-3 -**Schema Version:** 0.0.36 -**Mandatory Rule:** True -**Rule ID:** 11-3 -**Rule Description:** Where no service water-heating system exists or has been designed and submitted with design documents but the building will have service water-heating loads, a service water-heating system shall be modeled that matches the system type in the baseline building design -**Rule Assertion:** Options are Pass/Fail/NOT_APPLICABLE -**Appendix G Section:** Table G3.1.11(c) - -**Data Lookup:** None - -**Evaluation Context:** RMD - -**Applicability Checks:** Check that the User model doesn't have any ServiceWaterHeatingEquipment, and that the user model has at least one ServiceWaterHeatingUse - -**Function Calls:** None - -## Applicability: -- look for ServiceWaterHeatingEquipment in the user model: `if len(U_RMD.service_water_heating_equipment) > 0:` - - look for ServiceWaterHeatingUse in the spaces in the proposed model: `for space in U_RMD:` - - check for any service_water_heating_uses in the space: `if len(space.service_water_heating_uses) > 0: CONTINUE TO RULE LOGIC` -- if the program reaches this line without going to the rule logic, the project is not applicable: `NOT_APPLICABLE` - -## Rule Logic: -- create a variable that describes the type of SHW system found and initialize it by setting it to NONE: `shw_system_found = "NONE"` -- now look for ServiceWaterHeatingEquipment in the P_RMD - we want to find exactly one system per building - - **Rule Assertion:** - - - Case 1: - - Case 2: - -**[Back](../_toc.md)** From 701922141b4db1c77fe9ea56758806903ea9bfa3 Mon Sep 17 00:00:00 2001 From: KarenWGard Date: Tue, 23 Apr 2024 06:05:57 -0400 Subject: [PATCH 05/21] Rule_11-3 evaluate all equipment for the SHW equipment space type --- docs/section11/11-1.md | 70 ------------------------------------------ docs/section11/11-3.md | 59 +++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 70 deletions(-) delete mode 100644 docs/section11/11-1.md create mode 100644 docs/section11/11-3.md diff --git a/docs/section11/11-1.md b/docs/section11/11-1.md deleted file mode 100644 index a01511b554..0000000000 --- a/docs/section11/11-1.md +++ /dev/null @@ -1,70 +0,0 @@ -# Section 11 - SHW - Rule 11-3 -**Schema Version:** 0.0.36 -**Mandatory Rule:** True -**Rule ID:** 11-3 -**Rule Description:** Where no service water-heating system exists or has been designed and submitted with design documents but the building will have service water-heating loads, a service water-heating system shall be modeled that matches the system type in the baseline building design -**Rule Assertion:** Options are Pass/Fail/NOT_APPLICABLE -**Appendix G Section:** Table G3.1.11(c) - -**Data Lookup:** None - -**Evaluation Context:** RMD - -**Applicability Checks:** Check that the User model doesn't have any ServiceWaterHeatingEquipment, and that the user model has at least one ServiceWaterHeatingUse - -**Function Calls:** None - -## Applicability: -- look for ServiceWaterHeatingEquipment in the user model: `if len(U_RMD.service_water_heating_equipment) > 0:` - - look for ServiceWaterHeatingUse in the spaces in the proposed model: `for space in U_RMD:` - - check for any service_water_heating_uses in the space: `if len(space.service_water_heating_uses) > 0: CONTINUE TO RULE LOGIC` -- if the program reaches this line without going to the rule logic, the project is not applicable: `NOT_APPLICABLE` - -## Rule Logic: - -- create a boolean to keep track of whether everything matches: `all_match = TRUE` -- create an error string: `error_str = ""` -- create the compare context string: `compare_context_str = "AppG 11-3 P_RMD Equals B_RMD"` -- check if the ServiceWaterHeatingDistributionSystem matches between the propoesd and user models. First check whether there are the same number of systems: `if len(P_RMD.service_water_heating_distribution_systems) == len(B_RMD.service_water_heating_distribution_systems):` - - look at each SHW distribution system in the proposed model and see if there is one that is the same in the user model. This check relies on the understanding that the RCT team has a method for comparing all elements within an object match (compare_context_pair): `for p_SHW_dist_system in P_RMD.service_water_heating_distribution_systems:` - - if this system is in B_RMD.service_water_heating_distribution_systems, compare the systems: `if p_SHW_dist_system in B_RMD.service_water_heating_distribution_systems:` - - use compare_context_pair to compare systems and set all_match to FALSE if the systems don't compare: `if !compare_context_pair(p_SHW_dist_system, B_RMD.get_component_by_id(p_SHW_dist_system.id),$,extra_schema_for_SHW_comparison.json,true,compare_context_str,error_str): all_match = FALSE` - - otherwise, set all_match to false: `else: all_match = FALSE` -- otherwise, all_match is false: `all_match = FALSE` -- continue if all_match is still true: `if all_match:` - - do the same comparison for ServiceWaterHeatingEquipment in the proposed and user models: `if len(P_RMD.service_water_heating_distribution_systems) == len(B_RMD.service_water_heating_distribution_systems):` - - look at each SHW system in the proposed model and see if there is one that is the same in the user model. This check relies on the understanding that the RCT team has a method for comparing all elements within an object match (compare_context_pair): `for p_SHW_equipment in P_RMD.service_water_heating_equipment:` - - use compare_context_pair to compare systems and set all_match to FALSE if the systems don't compare: `if !compare_context_pair(p_SHW_equipment, B_RMD.get_component_by_id(p_SHW_equipment.id),$,extra_schema_for_SHW_comparison.json,true,compare_context_str,error_str): all_match = FALSE` - - otherwise, set all_match to false: `else: all_match = FALSE` - - otherwise, all_match is false: `all_match = FALSE` - -- we also need to compare the pumps connected to the DHW system, but not all pumps in the models are DHW pumps. Create a list of the SHW pumps `shw_pumps_list = []` -- Iterate through the pumps in the proposed model: `for pump_p in P_RMI.pumps:` - - check that the pump is connected to a ServiceWaterPiping object: `if type(pump_p.loop_or_piping) == ServiceWaterPiping:` - - add the pump to the SHW pumps list: `shw_pumps_list.append(pump_p.id)` -- Iterate through the pumps in the user model: `for pump_b in B_RMD.pumps:` - - check that the pump is connected to a ServiceWaterPiping object: `if type(pump_b.loop_or_piping) == ServiceWaterPiping:` - - add the pump to the SHW pumps list: `shw_pumps_list.append(pump_b.id)` -- Iterate through the pump ids in the shw pumps list: `for pump_id in set(shw_pumps_list):` - - find the pump in the proposed model: `pump_p = get_component_by_id(pump_id, P_RMD)` - - find the pump in the user model: `pump_b = get_component_by_id(pump_id, B_RMD)` - - if both pump_p and pump_u exist, we compare them using compare_context_pair: `if !compare_context_pair(pump_p, pump_b,$,extra_schema_for_SHW_comparison.json,true,compare_context_str,error_str): all_match = FALSE` - - otherwise, the pump exists in only one of the two models, set all_match to false: `all_match = FALSE` - -## Rule Assertion: -- Case1: all elements are equal: PASS: `if all_match: PASS` -- Case2: all elements don't match, FAIL: if !all_match: FAIL` - - - - - **Rule Assertion:** - - if all_match is TRUE, then return PASS: `if all_match: return PASS` - - if all_match is FALSE, return FAIL, one of the elements does not match, provide the error_str from the compare_context_pair function: `if not all_match: return FAIL; note = error_str` - - - **Notes:** - 1. using compare_context_pair might not be the correct approach - this function requires data elements in the extra schema to have a tag "AppG P_RMD Equals U_RMD" - is it possible to pass in a custom json created for this rule which identifies which elements need to be equal? - 2. using compare_context_pair - how are sub-components like [{Tank}] (in ServiceWaterHeatingDistributionSystem) and {Tank} (in SolarThermal and ServiceWaterHeatingEquipment) evaluated? - also {Pump} and {ServiceWaterPiping} - -**[Back](../_toc.md)** diff --git a/docs/section11/11-3.md b/docs/section11/11-3.md new file mode 100644 index 0000000000..33d5a73eea --- /dev/null +++ b/docs/section11/11-3.md @@ -0,0 +1,59 @@ +# Service_Water_Heating - Rule 11-1 +**Schema Version:** 0.0.23 + +**Mandatory Rule:** TRUE + +**Rule ID:** 11-3 + +**Rule Description:** "Where no service water-heating system exists or has been designed and submitted with design documents but the building will have service water-heating loads, a service water-heating system shall be modeled that matches the system type in the baseline building design" + +**Rule Assertion:** Options are PASS/FAIL + +**Appendix G Section Reference:** Table G3.1 #11, proposed column, c + +**Evaluation Context:** P-RMD each SHW type +**Data Lookup:** +**Function Call:** +- **get_component_by_id** +- **compare_context_pair** - there is no RDS for this function, but it is a function developed for Rule 1-6 that compares two elements +- **get_SHW_types_and_spaces** +- **get_SHW_equipment_connected_to_use_type** + +**Applicability Checks:** +- check that the SHW type in the P_RMD has SHW loads + +## Applicability Checks: +- only projects with SHW for the SHW space type in the user model are expected to have a SHW system in the user model. If there is no SHW in the user model, we assume there is no SHW system designed, and instead rule 11-3 Applies and P_RMD matches B_RMD. +- use the function get_SHW_types_and_spaces to get a list of spaces for each SHW type: `shw_and_spaces_dict = get_SHW_types_and_spaces(P_RMD)` +- look at each SHW space type: `for shw_space_type in shw_and_spaces_dict:` + - look at each space: `for space_id in shw_and_spaces_dict[shw_space_type]:` + - get the space using get_component_by_id: `space = get_component_by_id(P_RMD, space_id)` + - look for the ServiceWaterHeatingUse in the space. If even one space has a ServiceWaterHeatingUse, continue to rule logic: `if len(space.service_water_heating_uses) > 0: CONTINUE TO RULE LOGIC` + - if the program reaches this line without going to the rule logic, the project is not applicable for this SHW heating use: `NOT_APPLICABLE` + + ## Rule Logic: + - create a boolean to keep track of whether everything matches: `all_match = TRUE` + - create an error string: `error_str = ""` + - create the compare context string: `compare_context_str = "AppG 11-1 P_RMD Equals B_RMD"` + - get a dictionary of all SHW equipment connected to the SHW space type in the proposed model: `p_shw_equipment_dict = get_SHW_equipment_connected_to_use_type(P_RMD)[shw_space_type]` + - get a dictionary of all SHW equipment connected to the SHW space type in the user model: `b_shw_equipment_dict = get_SHW_equipment_connected_to_use_type(B_RMD)[shw_space_type]` + - create a list of all of the SHW equipment types that exist in both the proposed and user models: `shw_equipment_types = set(p_shw_equipment_dict.keys()) | set(b_shw_equipment_dict.keys())` + - loop through each of the equipment types: `for shw_equipment_type in shw_equipment_types:` + - continue if all_match is still true: `if all_match:` + - check if this equipment type matches between the proposed and user models. First check whether there are the same number equipment: `if len(p_shw_equipment_dict[shw_equipment_type]) == len(b_shw_equipment_dict[shw_equipment_type]):` + - look at each equipment type system in the proposed model and see if there is one that is the same in the user model. This check relies on the understanding that the RCT team has a method for comparing all elements within an object match (compare_context_pair): `for p_SHW_equip_id in p_shw_equipment_dict[shw_equipment_type]:` + - if this system is in U_RMD.service_water_heating_distribution_systems, compare the systems: `if p_SHW_equip_id in b_shw_equipment_dict[shw_equipment_type]:` + - use compare_context_pair to compare systems and set all_match to FALSE if the systems don't compare: `if !compare_context_pair(p_SHW_equip_id, p_SHW_equip_id, $, extra_schema_for_SHW_comparison.json, true, compare_context_str, error_str): all_match = FALSE` + - otherwise, set all_match to false: `else: all_match = FALSE` + - otherwise, all_match is false: `all_match = FALSE` + +## Rule Assertion: +- Case1: all elements are equal: PASS: `if all_match: PASS` + - Case2: all elements don't match, FAIL: if !all_match: FAIL` + + + **Notes:** + 1. using compare_context_pair might not be the correct approach - this function requires data elements in the extra schema to have a tag "AppG P_RMD Equals U_RMD" - is it possible to pass in a custom json created for this rule which identifies which elements need to be equal? + 2. is there a situation where some of the equipment shouldn't be equal? Solar hot water, for example? + +**[Back](../_toc.md)** From 3c437376a260f1029592e77b40e1b59c153b1243 Mon Sep 17 00:00:00 2001 From: KarenWGard Date: Tue, 23 Apr 2024 06:08:03 -0400 Subject: [PATCH 06/21] Rule_11-3 evaluate all equipment for the SHW equipment space type --- docs/section11/11-3.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/section11/11-3.md b/docs/section11/11-3.md index 33d5a73eea..84fc3c183d 100644 --- a/docs/section11/11-3.md +++ b/docs/section11/11-3.md @@ -47,9 +47,9 @@ - otherwise, set all_match to false: `else: all_match = FALSE` - otherwise, all_match is false: `all_match = FALSE` -## Rule Assertion: -- Case1: all elements are equal: PASS: `if all_match: PASS` - - Case2: all elements don't match, FAIL: if !all_match: FAIL` + ## Rule Assertion: + - Case1: all elements are equal: PASS: `if all_match: PASS` + - Case2: all elements don't match, FAIL: if !all_match: FAIL` **Notes:** From f37278911f79e2aa34ebf62d0fbab258362fd67b Mon Sep 17 00:00:00 2001 From: KarenWGard Date: Tue, 23 Apr 2024 06:18:45 -0400 Subject: [PATCH 07/21] Rule_11-3 evaluate all equipment for the SHW equipment space type --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ab22e0af5c..23d5be657c 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ share/python-wheels/ *.egg-info/ .installed.cfg *.egg +.idea MANIFEST # PyInstaller From eb034e835afb83e30a40cc8fc26db8aeab4b0e8e Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Wed, 1 May 2024 15:43:19 -0400 Subject: [PATCH 08/21] Update 11-3.md --- docs/section11/11-3.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/section11/11-3.md b/docs/section11/11-3.md index 84fc3c183d..1ce313cf16 100644 --- a/docs/section11/11-3.md +++ b/docs/section11/11-3.md @@ -54,6 +54,7 @@ **Notes:** 1. using compare_context_pair might not be the correct approach - this function requires data elements in the extra schema to have a tag "AppG P_RMD Equals U_RMD" - is it possible to pass in a custom json created for this rule which identifies which elements need to be equal? - 2. is there a situation where some of the equipment shouldn't be equal? Solar hot water, for example? + 2. is there a situation where some of the equipment shouldn't be equal? Solar hot water, for example? + 3. extra_schema_for_SHW_comparison.json is the json file created from SHW comparison fields.yaml **[Back](../_toc.md)** From 95d93f6d9c5ad77ba638d26ccccbee522fb85bb1 Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Wed, 1 May 2024 15:43:34 -0400 Subject: [PATCH 09/21] Update 11-3.md --- docs/section11/11-3.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/section11/11-3.md b/docs/section11/11-3.md index 1ce313cf16..57ff34f022 100644 --- a/docs/section11/11-3.md +++ b/docs/section11/11-3.md @@ -1,5 +1,5 @@ -# Service_Water_Heating - Rule 11-1 -**Schema Version:** 0.0.23 +# Service_Water_Heating - Rule 11-3 +**Schema Version:** 0.0.36 **Mandatory Rule:** TRUE From 06d1a648d0c445335cc52534bef37082b8f1f496 Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Wed, 29 May 2024 03:21:48 -0400 Subject: [PATCH 10/21] Update 11-3.md --- docs/section11/11-3.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/section11/11-3.md b/docs/section11/11-3.md index 57ff34f022..fc871a55af 100644 --- a/docs/section11/11-3.md +++ b/docs/section11/11-3.md @@ -37,13 +37,13 @@ - create the compare context string: `compare_context_str = "AppG 11-1 P_RMD Equals B_RMD"` - get a dictionary of all SHW equipment connected to the SHW space type in the proposed model: `p_shw_equipment_dict = get_SHW_equipment_connected_to_use_type(P_RMD)[shw_space_type]` - get a dictionary of all SHW equipment connected to the SHW space type in the user model: `b_shw_equipment_dict = get_SHW_equipment_connected_to_use_type(B_RMD)[shw_space_type]` - - create a list of all of the SHW equipment types that exist in both the proposed and user models: `shw_equipment_types = set(p_shw_equipment_dict.keys()) | set(b_shw_equipment_dict.keys())` + - create a list of all of the SHW equipment types that exist in both the proposed and baseline models: `shw_equipment_types = set(p_shw_equipment_dict.keys()) | set(b_shw_equipment_dict.keys())` - loop through each of the equipment types: `for shw_equipment_type in shw_equipment_types:` - continue if all_match is still true: `if all_match:` - - check if this equipment type matches between the proposed and user models. First check whether there are the same number equipment: `if len(p_shw_equipment_dict[shw_equipment_type]) == len(b_shw_equipment_dict[shw_equipment_type]):` - - look at each equipment type system in the proposed model and see if there is one that is the same in the user model. This check relies on the understanding that the RCT team has a method for comparing all elements within an object match (compare_context_pair): `for p_SHW_equip_id in p_shw_equipment_dict[shw_equipment_type]:` - - if this system is in U_RMD.service_water_heating_distribution_systems, compare the systems: `if p_SHW_equip_id in b_shw_equipment_dict[shw_equipment_type]:` - - use compare_context_pair to compare systems and set all_match to FALSE if the systems don't compare: `if !compare_context_pair(p_SHW_equip_id, p_SHW_equip_id, $, extra_schema_for_SHW_comparison.json, true, compare_context_str, error_str): all_match = FALSE` + - check if this equipment type matches between the proposed and baseline models. First check whether there are the same number equipment: `if len(p_shw_equipment_dict[shw_equipment_type]) == len(b_shw_equipment_dict[shw_equipment_type]):` + - look at each equipment type system in the proposed model and see if there is one that is the same in the baseline model. This check relies on the understanding that the RCT team has a method for comparing all elements within an object match (compare_context_pair): `for p_SHW_equip_id in p_shw_equipment_dict[shw_equipment_type]:` + - if this system is in B_RMD.service_water_heating_distribution_systems, compare the systems: `if p_SHW_equip_id in b_shw_equipment_dict[shw_equipment_type]:` + - use compare_context_pair to compare systems and set all_match to FALSE if the systems don't compare: `if !compare_context_pair(p_SHW_equip_id, b_SHW_equip_id, $, extra_schema_for_SHW_comparison.json, true, compare_context_str, error_str): all_match = FALSE` - otherwise, set all_match to false: `else: all_match = FALSE` - otherwise, all_match is false: `all_match = FALSE` From de82506daa9f38b6eeb0d2b01442241913b4d2f0 Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Wed, 29 May 2024 09:29:32 -0400 Subject: [PATCH 11/21] Delete .gitignore --- .gitignore | 87 ------------------------------------------------------ 1 file changed, 87 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 23d5be657c..0000000000 --- a/.gitignore +++ /dev/null @@ -1,87 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -pip-wheel-metadata/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -.idea -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -examples/output/* - -# Sphinx documentation -docs/_build/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -.python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject From 03a9f481e09cc2c798dc683362f61ce740cc2fbc Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Wed, 29 May 2024 09:32:15 -0400 Subject: [PATCH 12/21] Update 11-3.md --- docs/section11/11-3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/section11/11-3.md b/docs/section11/11-3.md index fc871a55af..db683fec1a 100644 --- a/docs/section11/11-3.md +++ b/docs/section11/11-3.md @@ -11,7 +11,7 @@ **Appendix G Section Reference:** Table G3.1 #11, proposed column, c -**Evaluation Context:** P-RMD each SHW type +**Evaluation Context:** P-RMD each SHW bat **Data Lookup:** **Function Call:** - **get_component_by_id** From 7801bae99c8c951a963d5b6c54707b3488aa0585 Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Wed, 29 May 2024 10:26:27 -0400 Subject: [PATCH 13/21] Update 11-3.md --- docs/section11/11-3.md | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/docs/section11/11-3.md b/docs/section11/11-3.md index db683fec1a..94cc1b79d7 100644 --- a/docs/section11/11-3.md +++ b/docs/section11/11-3.md @@ -17,35 +17,46 @@ - **get_component_by_id** - **compare_context_pair** - there is no RDS for this function, but it is a function developed for Rule 1-6 that compares two elements - **get_SHW_types_and_spaces** -- **get_SHW_equipment_connected_to_use_type** +- **get_SHW_equipment_connected_to_use_type** **Applicability Checks:** - check that the SHW type in the P_RMD has SHW loads ## Applicability Checks: -- only projects with SHW for the SHW space type in the user model are expected to have a SHW system in the user model. If there is no SHW in the user model, we assume there is no SHW system designed, and instead rule 11-3 Applies and P_RMD matches B_RMD. +- only projects with SHW for the SHW space type in the user model are expected to have a SHW system in the proposed model. If there is no SHW in the user model, we assume there is no SHW system designed, and instead rule 11-1 Applies and P_RMD should match U_RMD. - use the function get_SHW_types_and_spaces to get a list of spaces for each SHW type: `shw_and_spaces_dict = get_SHW_types_and_spaces(P_RMD)` - look at each SHW space type: `for shw_space_type in shw_and_spaces_dict:` - look at each space: `for space_id in shw_and_spaces_dict[shw_space_type]:` - get the space using get_component_by_id: `space = get_component_by_id(P_RMD, space_id)` - look for the ServiceWaterHeatingUse in the space. If even one space has a ServiceWaterHeatingUse, continue to rule logic: `if len(space.service_water_heating_uses) > 0: CONTINUE TO RULE LOGIC` - if the program reaches this line without going to the rule logic, the project is not applicable for this SHW heating use: `NOT_APPLICABLE` + +- projects without SWH in the user model are expected to have a baseline SWH system in the proposed model. If there is SWH in the user model, we assume there is a SWH system designed, and instead rule 11-1 Applies and P_RMD matches U_RMD. +- use the function get_SWH_equipment_associated_with_each_swh_distribution_system to get a dictionary of SWH equipment associated with each Distribution System for the Proposed model (pumps, tanks, SWH use, distribution system, etc): `p_swh_system_and_equip_dict = get_SWH_equipment_associated_with_each_swh_distribution_system(P_RMD)` +- for each distribution system: `for distribution_id in p_swh_system_and_equip_dict:` + - get the distribution system: `p_distribution = get_component_by_id(P_RMD, distribution_id)` + - for each swh use in the dictionary, check to see that the swh use exists in the user model: `for swh_use_id in p_swh_system_and_equip_dict[distribution_id]["SPACE_USES"]:` + - get the user swh_use: `u_swh_use = get_component_by_id(U_RMD, swh_use_id)` + - if the u_swh_use exists, this rule is not applicable and 11-1 applies: `if(u_swh_use): NOT_APPLICABLE` + - if the program reaches this line without being not applicable first continue to rule logic for this distribution system: `CONTINUE TO RULE LOGIC` ## Rule Logic: - - create a boolean to keep track of whether everything matches: `all_match = TRUE` + - create a boolean to keep track of whether everything matches: `all_match = TRUE` - create an error string: `error_str = ""` - create the compare context string: `compare_context_str = "AppG 11-1 P_RMD Equals B_RMD"` - - get a dictionary of all SHW equipment connected to the SHW space type in the proposed model: `p_shw_equipment_dict = get_SHW_equipment_connected_to_use_type(P_RMD)[shw_space_type]` - - get a dictionary of all SHW equipment connected to the SHW space type in the user model: `b_shw_equipment_dict = get_SHW_equipment_connected_to_use_type(B_RMD)[shw_space_type]` - - create a list of all of the SHW equipment types that exist in both the proposed and baseline models: `shw_equipment_types = set(p_shw_equipment_dict.keys()) | set(b_shw_equipment_dict.keys())` - - loop through each of the equipment types: `for shw_equipment_type in shw_equipment_types:` - - continue if all_match is still true: `if all_match:` - - check if this equipment type matches between the proposed and baseline models. First check whether there are the same number equipment: `if len(p_shw_equipment_dict[shw_equipment_type]) == len(b_shw_equipment_dict[shw_equipment_type]):` - - look at each equipment type system in the proposed model and see if there is one that is the same in the baseline model. This check relies on the understanding that the RCT team has a method for comparing all elements within an object match (compare_context_pair): `for p_SHW_equip_id in p_shw_equipment_dict[shw_equipment_type]:` - - if this system is in B_RMD.service_water_heating_distribution_systems, compare the systems: `if p_SHW_equip_id in b_shw_equipment_dict[shw_equipment_type]:` - - use compare_context_pair to compare systems and set all_match to FALSE if the systems don't compare: `if !compare_context_pair(p_SHW_equip_id, b_SHW_equip_id, $, extra_schema_for_SHW_comparison.json, true, compare_context_str, error_str): all_match = FALSE` - - otherwise, set all_match to false: `else: all_match = FALSE` - - otherwise, all_match is false: `all_match = FALSE` + - get a dictionary of all SHW equipment connected to the SHW space type in the proposed model: `p_shw_equipment_dict = get_SWH_equipment_associated_with_each_swh_distribution_system(P_RMD)[distribution_id]` + - get a dictionary of all SHW equipment connected to the SHW space type in the user model: `b_shw_equipment_dict = get_SWH_equipment_associated_with_each_swh_distribution_system(B_RMD)[distribution_id]` + - check whether b_shw_equipment_dict is equal to null. If it is, then set all_match is false and give the user an error indictating that the system doesn't exist in the baseline: `if b_shw_equipment_dict == NULL: all_match = FALSE; error_str = "The SHW Distribution system " + distribution_id + " is not found in the baseline model." + - continue if all_match is still TRUE: `if all_match:` + - create a list of all of the SHW equipment types that exist in both the proposed and baseline models: `shw_equipment_types = set(p_shw_equipment_dict.keys()) | set(b_shw_equipment_dict.keys())` + - loop through each of the equipment types: `for shw_equipment_type in shw_equipment_types:` + - continue if all_match is still true: `if all_match:` + - check if this equipment type matches between the proposed and baseline models. First check whether there are the same number equipment: `if len(p_shw_equipment_dict[shw_equipment_type]) == len(b_shw_equipment_dict[shw_equipment_type]):` + - look at each equipment type system in the proposed model and see if there is one that is the same in the baseline model. This check relies on the understanding that the RCT team has a method for comparing all elements within an object match (compare_context_pair): `for p_SHW_equip_id in p_shw_equipment_dict[shw_equipment_type]:` + - if this system is in B_RMD.service_water_heating_distribution_systems, compare the systems: `if p_SHW_equip_id in b_shw_equipment_dict[shw_equipment_type]:` + - use compare_context_pair to compare systems and set all_match to FALSE if the systems don't compare: `if !compare_context_pair(p_SHW_equip_id, b_SHW_equip_id, $, extra_schema_for_SHW_comparison.json, true, compare_context_str, error_str): all_match = FALSE` + - otherwise, set all_match to false: `else: all_match = FALSE` + - otherwise, all_match is false: `all_match = FALSE` ## Rule Assertion: - Case1: all elements are equal: PASS: `if all_match: PASS` From 421f852b27915626c03f9abb991ece90a0341ead Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Wed, 29 May 2024 10:28:27 -0400 Subject: [PATCH 14/21] Update 11-3.md --- docs/section11/11-3.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/docs/section11/11-3.md b/docs/section11/11-3.md index 94cc1b79d7..9b21f481e3 100644 --- a/docs/section11/11-3.md +++ b/docs/section11/11-3.md @@ -23,14 +23,6 @@ - check that the SHW type in the P_RMD has SHW loads ## Applicability Checks: -- only projects with SHW for the SHW space type in the user model are expected to have a SHW system in the proposed model. If there is no SHW in the user model, we assume there is no SHW system designed, and instead rule 11-1 Applies and P_RMD should match U_RMD. -- use the function get_SHW_types_and_spaces to get a list of spaces for each SHW type: `shw_and_spaces_dict = get_SHW_types_and_spaces(P_RMD)` -- look at each SHW space type: `for shw_space_type in shw_and_spaces_dict:` - - look at each space: `for space_id in shw_and_spaces_dict[shw_space_type]:` - - get the space using get_component_by_id: `space = get_component_by_id(P_RMD, space_id)` - - look for the ServiceWaterHeatingUse in the space. If even one space has a ServiceWaterHeatingUse, continue to rule logic: `if len(space.service_water_heating_uses) > 0: CONTINUE TO RULE LOGIC` - - if the program reaches this line without going to the rule logic, the project is not applicable for this SHW heating use: `NOT_APPLICABLE` - - projects without SWH in the user model are expected to have a baseline SWH system in the proposed model. If there is SWH in the user model, we assume there is a SWH system designed, and instead rule 11-1 Applies and P_RMD matches U_RMD. - use the function get_SWH_equipment_associated_with_each_swh_distribution_system to get a dictionary of SWH equipment associated with each Distribution System for the Proposed model (pumps, tanks, SWH use, distribution system, etc): `p_swh_system_and_equip_dict = get_SWH_equipment_associated_with_each_swh_distribution_system(P_RMD)` - for each distribution system: `for distribution_id in p_swh_system_and_equip_dict:` @@ -44,8 +36,8 @@ - create a boolean to keep track of whether everything matches: `all_match = TRUE` - create an error string: `error_str = ""` - create the compare context string: `compare_context_str = "AppG 11-1 P_RMD Equals B_RMD"` - - get a dictionary of all SHW equipment connected to the SHW space type in the proposed model: `p_shw_equipment_dict = get_SWH_equipment_associated_with_each_swh_distribution_system(P_RMD)[distribution_id]` - - get a dictionary of all SHW equipment connected to the SHW space type in the user model: `b_shw_equipment_dict = get_SWH_equipment_associated_with_each_swh_distribution_system(B_RMD)[distribution_id]` + - get a dictionary of all SHW equipment connected to the SHW distribution system in the proposed model: `p_shw_equipment_dict = get_SWH_equipment_associated_with_each_swh_distribution_system(P_RMD)[distribution_id]` + - get a dictionary of all SHW equipment connected to the SHW distribution system in the baseline model: `b_shw_equipment_dict = get_SWH_equipment_associated_with_each_swh_distribution_system(B_RMD)[distribution_id]` - check whether b_shw_equipment_dict is equal to null. If it is, then set all_match is false and give the user an error indictating that the system doesn't exist in the baseline: `if b_shw_equipment_dict == NULL: all_match = FALSE; error_str = "The SHW Distribution system " + distribution_id + " is not found in the baseline model." - continue if all_match is still TRUE: `if all_match:` - create a list of all of the SHW equipment types that exist in both the proposed and baseline models: `shw_equipment_types = set(p_shw_equipment_dict.keys()) | set(b_shw_equipment_dict.keys())` From 43e3fc534d5e8d35e7bdd3a00490baf4873b6825 Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Mon, 3 Jun 2024 15:40:34 -0400 Subject: [PATCH 15/21] Update 11-3.md --- docs/section11/11-3.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/section11/11-3.md b/docs/section11/11-3.md index 9b21f481e3..bd603f945f 100644 --- a/docs/section11/11-3.md +++ b/docs/section11/11-3.md @@ -15,9 +15,7 @@ **Data Lookup:** **Function Call:** - **get_component_by_id** -- **compare_context_pair** - there is no RDS for this function, but it is a function developed for Rule 1-6 that compares two elements -- **get_SHW_types_and_spaces** -- **get_SHW_equipment_connected_to_use_type** +- **get_SWH_equipment_associated_with_each_swh_distribution_system** **Applicability Checks:** - check that the SHW type in the P_RMD has SHW loads From f8e20eccfaa58ecc71cab75de75faedb08b5fcf9 Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Mon, 3 Jun 2024 15:44:56 -0400 Subject: [PATCH 16/21] Update 11-3.md --- docs/section11/11-3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/section11/11-3.md b/docs/section11/11-3.md index bd603f945f..b371caea88 100644 --- a/docs/section11/11-3.md +++ b/docs/section11/11-3.md @@ -18,7 +18,7 @@ - **get_SWH_equipment_associated_with_each_swh_distribution_system** **Applicability Checks:** -- check that the SHW type in the P_RMD has SHW loads +- check that the SHW BAT in the P_RMD has SHW loads ## Applicability Checks: - projects without SWH in the user model are expected to have a baseline SWH system in the proposed model. If there is SWH in the user model, we assume there is a SWH system designed, and instead rule 11-1 Applies and P_RMD matches U_RMD. From f87ec56f9e51f72e1fe1daafbfc41694e9eb2ae4 Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Wed, 19 Jun 2024 14:22:37 -0400 Subject: [PATCH 17/21] Update 11-3.md --- docs/section11/11-3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/section11/11-3.md b/docs/section11/11-3.md index b371caea88..5538cf8c83 100644 --- a/docs/section11/11-3.md +++ b/docs/section11/11-3.md @@ -25,7 +25,7 @@ - use the function get_SWH_equipment_associated_with_each_swh_distribution_system to get a dictionary of SWH equipment associated with each Distribution System for the Proposed model (pumps, tanks, SWH use, distribution system, etc): `p_swh_system_and_equip_dict = get_SWH_equipment_associated_with_each_swh_distribution_system(P_RMD)` - for each distribution system: `for distribution_id in p_swh_system_and_equip_dict:` - get the distribution system: `p_distribution = get_component_by_id(P_RMD, distribution_id)` - - for each swh use in the dictionary, check to see that the swh use exists in the user model: `for swh_use_id in p_swh_system_and_equip_dict[distribution_id]["SPACE_USES"]:` + - for each swh use in the dictionary, check to see that the swh use exists in the user model: `for swh_use_id in p_swh_system_and_equip_dict[distribution_id]["USES"]:` - get the user swh_use: `u_swh_use = get_component_by_id(U_RMD, swh_use_id)` - if the u_swh_use exists, this rule is not applicable and 11-1 applies: `if(u_swh_use): NOT_APPLICABLE` - if the program reaches this line without being not applicable first continue to rule logic for this distribution system: `CONTINUE TO RULE LOGIC` From 058f7a426cefe6c2f9188d9fffab0797da385809 Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Wed, 10 Jul 2024 14:53:55 -0400 Subject: [PATCH 18/21] Update 11-3.md --- docs/section11/11-3.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/section11/11-3.md b/docs/section11/11-3.md index 5538cf8c83..7a398ce96b 100644 --- a/docs/section11/11-3.md +++ b/docs/section11/11-3.md @@ -1,5 +1,5 @@ # Service_Water_Heating - Rule 11-3 -**Schema Version:** 0.0.36 +**Schema Version:** 0.0.37 **Mandatory Rule:** TRUE @@ -11,7 +11,7 @@ **Appendix G Section Reference:** Table G3.1 #11, proposed column, c -**Evaluation Context:** P-RMD each SHW bat +**Evaluation Context:** P-RMD each SHW distribution system **Data Lookup:** **Function Call:** - **get_component_by_id** From 60391fed27dc7d29dfa974ed3d9df2099b36917c Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:24:30 -0400 Subject: [PATCH 19/21] Update 11-3.md --- docs/section11/11-3.md | 47 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/docs/section11/11-3.md b/docs/section11/11-3.md index 7a398ce96b..fb059bbea3 100644 --- a/docs/section11/11-3.md +++ b/docs/section11/11-3.md @@ -11,11 +11,12 @@ **Appendix G Section Reference:** Table G3.1 #11, proposed column, c -**Evaluation Context:** P-RMD each SHW distribution system +**Evaluation Context:** P-RMD each SHW bat **Data Lookup:** **Function Call:** -- **get_component_by_id** -- **get_SWH_equipment_associated_with_each_swh_distribution_system** +- **get_component_by_id** +- **compare_context_pair** - there is no RDS for this function, but it is a function developed for Rule 1-6 that compares two elements +- **get_SWH_equipment_associated_with_each_swh_distribution_system** **Applicability Checks:** - check that the SHW BAT in the P_RMD has SHW loads @@ -31,31 +32,29 @@ - if the program reaches this line without being not applicable first continue to rule logic for this distribution system: `CONTINUE TO RULE LOGIC` ## Rule Logic: - - create a boolean to keep track of whether everything matches: `all_match = TRUE` - - create an error string: `error_str = ""` + - create a list that the compare_context_pair function will use to send errors back tot he rule: `errors = []` - create the compare context string: `compare_context_str = "AppG 11-1 P_RMD Equals B_RMD"` - - get a dictionary of all SHW equipment connected to the SHW distribution system in the proposed model: `p_shw_equipment_dict = get_SWH_equipment_associated_with_each_swh_distribution_system(P_RMD)[distribution_id]` + - get a dictionary of all SWH equipment in the proposed model (pumps, distribution, tanks, SWH use, etc): `p_swh_equipment_dict = p_swh_system_and_equip_dict[distribution_id]` - get a dictionary of all SHW equipment connected to the SHW distribution system in the baseline model: `b_shw_equipment_dict = get_SWH_equipment_associated_with_each_swh_distribution_system(B_RMD)[distribution_id]` - - check whether b_shw_equipment_dict is equal to null. If it is, then set all_match is false and give the user an error indictating that the system doesn't exist in the baseline: `if b_shw_equipment_dict == NULL: all_match = FALSE; error_str = "The SHW Distribution system " + distribution_id + " is not found in the baseline model." - - continue if all_match is still TRUE: `if all_match:` - - create a list of all of the SHW equipment types that exist in both the proposed and baseline models: `shw_equipment_types = set(p_shw_equipment_dict.keys()) | set(b_shw_equipment_dict.keys())` - - loop through each of the equipment types: `for shw_equipment_type in shw_equipment_types:` - - continue if all_match is still true: `if all_match:` - - check if this equipment type matches between the proposed and baseline models. First check whether there are the same number equipment: `if len(p_shw_equipment_dict[shw_equipment_type]) == len(b_shw_equipment_dict[shw_equipment_type]):` - - look at each equipment type system in the proposed model and see if there is one that is the same in the baseline model. This check relies on the understanding that the RCT team has a method for comparing all elements within an object match (compare_context_pair): `for p_SHW_equip_id in p_shw_equipment_dict[shw_equipment_type]:` - - if this system is in B_RMD.service_water_heating_distribution_systems, compare the systems: `if p_SHW_equip_id in b_shw_equipment_dict[shw_equipment_type]:` - - use compare_context_pair to compare systems and set all_match to FALSE if the systems don't compare: `if !compare_context_pair(p_SHW_equip_id, b_SHW_equip_id, $, extra_schema_for_SHW_comparison.json, true, compare_context_str, error_str): all_match = FALSE` - - otherwise, set all_match to false: `else: all_match = FALSE` - - otherwise, all_match is false: `all_match = FALSE` - - ## Rule Assertion: - - Case1: all elements are equal: PASS: `if all_match: PASS` - - Case2: all elements don't match, FAIL: if !all_match: FAIL` + - Compare the distribution in the proposed and baseline models using the function compare_context_pair. compare_context_pair is recursive, so by sending the function the distribution systems, it is also checking the tanks and piping that are child objects of the distribution systems. The boolean all_match is created and set to the result of the function: `all_match = compare_context_pair(distribution_id, distribution_id, $, extra_schema_for_SWH_comparison.json, true, compare_context_str, error_str)` + - there's equipment that's part of the service water heating distribution system that are not direct child objects of the distribution system. We need to check these objects. + - first, check ServiceWaterHeatingEquipment - when we execute compare_context_pair, this will also check any child objects that exist (SolarThermal and SWH validation point). Start by checking if there are the same number of objects in the proposed and user models. We need to do the length check here because it's not checked implicitly as part of compare_context_pair. For example, if there are more pieces of equipment in the user model than the proposed, comparing each item found in the proposed model could return a false positive: `if len(p_swh_equipment_dict["SWHHeatingEq"]) == len(b_swh_equipment_dict["SWHHeatingEq"]):` + - look at each SWHEquipment in the proposed model: `for swh_eq_id in p_swh_equipment_dict["SWHHeatingEq"]:` + - compare the two SWH equipment using compare_context_pair, if the result is false, set all_match equal to false. We won't exit early if all_match is false as we allow the function to keep running so errors is fully populated and available to the user: `if !compare_context_pair(swh_eq_id, swh_eq_id, $, extra_schema_for_SWH_comparison.json, true, compare_context_str, error_str): all_match = false` + - next, check Pumps - this will also recursively check PumpOutputValidationPointPumpOutputValidationPoint: `if len(p_swh_equipment_dict["Pumps"]) == len(b_swh_equipment_dict["Pumps"]):` + - look at each SWHEquipment in the proposed model: `for pump_id in p_swh_equipment_dict["Pumps"]:` + - compare the two pumps using compare_context_pair, if the result is false, set all_match equal to false. We won't exit early if all_match is false as we allow the function to keep running so errors is fully populated and available to the user: `if !compare_context_pair(pump_id, pump_id, $, extra_schema_for_SWH_comparison.json, true, compare_context_str, error_str): all_match = false` + + + ## Rule Assertion: + - Case1: all elements are equal: PASS: `if all_match: PASS` + - Case2: all elements don't match, FAIL: `if !all_match: FAIL` + + **Notes:** - 1. using compare_context_pair might not be the correct approach - this function requires data elements in the extra schema to have a tag "AppG P_RMD Equals U_RMD" - is it possible to pass in a custom json created for this rule which identifies which elements need to be equal? - 2. is there a situation where some of the equipment shouldn't be equal? Solar hot water, for example? - 3. extra_schema_for_SHW_comparison.json is the json file created from SHW comparison fields.yaml + 1. is there a situation where some of the equipment shouldn't be equal? Solar hot water, for example? + 2. extra_schema_for_SHW_comparison.json is the json file created from SHW comparison fields.yaml **[Back](../_toc.md)** From c47f2055385674d7b6198d79479063c8cd234805 Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:30:59 -0400 Subject: [PATCH 20/21] Update 11-3.md --- docs/section11/11-3.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/section11/11-3.md b/docs/section11/11-3.md index fb059bbea3..4e87b3de55 100644 --- a/docs/section11/11-3.md +++ b/docs/section11/11-3.md @@ -24,14 +24,20 @@ ## Applicability Checks: - projects without SWH in the user model are expected to have a baseline SWH system in the proposed model. If there is SWH in the user model, we assume there is a SWH system designed, and instead rule 11-1 Applies and P_RMD matches U_RMD. - use the function get_SWH_equipment_associated_with_each_swh_distribution_system to get a dictionary of SWH equipment associated with each Distribution System for the Proposed model (pumps, tanks, SWH use, distribution system, etc): `p_swh_system_and_equip_dict = get_SWH_equipment_associated_with_each_swh_distribution_system(P_RMD)` +- create a list of the distribution ids that have been checked: `checked_dist_ids = []` - for each distribution system: `for distribution_id in p_swh_system_and_equip_dict:` - get the distribution system: `p_distribution = get_component_by_id(P_RMD, distribution_id)` - for each swh use in the dictionary, check to see that the swh use exists in the user model: `for swh_use_id in p_swh_system_and_equip_dict[distribution_id]["USES"]:` - get the user swh_use: `u_swh_use = get_component_by_id(U_RMD, swh_use_id)` - if the u_swh_use exists, this rule is not applicable and 11-1 applies: `if(u_swh_use): NOT_APPLICABLE` - if the program reaches this line without being not applicable first continue to rule logic for this distribution system: `CONTINUE TO RULE LOGIC` +- we also need to look at the distribution systems in the baseline model and ensure that all of them have been covered by the above checks. If any exist (and have SWH use), but do not exist in the proposed model, then there is an issue: `for distribution_id in b_swh_system_and_equip_dict:` + - check whether there are SWH uses connected to the distribution system: `if len(b_swh_system_and_equip_dict[distribution_id]["USES"]) > ):` + - continue if the distribution_id is not the id of a system that has already been checked: `if !distribution_id in? checked_dist_ids:` + - if uses exist, continue to rule logic #2: `CONTINUE TO RULE LOGIC #2` + - if the program reaches this line without going to the rule logic, the project is not applicable for this SWH heating distribution system id: `NOT_APPLICABLE` - ## Rule Logic: + ## Rule Logic #1: - create a list that the compare_context_pair function will use to send errors back tot he rule: `errors = []` - create the compare context string: `compare_context_str = "AppG 11-1 P_RMD Equals B_RMD"` - get a dictionary of all SWH equipment in the proposed model (pumps, distribution, tanks, SWH use, etc): `p_swh_equipment_dict = p_swh_system_and_equip_dict[distribution_id]` @@ -44,6 +50,9 @@ - next, check Pumps - this will also recursively check PumpOutputValidationPointPumpOutputValidationPoint: `if len(p_swh_equipment_dict["Pumps"]) == len(b_swh_equipment_dict["Pumps"]):` - look at each SWHEquipment in the proposed model: `for pump_id in p_swh_equipment_dict["Pumps"]:` - compare the two pumps using compare_context_pair, if the result is false, set all_match equal to false. We won't exit early if all_match is false as we allow the function to keep running so errors is fully populated and available to the user: `if !compare_context_pair(pump_id, pump_id, $, extra_schema_for_SWH_comparison.json, true, compare_context_str, error_str): all_match = false` + + ## Rule Logic #2: + - The equipment exists in the baseline model, but not in the proposed model, all match is false: `all_match = false` ## Rule Assertion: From 78d61b9b2ec22f43a6882eb59a09b01deda4cd73 Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:37:54 -0400 Subject: [PATCH 21/21] Update 11-3.md --- docs/section11/11-3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/section11/11-3.md b/docs/section11/11-3.md index 4e87b3de55..cdcfe87089 100644 --- a/docs/section11/11-3.md +++ b/docs/section11/11-3.md @@ -11,7 +11,7 @@ **Appendix G Section Reference:** Table G3.1 #11, proposed column, c -**Evaluation Context:** P-RMD each SHW bat +**Evaluation Context:** Each SWH distribution system either in the P-RMD and / or B-RMD **Data Lookup:** **Function Call:** - **get_component_by_id**