Skip to content

Commit c0b85ad

Browse files
committed
cleaning up
1 parent c4cf495 commit c0b85ad

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

codeflash/api/aiservice.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ def log_results( # noqa: D417
316316
original_runtime: float | None,
317317
optimized_runtime: dict[str, float | None] | None,
318318
is_correct: dict[str, bool] | None,
319-
best_optimization_id: str | None,
320319
optimized_line_profiler_results: dict[str, str] | None,
321320
) -> None:
322321
"""Log features to the database.
@@ -328,7 +327,6 @@ def log_results( # noqa: D417
328327
- original_runtime (Optional[Dict[str, float]]): The original runtime.
329328
- optimized_runtime (Optional[Dict[str, float]]): The optimized runtime.
330329
- is_correct (Optional[Dict[str, bool]]): Whether the optimized code is correct.
331-
- best_optimization_id (Optional[str]): The best optimization id.
332330
-optimized_line_profiler_results: line_profiler results for every candidate mapped to their optimization_id
333331
334332
"""
@@ -339,7 +337,6 @@ def log_results( # noqa: D417
339337
"optimized_runtime": optimized_runtime,
340338
"is_correct": is_correct,
341339
"codeflash_version": codeflash_version,
342-
"best_optimization_id": best_optimization_id,
343340
"optimized_line_profiler_results": optimized_line_profiler_results,
344341
}
345342
try:

codeflash/models/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def __hash__(self) -> int:
7575

7676
class BestOptimization(BaseModel):
7777
candidate: OptimizedCandidate
78+
helper_functions: list[FunctionSource]
7879
code_context: CodeOptimizationContext
7980
runtime: int
8081
replay_performance_gain: Optional[dict[BenchmarkKey, float]] = None

codeflash/optimization/function_optimizer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,6 @@ def determine_best_candidate(
361361
file_path_to_helper_classes: dict[Path, set[str]],
362362
exp_type: str,
363363
) -> BestOptimization | None:
364-
# TODO remove
365-
366364
best_optimization: BestOptimization | None = None
367365
_best_runtime_until_now = original_code_baseline.runtime
368366

@@ -507,6 +505,7 @@ def determine_best_candidate(
507505

508506
best_optimization = BestOptimization(
509507
candidate=candidate,
508+
helper_functions=code_context.helper_functions,
510509
code_context=code_context,
511510
runtime=best_test_runtime,
512511
line_profiler_test_results=line_profile_test_results,

0 commit comments

Comments
 (0)