Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rds/kjw/function compare swh dist systems and components #1544

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

KarenWGard
Copy link
Collaborator

rule that contains the functionality for using compare_context_pair for SWH systems - this logic is called twice in the re-written rule 11-1

- **RMD2**
- **compare_context_str**
- **swh_distribution_id**
- **errors**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this errors do? Suggest explaining that here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errors is a list that is one of the required inputs for compare_context_str. Passing it through allows any errors reported by compare_context_str to be accessible by the rule that called this function

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can return error list instead of boolean?
An empty list means full match and with message means there are diffs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weilixu - this is an excellent idea. I updated the function per your suggestion. To confirm - does compare_context_str always append an error to the errors list when the result is false?

- check if this distribution ID is in model 2: `if RMD2_swh_system_and_equip_dict[swh_distribution_id]:`
- get the dictionary of all SWH equipment (pumps, tanks, SWH use, dist system, etc) for the given swh_distribution_id for RMD2: `RMD2_swh_equipment_dict = RMD2_swh_system_and_equip_dict[swh_distribution_id]`
- get the actual distribution equipment associated with this ID from model 1: `RMD2_swh_distribution = get_component_by_id(RMD2, swh_distribution_id)`
- otherwise, add an error and return FALSE: `else: errors << "SWH Distribution System " + swh_distribution_id + " not found in one of the two RMDs"; return FALSE`
Copy link
Collaborator

@claperle claperle Nov 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this error message delivered since this function only retyrns a boolean?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because errors is a list that was passed into this function, any items added to the list will be accessible by the rule that called that function.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have to trust you on that. Not sure my python knowledge is good enough to understand how this can be accessible if the function only returns TRUE or FALSE.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recommend writing that the function returns the errors and the boolean because this is psuedo code we don't want any assumptions about the scope of variables to be miscommunicated

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Karen going to add note to describe that error is returned

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left the same comment - return a list makes sense.

- In addition to the equipment connected to the distribution system, there's also 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 models 1 and 2. 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 model 1 than model 2, comparing each item found in model 2 could return a false positive: `if len(RMD1_swh_equipment_dict["SWHHeatingEq"]) == len(RMD2_swh_equipment_dict["SWHHeatingEq"]):`
- look at each SWHEquipment in the model 1: `for swh_eq_id in RMD1_swh_equipment_dict["SWHHeatingEq"]:`
- get the SWH equipment for models 1 and 2: `swh_eq_1 = get_component_by_id(RMD1, swh_eq_id); swh_eq_2 = get_component_by_id(RMD2, swh_eq_id)`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the semi colon is python syntax. if it is not recommend revising.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

swh_eq_1, swh_eq_2 = get_component_by_id(RMD1, swh_eq_id), get_component_by_id(RMD2, swh_eq_id)

- otherwise there is an unequal number of equipment entries. Add our own error to the errors list: `else: errors << "Unequal numbers of SWH Equipment between the two models for " + swh_distribution_id`
- next, check Pumps - this will also recursively check PumpOutputValidationPointPumpOutputValidationPoint: `if len(RMD1_swh_equipment_dict["Pumps"]) == len(RMD2_swh_equipment_dict["Pumps"]):`
- look at each SWHEquipment in the proposed model: `for pump_id in RMD1_swh_equipment_dict["Pumps"]:`
- get the pumps for models 1 and 2: `pump_1 = get_component_by_id(RMD1, pump_id); pump_2 = get_component_by_id(RMD2, pump_id)`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above regarding ;

Logic:
- create the list errors: `errors = []`
- use the function get_swh_components_associated_with_each_swh_distribution_system to get a dictionary of SWH equipment associated with each Distribution System for model 1 (pumps, tanks, SWH use, distribution system, etc): `RMD1_swh_system_and_equip_dict = get_swh_components_associated_with_each_swh_distribution_system(RMD1)`
- use the function get_swh_components_associated_with_each_swh_distribution_system to get a dictionary of SWH equipment associated with each Distribution System for model 1 (pumps, tanks, SWH use, distribution system, etc): `RMD2_swh_system_and_equip_dict = get_swh_components_associated_with_each_swh_distribution_system(RMD2)`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

