@@ -80,9 +80,7 @@ def show_text(stats: dict) -> str:
8080 return out_table
8181
8282
83- def show_text_non_python (
84- stats : dict , line_contents : dict [tuple [str , int ], str ]
85- ) -> str :
83+ def show_text_non_python (stats : dict , line_contents : dict [tuple [str , int ], str ]) -> str :
8684 """Show text for non-Python timings using profiler-provided line contents."""
8785 out_table = ""
8886 out_table += "# Timer unit: {:g} s\n " .format (stats ["unit" ])
@@ -115,11 +113,7 @@ def show_text_non_python(
115113
116114 table_cols = ("Hits" , "Time" , "Per Hit" , "% Time" , "Line Contents" )
117115 out_table += tabulate (
118- headers = table_cols ,
119- tabular_data = table_rows ,
120- tablefmt = "pipe" ,
121- colglobalalign = None ,
122- preserve_whitespace = True ,
116+ headers = table_cols , tabular_data = table_rows , tablefmt = "pipe" , colglobalalign = None , preserve_whitespace = True
123117 )
124118 out_table += "\n "
125119 return out_table
@@ -159,9 +153,7 @@ def parse_line_profile_results(line_profiler_output_file: Optional[Path]) -> dic
159153 line_num = int (line_str )
160154 line_num = int (line_num )
161155
162- lines_by_file .setdefault (file_path , []).append (
163- (line_num , int (stats .get ("hits" , 0 )), int (stats .get ("time" , 0 )))
164- )
156+ lines_by_file .setdefault (file_path , []).append ((line_num , int (stats .get ("hits" , 0 )), int (stats .get ("time" , 0 ))))
165157 line_contents [(file_path , line_num )] = stats .get ("content" , "" )
166158
167159 for file_path , line_stats in lines_by_file .items ():
0 commit comments