Skip to content

Commit

Permalink
Prepare for the 1.0.0 release.
Browse files Browse the repository at this point in the history
- revise dependencies
- update readme
- bump version
  • Loading branch information
SergioRAgostinho committed Nov 22, 2019
1 parent 690adb0 commit 521649a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ python setup.py install

### SDP Solver, BLAS and LAPACK

cvxpnpl makes use of [cvxpy](https://www.cvxpy.org/) as its opaque convex solver. However, cvxpy is only an abstraction layer and invokes [SCS](https://github.com/cvxgrp/scs) to obtain a solution to the underlying SDP problem. SCS requires BLAS and LAPACK which can be painful to set up for Windows users. With that in mind, I **really recommend that you install cvxpy through their anaconda channel**, as it will abstract away all of this dependency setup.
cvxpnpl makes use of [SCS](https://github.com/cvxgrp/scs) to obtain a solution to the underlying SDP problem. SCS requires BLAS and LAPACK which can be painful to set up for Windows users. As of version 2.0.0, SCS is permanently linking with LAPACK and BLAS and it is possible that the process is now easier for Windows users as well.


## Examples
Expand Down
8 changes: 6 additions & 2 deletions cvxpnpl.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import warnings
import numpy as np
from scipy.sparse import csc_matrix
import scs

__version__ = "0.3.0"
__version__ = "1.0.0"


def _point_constraints(pts_2d, pts_3d, K):
Expand Down Expand Up @@ -451,8 +452,11 @@ def _solve_relaxation(A, B, eps=1e-9, max_iters=2500, verbose=False):
max_iters=max_iters,
)
# Invoke solver
# results = scs.solve({"A": _A, "b": _b, "c": _vech10(Q, 2)}, {"f": 22, "l": 0, "q": [], "ep": 0, "s": [10]}, verbose=True, eps=eps, max_iters=max_iters)
Z = _vech10_inv(results["x"])
if np.any(np.isnan(Z)):
if verbose:
warnings.warn("The SDP solver did not return a valid solution. Increasing max_iters might solve the issue.")
return [(np.full((3,3), np.nan), np.full(3, np.nan))]
vals, vecs = np.linalg.eigh(Z)

# check for rank
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
numpy
scipy
scs<2.0.0
scs>=2.0.0

0 comments on commit 521649a

Please sign in to comment.