File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -316,14 +316,19 @@ def print_result(
316316 sort_by_abs = True ,
317317 absolute_diff = False ,
318318 lhs_name = "lhs" ,
319- rhs_name = "rhs"
319+ rhs_name = "rhs" ,
320+ only_significant = False
320321):
321322 metrics = d .columns .levels [0 ]
322323 if sort_by_abs :
323324 d = d .sort_values (by = (metrics [0 ], sortkey ), key = pd .Series .abs , ascending = False )
324325 else :
325326 d = d .sort_values (by = (metrics [0 ], sortkey ), ascending = False )
326327
328+ if only_significant :
329+ if (metrics [0 ], 'significant' ) in d .columns :
330+ d = d [d [(metrics [0 ], 'significant' )] == 'Y' ]
331+
327332 # Ensure that the columns are grouped by metric (rather than having the
328333 # diffs at the end of the line).
329334 d = d .reindex (columns = d .columns .levels [0 ], level = 0 )
@@ -494,6 +499,13 @@ def main():
494499 default = 0.05 ,
495500 help = "Significance level for statistical tests (default: 0.05)" ,
496501 )
502+ parser .add_argument (
503+ "--only-significant" ,
504+ action = "store_true" ,
505+ dest = "only_significant" ,
506+ default = False ,
507+ help = "Show only significant results when used with --statistics" ,
508+ )
497509 config = parser .parse_args ()
498510
499511 if config .show_diff is None :
@@ -636,6 +648,7 @@ def main():
636648 config .absolute_diff ,
637649 config .lhs_name ,
638650 config .rhs_name ,
651+ config .only_significant ,
639652 )
640653
641654
You can’t perform that action at this time.
0 commit comments