model 1 model 2


- check if this distribution ID is in model 2: `if RMD2_swh_system_and_equip_dict[swh_distribution_id]:`
- get the dictionary of all SWH equipment (pumps, tanks, SWH use, dist system, etc) for the given swh_distribution_id for RMD2: `RMD2_swh_equipment_dict = RMD2_swh_system_and_equip_dict[swh_distribution_id]`
- get the actual distribution equipment associated with this ID from model 1: `RMD2_swh_distribution = get_component_by_id(RMD2, swh_distribution_id)`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

model 1 model 2

- check if this distribution ID is in model 1: `if RMD1_swh_system_and_equip_dict[swh_distribution_id]:`
- get the dictionary of all SWH equipment (pumps, tanks, SWH use, dist system, etc) for the given swh_distribution_id for RMD1: `RMD1_swh_equipment_dict = RMD1_swh_system_and_equip_dict[swh_distribution_id]`
- get the actual distribution equipment associated with this ID from model 1: `RMD1_swh_distribution = get_component_by_id(RMD1, swh_distribution_id)`
- otherwise, return FALSE by adding an error to the list: `else: errors << "SWH Distribution System " + swh_distribution_id + " not found in one of the two RMDs"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<< is not python syntax

- otherwise, return FALSE by adding an error to the list: `else: errors << "SWH Distribution System " + swh_distribution_id + " not found in one of the two RMDs"`


- Compare the distribution in the two 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. If the comparison fails, we add an error to the errors list indicating the id of the swh distribution system that failed comparison: `if !compare_context_pair(RMD1_swh_distribution, RMD2_swh_distribution, $, extra_schema_for_SWH_comparison.json, true, compare_context_str, errors): errors << "Comparison of SWH Distribution System: " + swh_distribution_id + " failed."`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<< is not python syntax

- look at each SWHEquipment in the model 1: `for swh_eq_id in RMD1_swh_equipment_dict["SWHHeatingEq"]:`
- get the SWH equipment for models 1 and 2: `swh_eq_1 = get_component_by_id(RMD1, swh_eq_id); swh_eq_2 = get_component_by_id(RMD2, swh_eq_id)`
- compare the two SWH equipment using compare_context_pair. By passing in the same errors list, any new errors get appended to the list. If the comparison fails, we add an error to the errors list indicating the id of the swh equipment that failed comparison: `if !compare_context_pair(swh_eq_1, swh_eq_2, $, extra_schema_for_SWH_comparison.json, true, compare_context_str, errors): errors << "Comparison of SWH Equipment: " + swh_eq_id + " failed."`
- otherwise there is an unequal number of equipment entries. Add our own error to the errors list: `else: errors << "Unequal numbers of SWH Equipment between the two models for " + swh_distribution_id`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<<

- next, check Pumps - this will also recursively check PumpOutputValidationPointPumpOutputValidationPoint: `if len(RMD1_swh_equipment_dict["Pumps"]) == len(RMD2_swh_equipment_dict["Pumps"]):`
- look at each SWHEquipment in the proposed model: `for pump_id in RMD1_swh_equipment_dict["Pumps"]:`
- get the pumps for models 1 and 2: `pump_1 = get_component_by_id(RMD1, pump_id); pump_2 = get_component_by_id(RMD2, pump_id)`
- compare the two pumps using compare_context_pair. If the comparison fails, we add an error to the errors list indicating the id of the swh pump that failed comparison: `if !compare_context_pair(pump_1, pump_2, $, extra_schema_for_SWH_comparison.json, true, compare_context_str, error_str): errors << "Comparison of SWH Pump: " + pump_id + " failed."`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<<

- look at each SWHEquipment in the proposed model: `for pump_id in RMD1_swh_equipment_dict["Pumps"]:`
- get the pumps for models 1 and 2: `pump_1 = get_component_by_id(RMD1, pump_id); pump_2 = get_component_by_id(RMD2, pump_id)`
- compare the two pumps using compare_context_pair. If the comparison fails, we add an error to the errors list indicating the id of the swh pump that failed comparison: `if !compare_context_pair(pump_1, pump_2, $, extra_schema_for_SWH_comparison.json, true, compare_context_str, error_str): errors << "Comparison of SWH Pump: " + pump_id + " failed."`
- otherwise, there are an an unequal number of pump entries: `else: errors << "Unequal number of pumps in the two models for SWH Distribution System " + swh_distribution_id`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<<

- 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 models 1 and 2. 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 model 1 than model 2, comparing each item found in model 2 could return a false positive: `if len(RMD1_swh_equipment_dict["SWHHeatingEq"]) == len(RMD2_swh_equipment_dict["SWHHeatingEq"]):`
- look at each SWHEquipment in the model 1: `for swh_eq_id in RMD1_swh_equipment_dict["SWHHeatingEq"]:`
- get the SWH equipment for models 1 and 2: `swh_eq_1 = get_component_by_id(RMD1, swh_eq_id); swh_eq_2 = get_component_by_id(RMD2, swh_eq_id)`
- compare the two SWH equipment using compare_context_pair. By passing in the same errors list, any new errors get appended to the list. If the comparison fails, we add an error to the errors list indicating the id of the swh equipment that failed comparison: `if !compare_context_pair(swh_eq_1, swh_eq_2, $, extra_schema_for_SWH_comparison.json, true, compare_context_str, errors): errors << "Comparison of SWH Equipment: " + swh_eq_id + " failed."`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<<

- check if this distribution ID is in model 1: `if RMD1_swh_system_and_equip_dict[swh_distribution_id]:`
- get the dictionary of all SWH equipment (pumps, tanks, SWH use, dist system, etc) for the given swh_distribution_id for RMD1: `RMD1_swh_equipment_dict = RMD1_swh_system_and_equip_dict[swh_distribution_id]`
- get the actual distribution equipment associated with this ID from model 1: `RMD1_swh_distribution = get_component_by_id(RMD1, swh_distribution_id)`
- otherwise, return FALSE by adding an error to the list: `else: errors << "SWH Distribution System " + swh_distribution_id + " not found in one of the two RMDs"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should say "return FALSE"

