From fe27a3bcc77cd96eb93e6b85897c1a3e27ca5999 Mon Sep 17 00:00:00 2001 From: Tim Mensinger Date: Sun, 1 Dec 2024 20:52:22 +0100 Subject: [PATCH] Try to fix some warnings --- src/optimagic/benchmarking/run_benchmark.py | 2 +- src/optimagic/optimization/history.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/optimagic/benchmarking/run_benchmark.py b/src/optimagic/benchmarking/run_benchmark.py index 9e2ce4cd8..cd6d844c4 100644 --- a/src/optimagic/benchmarking/run_benchmark.py +++ b/src/optimagic/benchmarking/run_benchmark.py @@ -209,7 +209,7 @@ def _process_one_result(optimize_result, problem): criterion_history = history.fun criterion_history = np.clip(criterion_history, _solution_crit, np.inf) batches_history = history.batches - time_history = history.time + time_history = history.start_time return { "params_history": params_history_flat, diff --git a/src/optimagic/optimization/history.py b/src/optimagic/optimization/history.py index 40083eb7d..0e4bb5efb 100644 --- a/src/optimagic/optimization/history.py +++ b/src/optimagic/optimization/history.py @@ -251,7 +251,7 @@ def task(self) -> list[EvalTask]: def time(self) -> list[float]: msg = ( "The attribute `time` of History will be deprecated soon. Use the " - f"`{self._get_time.__name__}` method instead." + "`start_time` method instead." ) warnings.warn(msg, FutureWarning) arr = np.array(self._start_time) @@ -267,7 +267,7 @@ def criterion(self) -> list[float | None]: def runtime(self) -> list[float]: msg = ( "The attribute `runtime` of History will be deprecated soon. Use the " - f"`{self._get_time.__name__}` method instead." + "`start_time` method instead." ) warnings.warn(msg, FutureWarning) return self.time