fix: Fixes bug with end_threshold and better error logging
This commit is contained in:
parent
3d3b1a83f6
commit
0e1fbec043
@ -60,11 +60,12 @@ class BayesRun():
|
|||||||
self.max_frequency = max_frequency
|
self.max_frequency = max_frequency
|
||||||
|
|
||||||
if end_threshold is not None:
|
if end_threshold is not None:
|
||||||
if 0 < self.end_threshold < 1:
|
if 0 < end_threshold < 1:
|
||||||
self.end_threshold: float = end_threshold
|
self.end_threshold: float = end_threshold
|
||||||
self.use_end_threshold = True
|
self.use_end_threshold = True
|
||||||
|
_logger.info("Will abort early, at {self.end_threshold}.")
|
||||||
else:
|
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:
|
def go(self) -> None:
|
||||||
with open(self.filename, "a", newline="") as outfile:
|
with open(self.filename, "a", newline="") as outfile:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user