|
6 | 6 | import queue |
7 | 7 | import random |
8 | 8 | import subprocess |
9 | | -import time |
10 | 9 | import uuid |
11 | 10 | from collections import defaultdict |
12 | 11 | from pathlib import Path |
@@ -1667,9 +1666,7 @@ def establish_original_code_baseline( |
1667 | 1666 | finally: |
1668 | 1667 | if self.function_to_optimize.is_async: |
1669 | 1668 | self.write_code_and_helpers( |
1670 | | - self.function_to_optimize_source_code, |
1671 | | - original_helper_code, |
1672 | | - self.function_to_optimize.file_path, |
| 1669 | + self.function_to_optimize_source_code, original_helper_code, self.function_to_optimize.file_path |
1673 | 1670 | ) |
1674 | 1671 |
|
1675 | 1672 | console.print( |
@@ -1739,7 +1736,7 @@ def run_optimized_candidate( |
1739 | 1736 | original_helper_code: dict[Path, str], |
1740 | 1737 | file_path_to_helper_classes: dict[Path, set[str]], |
1741 | 1738 | ) -> Result[OptimizedCandidateResult, str]: |
1742 | | - assert (test_framework := self.args.test_framework) in {"pytest", "unittest"} # noqa: RUF018 |
| 1739 | + assert (test_framework := self.args.test_framework) in {"pytest", "unittest"} |
1743 | 1740 |
|
1744 | 1741 | with progress_bar("Testing optimization candidate"): |
1745 | 1742 | test_env = self.get_test_env( |
@@ -1822,11 +1819,7 @@ def run_optimized_candidate( |
1822 | 1819 | ) |
1823 | 1820 | loop_count = ( |
1824 | 1821 | max(all_loop_indices) |
1825 | | - if ( |
1826 | | - all_loop_indices := { |
1827 | | - result.loop_index for result in candidate_benchmarking_results.test_results |
1828 | | - } |
1829 | | - ) |
| 1822 | + if (all_loop_indices := {result.loop_index for result in candidate_benchmarking_results.test_results}) |
1830 | 1823 | else 0 |
1831 | 1824 | ) |
1832 | 1825 |
|
|
0 commit comments