File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -339,7 +339,8 @@ def test_prepare_reporter(test_context):
339339
340340def test_compare (test_context ) -> None :
341341 """Compare the output of genno-based and legacy reporting."""
342- key = "pe test"
342+ key = "all::iamc"
343+ # key = "pe test"
343344
344345 # Obtain the output from reporting `key` on `snapshot_id`
345346 snapshot_id : int = 1
@@ -393,10 +394,21 @@ def checks(df: pd.DataFrame):
393394 "value_rel = value_diff / value_left"
394395 )
395396
397+ na_left = tmp .isna ()[["unit_left" , "value_left" ]]
398+ if na_left .any (axis = None ):
399+ record (f"{ prefix } { na_left .sum (axis = 0 ).max ()} missing left entries" )
400+ tmp = tmp [~ na_left .any (axis = 1 )]
401+ na_right = tmp .isna ()[["unit_right" , "value_right" ]]
402+ if na_right .any (axis = None ):
403+ record (f"{ prefix } { na_right .sum (axis = 0 ).max ()} missing right entries" )
404+ tmp = tmp [~ na_right .any (axis = 1 )]
405+
396406 units_left = set (tmp .unit_left .unique ())
397407 units_right = set (tmp .unit_right .unique ())
398- if units_left != units_right :
399- record (f"{ prefix } units mismatch: { units_left } != { units_right } " )
408+ record (
409+ condition = units_left != units_right ,
410+ message = f"{ prefix } units mismatch: { units_left } != { units_right } " ,
411+ )
400412
401413 N0 = len (df )
402414
You can’t perform that action at this time.
0 commit comments