Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions codeflash/models/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import statistics
from collections import Counter, defaultdict
from functools import lru_cache
from typing import TYPE_CHECKING
Expand Down Expand Up @@ -953,12 +954,13 @@ def usable_runtime_data_by_test_case(self) -> dict[InvocationId, list[int]]:
if result.runtime:
by_id.setdefault(result.id, []).append(result.runtime)
else:
msg = (
f"Ignoring test case that passed but had no runtime -> {result.id}, "
f"Loop # {result.loop_index}, Test Type: {result.test_type}, "
f"Verification Type: {result.verification_type}"
logger.debug(
"Ignoring test case that passed but had no runtime -> %s, Loop # %s, Test Type: %s, Verification Type: %s",
result.id,
result.loop_index,
result.test_type,
result.verification_type,
)
logger.debug(msg)
return by_id

def total_passed_runtime(self) -> int:
Expand All @@ -970,8 +972,6 @@ def total_passed_runtime(self) -> int:

:return: The runtime in nanoseconds.
"""
import statistics

# TODO this doesn't look at the intersection of tests of baseline and original
return sum(
statistics.median_low(usable_runtime_data)
Expand Down
Loading