Skip to content

Commit

Permalink
fix(runtime): explicitly load previous results
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiebergman committed Jun 10, 2024
1 parent 6635010 commit 7cd316c
Show file tree
Hide file tree
Showing 7 changed files with 425 additions and 436 deletions.
4 changes: 4 additions & 0 deletions neps/optimizers/base_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing_extensions import Self
from contextlib import contextmanager
from pathlib import Path
from neps.optimizers.ask_and_tell import AskAndTellWrapper

from neps.utils.types import ConfigResult, RawConfig, ERROR, ResultDict
from neps.utils.files import serialize, deserialize
Expand Down Expand Up @@ -121,3 +122,6 @@ def using_state(self, state_file: Path) -> Iterator[Self]:
def is_out_of_budget(self) -> bool:
"""Check if the optimizer has used all of its budget, if any."""
return self.budget is not None and self.used_budget >= self.budget

def to_ask_and_tell(self, working_dir: Path | str) -> AskAndTellWrapper:
return AskAndTellWrapper(working_dir=Path(working_dir), optimizer=self)
Loading

0 comments on commit 7cd316c

Please sign in to comment.