Skip to content

Commit 906d6bd

Browse files
committed
Fix
1 parent 1a16cdc commit 906d6bd

File tree

1 file changed

+8
-5
lines changed
  • src/pydvl/value/shapley

1 file changed

+8
-5
lines changed

src/pydvl/value/shapley/gt.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,18 @@ def group_testing_shapley(
179179
:param config: Object configuring parallel computation, with cluster
180180
address, number of cpus, etc.
181181
:param progress: Whether to display progress bars for each job.
182-
:param options: Additional options to pass to cvxpy. E.g. to change the
183-
solver (which defaults to `cvxpy.SCS`) pass `options={
184-
"solver":cp.CVXOPT}`.
182+
:param options: Additional options to pass to `cvxpy.Problem.solve()
183+
<https://www.cvxpy.org/tutorial/advanced/index.html#solve-method-options>`_.
184+
E.g. to change the solver (which defaults to `cvxpy.SCS`) pass
185+
`solver=cvxpy.CVXOPT`.
185186
186187
:return: Object with the data values.
187188
188189
.. versionadded:: 0.4.0
189190
190191
.. versionchanged:: 0.5.0
191-
Changed the solver to cvxpy instead of scipy's linprog. Added options.
192+
Changed the solver to cvxpy instead of scipy's linprog. Added the ability
193+
to pass arbitrary options to it.
192194
"""
193195

194196
n = len(u.data.indices)
@@ -244,7 +246,8 @@ def reducer(
244246
constraints.append(v[j] - v[i] <= epsilon - C[i, j])
245247

246248
problem = cp.Problem(cp.Minimize(0), constraints)
247-
problem.solve(dict(solver=cp.SCS).update(options))
249+
solver = options.pop("solver", cp.SCS)
250+
problem.solve(solver=solver, **options)
248251

249252
if problem.status != "optimal":
250253
log.warning(f"cvxpy returned status {problem.status}")

0 commit comments

Comments
 (0)