|
5 | 5 |
|
6 | 6 | import cvxpy as cp |
7 | 7 | import numpy as np |
8 | | -from deprecation import DeprecatedWarning |
9 | 8 | from numpy.typing import NDArray |
10 | 9 |
|
11 | 10 | from pydvl.utils import MapReduceJob, ParallelConfig, Status, Utility |
@@ -57,11 +56,10 @@ def lc_solve_problem( |
57 | 56 | # TODO: remove this before releasing version 0.6.0 |
58 | 57 | if options: |
59 | 58 | warnings.warn( |
60 | | - DeprecatedWarning( |
61 | | - "Passing solver options as kwargs", |
62 | | - deprecated_in="0.5.1", |
63 | | - removed_in="0.6.0", |
64 | | - details="Use solver_options instead.", |
| 59 | + DeprecationWarning( |
| 60 | + "Passing solver options as kwargs was deprecated in " |
| 61 | + "0.5.1, will be removed in 0.6.0. `Use solver_options` " |
| 62 | + "instead." |
65 | 63 | ) |
66 | 64 | ) |
67 | 65 | if solver_options is None: |
@@ -256,10 +254,7 @@ def _solve_least_core_linear_program( |
256 | 254 | e = cp.Variable() |
257 | 255 |
|
258 | 256 | objective = cp.Minimize(e) |
259 | | - constraints = [ |
260 | | - A_eq @ x == b_eq, |
261 | | - (A_lb @ x + e * np.ones(len(A_lb))) >= b_lb, |
262 | | - ] |
| 257 | + constraints = [A_eq @ x == b_eq, (A_lb @ x + e * np.ones(len(A_lb))) >= b_lb] |
263 | 258 |
|
264 | 259 | if non_negative_subsidy: |
265 | 260 | constraints += [e >= 0] |
@@ -333,10 +328,7 @@ def _solve_egalitarian_least_core_quadratic_program( |
333 | 328 | x = cp.Variable(n_variables) |
334 | 329 |
|
335 | 330 | objective = cp.Minimize(cp.norm2(x)) |
336 | | - constraints = [ |
337 | | - A_eq @ x == b_eq, |
338 | | - (A_lb @ x + subsidy * np.ones(len(A_lb))) >= b_lb, |
339 | | - ] |
| 331 | + constraints = [A_eq @ x == b_eq, (A_lb @ x + subsidy * np.ones(len(A_lb))) >= b_lb] |
340 | 332 | problem = cp.Problem(objective, constraints) |
341 | 333 |
|
342 | 334 | try: |
|
0 commit comments