-
Notifications
You must be signed in to change notification settings - Fork 161
Deprecate LP batch solve across Python, server, and docs #915
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
base: release/26.04
Are you sure you want to change the base?
Changes from all commits
3da16b1
e616549
da40023
3372656
0ff95be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -341,20 +341,29 @@ def create_solution(sol): | |
| sol = None | ||
| total_solve_time = None | ||
| if type(LP_data) is list: | ||
| if len(LP_data) == 0: | ||
| raise HTTPException( | ||
| status_code=400, detail="LP_data list cannot be empty" | ||
| ) | ||
| is_batch = True | ||
| data_model_list = [] | ||
| warnings = [] | ||
| warnings = [ | ||
| "LP batch mode is deprecated. Multiple problems are now solved " | ||
| "sequentially. Implement your own parallelism if needed." | ||
| ] | ||
| sol = [] | ||
| total_solve_time = 0.0 | ||
| for i_data in LP_data: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are calling batch LP but have changed it to sequential solves under the hood which is misleading
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Understood. So what is your recommendation? |
||
| i_warnings, data_model = create_data_model(i_data) | ||
| data_model_list.append(data_model) | ||
| warnings.extend(i_warnings) | ||
| cswarnings, solver_settings = create_solver( | ||
| LP_data[0], warmstart_data | ||
| ) | ||
| warnings.extend(cswarnings) | ||
| sol, total_solve_time = linear_programming.BatchSolve( | ||
| data_model_list, solver_settings | ||
| ) | ||
| cswarnings, solver_settings = create_solver( | ||
| i_data, warmstart_data | ||
| ) | ||
| warnings.extend(cswarnings) | ||
| i_sol = linear_programming.Solve( | ||
| data_model, solver_settings=solver_settings | ||
| ) | ||
| total_solve_time += i_sol.get_solve_time() | ||
| sol.append(i_sol) | ||
| else: | ||
| warnings, data_model = create_data_model(LP_data) | ||
| cswarnings, solver_settings = create_solver( | ||
|
|
@@ -386,7 +395,7 @@ def create_solution(sol): | |
| if i_sol.get_error_status() != ErrorStatus.Success: | ||
| res.append( | ||
| { | ||
| "status": i_sol.get_error_status(), | ||
| "status": i_sol.get_error_status().name, | ||
| "solution": i_sol.get_error_message(), | ||
| } | ||
| ) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.