From 1c398128f29abb2cd287268f81e88387c94f134b Mon Sep 17 00:00:00 2001 From: Ben van Werkhoven Date: Mon, 24 Jun 2024 15:57:06 +0200 Subject: [PATCH] fix for python 3.9 --- kernel_tuner/cache/cache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel_tuner/cache/cache.py b/kernel_tuner/cache/cache.py index 6078cfe0..62bcd60e 100644 --- a/kernel_tuner/cache/cache.py +++ b/kernel_tuner/cache/cache.py @@ -272,7 +272,7 @@ def append( benchmark_time: float, strategy_time: int, framework_time: float, - timestamp: datetime, + timestamp, times: Optional[list[float]] = None, **tune_params, ) -> None: @@ -297,7 +297,7 @@ def append( raise ValueError(f"Argument framework_time should be a float, received: {framework_time} ({type(framework_time)})") if not isinstance(timestamp, datetime): # timestamp is not a Python datetime, try to convert string to datetime - timestamp = datetime.fromisoformat(timestamp) + timestamp = datetime.fromisoformat(str(timestamp)) if times is not None and not (isinstance(times, list) and all(isinstance(time, float) for time in times)): raise ValueError("Argument times should be a list of floats or None")