Skip to content

Commit

Permalink
remove print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
esantorella committed Jul 26, 2023
1 parent 918635a commit 2d72246
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
6 changes: 1 addition & 5 deletions botorch/optim/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,9 @@ def scipy_minimize(
call_counter = count(1) # callbacks are typically made at the end of each iter

def wrapped_callback(x: ndarray):
fval = float(wrapped_closure(x)[0])
print(f"{fval=}")
result = OptimizationResult(
step=next(call_counter),
fval=fval,
fval=float(wrapped_closure(x)[0]),
status=OptimizationStatus.RUNNING,
runtime=monotonic() - start_time,
)
Expand All @@ -118,8 +116,6 @@ def wrapped_callback(x: ndarray):
callback=wrapped_callback,
timeout_sec=timeout_sec,
)
print(f"{raw=}")
print(f"{raw.message=}")

# Post-processing and outcome handling
wrapped_closure.state = asarray(raw.x) # set parameter state to optimal values
Expand Down
1 change: 0 additions & 1 deletion botorch/optim/utils/timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def minimize_with_timeout(

def timeout_callback(xk: np.ndarray) -> bool:
runtime = time.monotonic() - start_time
print(f"{runtime=}")
callback_data["num_iterations"] += 1
if runtime > timeout_sec:
raise OptimizationTimeoutError(current_x=xk, runtime=runtime)
Expand Down
2 changes: 0 additions & 2 deletions test/optim/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ def test_timeout(self):
# adding a small delay here to combat some timing issues on windows
closure = partial(norm_squared, x, delay=1e-2)
result = scipy_minimize(closure, {"x": x}, timeout_sec=1e-4)
print(f"{result=}")
print(f"{result.message=}")
self.assertEqual(result.status, OptimizationStatus.STOPPED)
self.assertTrue("Optimization timed out after" in result.message)

Expand Down

0 comments on commit 2d72246

Please sign in to comment.