Skip to content

Commit

Permalink
Try to fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
timmens committed Dec 1, 2024
1 parent e72608b commit fe27a3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/optimagic/benchmarking/run_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/optimagic/optimization/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -267,7 +267,7 @@ def criterion(self) -> list[float | None]:
def runtime(self) -> list[float]:
msg = (

Check warning on line 268 in src/optimagic/optimization/history.py

View check run for this annotation

Codecov / codecov/patch

src/optimagic/optimization/history.py#L268

Added line #L268 was not covered by tests
"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
Expand Down

0 comments on commit fe27a3b

Please sign in to comment.