@@ -514,14 +514,12 @@ def summary_class(self, file=sys.stderr, N=None):
514514 # While this carries over less information, it is arranged such
515515 # that it is way more readable than the previous output of the
516516 # profiler
517+ nb_classes = max (0 , len (otimes ) - N )
518+ percent_total = sum (f for f , t , a , ci , nb_call , nb_op in otimes [N :])
519+ time_total = sum (t for f , t , a , ci , nb_call , nb_op in otimes [N :])
517520 print (
518- " ... (remaining %i Classes account for %6.2f%%(%.2fs) of "
519- "the runtime)"
520- % (
521- max (0 , len (otimes ) - N ),
522- sum (f for f , t , a , ci , nb_call , nb_op in otimes [N :]),
523- sum (t for f , t , a , ci , nb_call , nb_op in otimes [N :]),
524- ),
521+ f" ... (remaining { nb_classes } Classes account for "
522+ f"{ percent_total :6.2f} %%({ time_total :.2f} s) of the runtime)" ,
525523 file = file ,
526524 )
527525 print ("" , file = file )
@@ -607,14 +605,12 @@ def summary_ops(self, file=sys.stderr, N=None):
607605 # While this carries over less information, it is arranged such
608606 # that it is way more readable than the previous output of the
609607 # profiler
608+ nb_ops = max (0 , len (otimes ) - N )
609+ percent_total = sum (f for f , t , a , ci , nb_call , nb_op in otimes [N :])
610+ time_total = sum (t for f , t , a , ci , nb_call , nb_op in otimes [N :])
610611 print (
611- " ... (remaining %i Ops account for %6.2f%%(%.2fs) of "
612- "the runtime)"
613- % (
614- max (0 , len (otimes ) - N ),
615- sum (f for f , t , a , ci , nb_call , nb_op in otimes [N :]),
616- sum (t for f , t , a , ci , nb_call , nb_op in otimes [N :]),
617- ),
612+ f" ... (remaining { nb_ops } Ops account for "
613+ f"{ percent_total :6.2f} %%({ time_total :.2f} s) of the runtime)" ,
618614 file = file ,
619615 )
620616 print ("" , file = file )
0 commit comments