Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

experiments and candidates can be None #311

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bofire/strategies/predictives/botorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ def _ask(self, candidate_count: int) -> pd.DataFrame:
"""

assert candidate_count > 0, "candidate_count has to be larger than zero."
if self.experiments is None:
raise ValueError("No experiments have been provided yet.")

acqfs = self._get_acqfs(candidate_count)

Expand Down
8 changes: 4 additions & 4 deletions bofire/strategies/strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ def from_spec(cls, data_model: DataModel) -> "Strategy":
return cls(data_model=data_model)

@property
def experiments(self) -> pd.DataFrame:
def experiments(self) -> Optional[pd.DataFrame]:
"""Returns the experiments of the strategy.

Returns:
pd.DataFrame: Current experiments.
"""
return self._experiments # type: ignore
return self._experiments

@property
def candidates(self) -> pd.DataFrame:
def candidates(self) -> Optional[pd.DataFrame]:
"""Returns the (pending) candidates of the strategy.

Returns:
pd.DataFrame: Pending experiments.
"""
return self._candidates # type: ignore
return self._candidates

def tell(
self,
Expand Down
Loading