Skip to content

Commit

Permalink
add additional logging information
Browse files Browse the repository at this point in the history
  • Loading branch information
jas-yao committed Dec 16, 2024
1 parent 0038ffc commit 94e9732
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions pyomo/contrib/pyros/pyros_algorithm_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,13 @@ def ROSolver_iterative_solve(model_data):

# terminate on time limit
if separation_results.time_out or separation_results.subsolver_error:
# report PyROS failure to find violated constraint for subsolver error
if separation_results.subsolver_error:
config.progress_logger.warning(
"PyROS failed to find a constraint violation and "
"will terminate with sub-solver error."
)

pyros_term_cond = (
pyrosTerminationCondition.time_out
if separation_results.time_out
Expand Down
10 changes: 8 additions & 2 deletions pyomo/contrib/pyros/separation_problem_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,8 @@ def get_worst_discrete_separation_solution(
results_list = []

# check if there were any failed scenarios for subsolver_error
# this only needs to be returned once for the subsolver error efficiency
if any(np.isnan(violations_of_ss_ineq_con)) and is_optimized_ss_ineq_con:
# if there are failed scenarios, subsolver error triggers for all ineq
if any(np.isnan(violations_of_ss_ineq_con)):
subsolver_error_flag = True
else:
subsolver_error_flag = False
Expand Down Expand Up @@ -1164,6 +1164,12 @@ def discrete_solve(
for param, coord_val in zip(uncertain_param_vars, scenario):
param.fix(coord_val)

# debug statement for solving square problem for each scenario
# TODO add information on total number of scenarios not added to MP
config.progress_logger.debug(
f"Attempting to solve square problem for discrete scenario {scenario_idx}"
)

# obtain separation problem solution
solve_call_results = solver_call_separation(
separation_data=separation_data,
Expand Down

0 comments on commit 94e9732

Please sign in to comment.