- check if this distribution ID is in model 2: `if RMD2_swh_system_and_equip_dict[swh_distribution_id]:`
- get the dictionary of all SWH equipment (pumps, tanks, SWH use, dist system, etc) for the given swh_distribution_id for RMD2: `RMD2_swh_equipment_dict = RMD2_swh_system_and_equip_dict[swh_distribution_id]`
- get the actual distribution equipment associated with this ID from model 1: `RMD2_swh_distribution = get_component_by_id(RMD2, swh_distribution_id)`
- otherwise, return FALSE by adding an error to the list: `else: errors << "SWH Distribution System " + swh_distribution_id + " not found in one of the two RMDs"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should say "return FALSE"

- otherwise, return FALSE by adding an error to the list: `else: errors << "SWH Distribution System " + swh_distribution_id + " not found in one of the two RMDs"`


- Compare the distribution in the two 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. If the comparison fails, we add an error to the errors list indicating the id of the swh distribution system that failed comparison: `if !compare_context_pair(RMD1_swh_distribution, RMD2_swh_distribution, $, extra_schema_for_SWH_comparison.json, true, compare_context_str, errors): errors << "Comparison of SWH Distribution System: " + swh_distribution_id + " failed."`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$? I suggest ignoring any attempt for proper syntax to call compare_context_pair because there is no RDS for it - I would just describe the arguments that you know you want to pass to it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any suggestions on how to communicate this effectively?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- 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 models 1 and 2. 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 model 1 than model 2, comparing each item found in model 2 could return a false positive: `if len(RMD1_swh_equipment_dict["SWHHeatingEq"]) == len(RMD2_swh_equipment_dict["SWHHeatingEq"]):`
- look at each SWHEquipment in the model 1: `for swh_eq_id in RMD1_swh_equipment_dict["SWHHeatingEq"]:`
- get the SWH equipment for models 1 and 2: `swh_eq_1 = get_component_by_id(RMD1, swh_eq_id); swh_eq_2 = get_component_by_id(RMD2, swh_eq_id)`
- compare the two SWH equipment using compare_context_pair. By passing in the same errors list, any new errors get appended to the list. If the comparison fails, we add an error to the errors list indicating the id of the swh equipment that failed comparison: `if !compare_context_pair(swh_eq_1, swh_eq_2, $, extra_schema_for_SWH_comparison.json, true, compare_context_str, errors): errors << "Comparison of SWH Equipment: " + swh_eq_id + " failed."`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment for describing arguments and $

- next, check Pumps - this will also recursively check PumpOutputValidationPointPumpOutputValidationPoint: `if len(RMD1_swh_equipment_dict["Pumps"]) == len(RMD2_swh_equipment_dict["Pumps"]):`
- look at each SWHEquipment in the proposed model: `for pump_id in RMD1_swh_equipment_dict["Pumps"]:`
- get the pumps for models 1 and 2: `pump_1 = get_component_by_id(RMD1, pump_id); pump_2 = get_component_by_id(RMD2, pump_id)`
- compare the two pumps using compare_context_pair. If the comparison fails, we add an error to the errors list indicating the id of the swh pump that failed comparison: `if !compare_context_pair(pump_1, pump_2, $, extra_schema_for_SWH_comparison.json, true, compare_context_str, error_str): errors << "Comparison of SWH Pump: " + pump_id + " failed."`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment for describing arguments and $

- 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 models 1 and 2. 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 model 1 than model 2, comparing each item found in model 2 could return a false positive: `if len(RMD1_swh_equipment_dict["SWHHeatingEq"]) == len(RMD2_swh_equipment_dict["SWHHeatingEq"]):`
- look at each SWHEquipment in the model 1: `for swh_eq_id in RMD1_swh_equipment_dict["SWHHeatingEq"]:`
- get the SWH equipment for models 1 and 2: `swh_eq_1 = get_component_by_id(RMD1, swh_eq_id); swh_eq_2 = get_component_by_id(RMD2, swh_eq_id)`
- compare the two SWH equipment using compare_context_pair. By passing in the same errors list, any new errors get appended to the list. If the comparison fails, we add an error to the errors list indicating the id of the swh equipment that failed comparison: `if !compare_context_pair(swh_eq_1, swh_eq_2, $, extra_schema_for_SWH_comparison.json, true, compare_context_str, errors): errors << "Comparison of SWH Equipment: " + swh_eq_id + " failed."`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is important to know that compare_context_pair() needs to use one of the items in the pair as the "index". I would suggest indicating that the longer list should always be used as the index

- next, check Pumps - this will also recursively check PumpOutputValidationPointPumpOutputValidationPoint: `if len(RMD1_swh_equipment_dict["Pumps"]) == len(RMD2_swh_equipment_dict["Pumps"]):`
- look at each SWHEquipment in the proposed model: `for pump_id in RMD1_swh_equipment_dict["Pumps"]:`
- get the pumps for models 1 and 2: `pump_1 = get_component_by_id(RMD1, pump_id); pump_2 = get_component_by_id(RMD2, pump_id)`
- compare the two pumps using compare_context_pair. If the comparison fails, we add an error to the errors list indicating the id of the swh pump that failed comparison: `if !compare_context_pair(pump_1, pump_2, $, extra_schema_for_SWH_comparison.json, true, compare_context_str, error_str): errors << "Comparison of SWH Pump: " + pump_id + " failed."`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest indicating that the longer list should always be used as the index

- next, check Pumps - this will also recursively check PumpOutputValidationPointPumpOutputValidationPoint: `if len(RMD1_swh_equipment_dict["Pumps"]) == len(RMD2_swh_equipment_dict["Pumps"]):`
- look at each SWHEquipment in the proposed model: `for pump_id in RMD1_swh_equipment_dict["Pumps"]:`
- get the pumps for models 1 and 2: `pump_1 = get_component_by_id(RMD1, pump_id); pump_2 = get_component_by_id(RMD2, pump_id)`
- compare the two pumps using compare_context_pair. If the comparison fails, we add an error to the errors list indicating the id of the swh pump that failed comparison: `if !compare_context_pair(pump_1, pump_2, $, extra_schema_for_SWH_comparison.json, true, compare_context_str, error_str): errors << "Comparison of SWH Pump: " + pump_id + " failed."`
Copy link
Collaborator

@JacksonJ-KC JacksonJ-KC Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this is checking if !compare_context_pair. If the function returns a list then the list will behave as a truthy value if it is not empty

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

old logic - I've removed if !

- get the actual distribution equipment associated with this ID from model 1: `RMD2_swh_distribution = get_component_by_id(RMD2, swh_distribution_id)`
- otherwise, return FALSE by adding an error to the list: `else: errors << "SWH Distribution System " + swh_distribution_id + " not found in one of the two RMDs"`


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the list of errors is not empty at this point I think we should return it and prevent the rest of the logic

- 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 models 1 and 2. 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 model 1 than model 2, comparing each item found in model 2 could return a false positive: `if len(RMD1_swh_equipment_dict["SWHHeatingEq"]) == len(RMD2_swh_equipment_dict["SWHHeatingEq"]):`
- look at each SWHEquipment in the model 1: `for swh_eq_id in RMD1_swh_equipment_dict["SWHHeatingEq"]:`
- get the SWH equipment for models 1 and 2: `swh_eq_1 = get_component_by_id(RMD1, swh_eq_id); swh_eq_2 = get_component_by_id(RMD2, swh_eq_id)`
- compare the two SWH equipment using compare_context_pair. By passing in the same errors list, any new errors get appended to the list. If the comparison fails, we add an error to the errors list indicating the id of the swh equipment that failed comparison: `if !compare_context_pair(swh_eq_1, swh_eq_2, $, extra_schema_for_SWH_comparison.json, true, compare_context_str, errors): errors << "Comparison of SWH Equipment: " + swh_eq_id + " failed."`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When writing a call to compare_context_pair I suggest writing it with the following format and ignoring the other details for the purposes of RDS:

compare_context_pair(index_context=swh_eq_1, compare_context=swh_eq_2, extra_schema='extra_schema_for_SWH_comparison.json', error_msg_list=errors)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! I've implemented this

- 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 models 1 and 2. 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 model 1 than model 2, comparing each item found in model 2 could return a false positive: `if len(RMD1_swh_equipment_dict["SWHHeatingEq"]) == len(RMD2_swh_equipment_dict["SWHHeatingEq"]):`
- look at each SWHEquipment in the model 1: `for swh_eq_id in RMD1_swh_equipment_dict["SWHHeatingEq"]:`
- get the SWH equipment for models 1 and 2: `swh_eq_1 = get_component_by_id(RMD1, swh_eq_id); swh_eq_2 = get_component_by_id(RMD2, swh_eq_id)`
- compare the two SWH equipment using compare_context_pair. By passing in the same errors list, any new errors get appended to the list. If the comparison fails, we add an error to the errors list indicating the id of the swh equipment that failed comparison: `if !compare_context_pair(swh_eq_1, swh_eq_2, $, extra_schema_for_SWH_comparison.json, true, compare_context_str, errors): errors << "Comparison of SWH Equipment: " + swh_eq_id + " failed."`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment about if !compare_context_pair

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants