fix: Fixes bug with end_threshold and better error logging

This commit is contained in:
Deepak Mallubhotla 2022-02-14 09:44:04 -06:00
parent 3d3b1a83f6
commit 0e1fbec043
Signed by: deepak
GPG Key ID: BEBAEBF28083E022

View File

@ -60,11 +60,12 @@ class BayesRun():
self.max_frequency = max_frequency
if end_threshold is not None:
if 0 < self.end_threshold < 1:
if 0 < end_threshold < 1:
self.end_threshold: float = end_threshold
self.use_end_threshold = True
_logger.info("Will abort early, at {self.end_threshold}.")
else:
raise ValueError(f"{end_threshold} should be between 0 and 1")
raise ValueError(f"end_threshold should be between 0 and 1, but is actually {end_threshold}")
def go(self) -> None:
with open(self.filename, "a", newline="") as outfile: