Skip to content

Commit fe27a3b

Browse files
committed
Try to fix some warnings
1 parent e72608b commit fe27a3b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/optimagic/benchmarking/run_benchmark.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def _process_one_result(optimize_result, problem):
209209
criterion_history = history.fun
210210
criterion_history = np.clip(criterion_history, _solution_crit, np.inf)
211211
batches_history = history.batches
212-
time_history = history.time
212+
time_history = history.start_time
213213

214214
return {
215215
"params_history": params_history_flat,

src/optimagic/optimization/history.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def task(self) -> list[EvalTask]:
251251
def time(self) -> list[float]:
252252
msg = (
253253
"The attribute `time` of History will be deprecated soon. Use the "
254-
f"`{self._get_time.__name__}` method instead."
254+
"`start_time` method instead."
255255
)
256256
warnings.warn(msg, FutureWarning)
257257
arr = np.array(self._start_time)
@@ -267,7 +267,7 @@ def criterion(self) -> list[float | None]:
267267
def runtime(self) -> list[float]:
268268
msg = (
269269
"The attribute `runtime` of History will be deprecated soon. Use the "
270-
f"`{self._get_time.__name__}` method instead."
270+
"`start_time` method instead."
271271
)
272272
warnings.warn(msg, FutureWarning)
273273
return self.time

0 commit comments

Comments
 (0)