@@ -514,14 +514,12 @@ def summary_class(self, file=sys.stderr, N=None):
514
514
# While this carries over less information, it is arranged such
515
515
# that it is way more readable than the previous output of the
516
516
# 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 :])
517
520
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)" ,
525
523
file = file ,
526
524
)
527
525
print ("" , file = file )
@@ -607,14 +605,12 @@ def summary_ops(self, file=sys.stderr, N=None):
607
605
# While this carries over less information, it is arranged such
608
606
# that it is way more readable than the previous output of the
609
607
# 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 :])
610
611
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)" ,
618
614
file = file ,
619
615
)
620
616
print ("" , file = file )
0 commit comments