|
49 | 49 | BestOptimization, |
50 | 50 | CodeOptimizationContext, |
51 | 51 | FunctionCalledInTest, |
52 | | - FunctionParent, |
53 | 52 | GeneratedTests, |
54 | 53 | GeneratedTestsList, |
55 | 54 | OptimizationSet, |
|
79 | 78 |
|
80 | 79 | from codeflash.discovery.functions_to_optimize import FunctionToOptimize |
81 | 80 | from codeflash.either import Result |
82 | | - from codeflash.models.models import BenchmarkKey, CoverageData, FunctionSource, OptimizedCandidate |
| 81 | + from codeflash.models.models import BenchmarkKey, CoverageData, FunctionParent, FunctionSource, OptimizedCandidate |
83 | 82 | from codeflash.verification.verification_utils import TestConfig |
84 | 83 |
|
85 | 84 |
|
@@ -299,9 +298,7 @@ def optimize_function(self) -> Result[BestOptimization, str]: # noqa: PLR0911 |
299 | 298 | self.log_successful_optimization(explanation, generated_tests, exp_type) |
300 | 299 |
|
301 | 300 | preexisting_functions_by_filepath: dict[Path, list[str]] = {} |
302 | | - filepaths_to_inspect = [self.function_to_optimize.file_path] + list( |
303 | | - {helper.file_path for helper in code_context.helper_functions} |
304 | | - ) |
| 301 | + filepaths_to_inspect = [self.function_to_optimize.file_path, *list({helper.file_path for helper in code_context.helper_functions})] |
305 | 302 | for filepath in filepaths_to_inspect: |
306 | 303 | source_code = filepath.read_text(encoding="utf8") |
307 | 304 | preexisting_functions_by_filepath[filepath] = find_preexisting_objects(source_code) |
@@ -610,7 +607,7 @@ def reformat_code_and_helpers( |
610 | 607 | if should_sort_imports and isort.code(original_code) != original_code: |
611 | 608 | should_sort_imports = False |
612 | 609 |
|
613 | | - paths = [fto_path] + list({hf.file_path for hf in helper_functions}) |
| 610 | + paths = [fto_path, *list({hf.file_path for hf in helper_functions})] |
614 | 611 | new_target_code = None |
615 | 612 | new_helper_code: dict[Path, str] = {} |
616 | 613 | for i, path in enumerate(paths): |
|
0 commit comments