@@ -109,6 +109,7 @@ def print_return_msg(error_msg):
109109 print (error_msg )
110110 return error_msg
111111
112+
112113def compare_protocols (prot_tree_orig , prot_tree_final ):
113114 # compare the two dictionaries
114115 errors_list = []
@@ -230,11 +231,19 @@ def compare_protocols(prot_tree_orig, prot_tree_final):
230231 error = False
231232 orig_val = getattr (act_props_orig [nm ], key )
232233 final_val = getattr (el , key )
233-
234+
234235 if key == "isVis" :
235- orig_norm = normalize_condition (orig_val ) if orig_val is not None else None
236- final_norm = normalize_condition (final_val ) if final_val is not None else None
237-
236+ orig_norm = (
237+ normalize_condition (orig_val )
238+ if orig_val is not None
239+ else None
240+ )
241+ final_norm = (
242+ normalize_condition (final_val )
243+ if final_val is not None
244+ else None
245+ )
246+
238247 # Case 1: original is True - final can be None or True
239248 if orig_norm is True :
240249 if not (final_norm is None or final_norm is True ):
@@ -260,7 +269,7 @@ def compare_protocols(prot_tree_orig, prot_tree_final):
260269 elif final_val and orig_val is None :
261270 if normalize_condition (final_val ) != False :
262271 error = True
263-
272+
264273 if error :
265274 errors_list .append (
266275 print_return_msg (
@@ -433,4 +442,4 @@ def test_rs2redcap_redcap2rs(tmpdir):
433442 )
434443
435444 assert not errors_list , f"Errors: { errors_list } "
436- print ("No errors, but found warnings: " , warnings_list )
445+ print ("No errors, but found warnings: " , warnings_list )
0 commit comments