88import time
99import uuid
1010from collections import defaultdict , deque
11- from dataclasses import replace
1211from pathlib import Path
1312from typing import TYPE_CHECKING
1413
@@ -1124,7 +1123,9 @@ def find_and_process_best_optimization(
11241123 new_explanation_raw_str = self .aiservice_client .get_new_explanation (
11251124 source_code = code_context .read_writable_code ,
11261125 dependency_code = code_context .read_only_context_code ,
1127- trace_id = self .function_trace_id [:- 4 ] + exp_type if self .experiment_id else self .function_trace_id ,
1126+ trace_id = self .function_trace_id [:- 4 ] + exp_type
1127+ if self .experiment_id
1128+ else self .function_trace_id ,
11281129 optimized_code = best_optimization .candidate .source_code ,
11291130 original_line_profiler_results = original_code_baseline .line_profile_results ["str_out" ],
11301131 optimized_line_profiler_results = best_optimization .line_profiler_test_results ["str_out" ],
@@ -1134,13 +1135,16 @@ def find_and_process_best_optimization(
11341135 annotated_tests = generated_tests_str ,
11351136 optimization_id = best_optimization .candidate .optimization_id ,
11361137 )
1137- new_explanation = Explanation (raw_explanation_message = new_explanation_raw_str or explanation .raw_explanation_message , winning_behavior_test_results = explanation .winning_behavior_test_results ,
1138- winning_benchmarking_test_results = explanation .winning_benchmarking_test_results ,
1139- original_runtime_ns = explanation .original_runtime_ns ,
1140- best_runtime_ns = explanation .best_runtime_ns ,
1141- function_name = explanation .function_name ,
1142- file_path = explanation .file_path ,
1143- benchmark_details = explanation .benchmark_details )
1138+ new_explanation = Explanation (
1139+ raw_explanation_message = new_explanation_raw_str or explanation .raw_explanation_message ,
1140+ winning_behavior_test_results = explanation .winning_behavior_test_results ,
1141+ winning_benchmarking_test_results = explanation .winning_benchmarking_test_results ,
1142+ original_runtime_ns = explanation .original_runtime_ns ,
1143+ best_runtime_ns = explanation .best_runtime_ns ,
1144+ function_name = explanation .function_name ,
1145+ file_path = explanation .file_path ,
1146+ benchmark_details = explanation .benchmark_details ,
1147+ )
11441148 check_create_pr (
11451149 original_code = original_code_combined ,
11461150 new_code = new_code_combined ,
0 commit comments