Skip to content

Commit 65d3d3b

Browse files
committed
improve the text
1 parent 6d2d249 commit 65d3d3b

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

codeflash/api/aiservice.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from __future__ import annotations
22

3-
import time
4-
53
import json
64
import os
75
import platform
6+
import time
87
from typing import TYPE_CHECKING, Any
98

109
import requests
@@ -122,7 +121,7 @@ def optimize_python_code(
122121
logger.info(f"Generated {len(optimizations_json)} candidates.")
123122
console.rule()
124123
end_time = time.perf_counter()
125-
logger.debug(f"Optimization took {end_time - start_time:.2f} seconds.")
124+
logger.debug(f"Generating optimizations took {end_time - start_time:.2f} seconds.")
126125
return [
127126
OptimizedCandidate(
128127
source_code=opt["source_code"],
@@ -177,7 +176,7 @@ def optimize_python_code_line_profiler(
177176

178177
logger.info("Generating optimized candidates…")
179178
console.rule()
180-
if line_profiler_results=="":
179+
if line_profiler_results == "":
181180
logger.info("No LineProfiler results were provided, Skipping optimization.")
182181
console.rule()
183182
return []
@@ -209,7 +208,6 @@ def optimize_python_code_line_profiler(
209208
console.rule()
210209
return []
211210

212-
213211
def log_results(
214212
self,
215213
function_trace_id: str,
@@ -272,9 +270,10 @@ def generate_regression_tests(
272270
- Dict[str, str] | None: The generated regression tests and instrumented tests, or None if an error occurred.
273271
274272
"""
275-
assert test_framework in ["pytest", "unittest"], (
276-
f"Invalid test framework, got {test_framework} but expected 'pytest' or 'unittest'"
277-
)
273+
assert test_framework in [
274+
"pytest",
275+
"unittest",
276+
], f"Invalid test framework, got {test_framework} but expected 'pytest' or 'unittest'"
278277
payload = {
279278
"source_code_being_tested": source_code_being_tested,
280279
"function_to_optimize": function_to_optimize,

0 commit comments

Comments
 (0)