Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
src/sage/numerical/backends: Remove unnecessary imports, muffle unuse…
Browse files Browse the repository at this point in the history
…d variable warnings
  • Loading branch information
Matthias Koeppe committed Oct 2, 2022
1 parent b9c92ae commit 5b840bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/sage/numerical/backends/cvxpy_backend.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ cdef class CVXPYBackend:
if cvxpy_solver.startswith("SCIPY/"):
cvxpy_solver_args['scipy_options'] = {"method": cvxpy_solver[len("SCIPY/"):]}
cvxpy_solver = "SCIPY"
import cvxpy as cp
cvxpy_solver = getattr(cp, cvxpy_solver)
cvxpy_solver = getattr(cvxpy, cvxpy_solver)
self._cvxpy_solver = cvxpy_solver
self._cvxpy_solver_args = cvxpy_solver_args

Expand Down
2 changes: 1 addition & 1 deletion src/sage/numerical/backends/generic_backend.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1651,6 +1651,7 @@ def default_mip_solver(solver=None):
except ImportError:
raise ValueError("CVXPY is not available. Please refer to the documentation to install it.")
else:
assert CVXPYBackend
default_solver = solver

elif solver.startswith("Cvxpy"):
Expand Down Expand Up @@ -1821,7 +1822,6 @@ cpdef GenericBackend get_solver(constraint_generation = False, solver = None, ba

elif solver.startswith("Cvxpy"):
from sage.numerical.backends.cvxpy_backend import CVXPYBackend
from functools import partial
if solver == "Cvxpy":
return CVXPYBackend()
if solver.startswith("Cvxpy/"):
Expand Down

0 comments on commit 5b840bd

Please sign in to comment.