Skip to content

Commit

Permalink
gh-36439: CVXpy 1.4.1, SCS 3.2.3, osqp_python 0.6.3, CVXOPT 1.3.2, Cy…
Browse files Browse the repository at this point in the history
…LP 0.92.2, add `clarabel` solver

    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes #1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
Current CyLP version does not build with Cython 3. So we upgrade to the
just-released CyLP 0.92.x.

Other updates because they are available.

<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes #12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- #12345: short description why this is a dependency
- #34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: #36439
Reported by: Matthias Köppe
Reviewer(s): Dima Pasechnik
  • Loading branch information
Release Manager committed Dec 12, 2023
2 parents ab24b1c + 3bc7ea6 commit 2fd122b
Show file tree
Hide file tree
Showing 22 changed files with 65 additions and 33 deletions.
18 changes: 18 additions & 0 deletions build/pkgs/clarabel/SPKG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
clarabel: Clarabel Conic Interior Point Solver for Rust / Python
================================================================

Description
-----------

Clarabel Conic Interior Point Solver for Rust / Python

License
-------

Apache-2.0

Upstream Contact
----------------

https://pypi.org/project/clarabel/

4 changes: 4 additions & 0 deletions build/pkgs/clarabel/dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
| $(PYTHON_TOOLCHAIN) $(PYTHON)

----------
All lines of this file are ignored except the first.
1 change: 1 addition & 0 deletions build/pkgs/clarabel/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
clarabel
1 change: 1 addition & 0 deletions build/pkgs/clarabel/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
optional
6 changes: 3 additions & 3 deletions build/pkgs/cvxopt/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=cvxopt-VERSION.tar.gz
sha1=7118b2c490a6596a47049c8ae6e15b3568239cb8
md5=d94895acf6f41806b482791174e9d0e7
cksum=2569244181
sha1=f9c3c3fb61e87d27f05b3b66bc10734d5e6284e6
md5=ced06e7d92d8a10c84db94589e7f8162
cksum=2059529268
upstream_url=https://pypi.io/packages/source/c/cvxopt/cvxopt-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/cvxopt/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.0
1.3.2
6 changes: 3 additions & 3 deletions build/pkgs/cvxpy/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=cvxpy-VERSION.tar.gz
sha1=8c87f8f8c2177f917ec2fad7d2b510787ffdf72d
md5=408b0a3140750299207f61de95b4ed6e
cksum=3643150234
sha1=1ca24d9e2ee5add13b33724ab9a11e747fe4ed99
md5=da9fa9feb9634d3562057484b9822889
cksum=1557666297
upstream_url=https://pypi.io/packages/source/c/cvxpy/cvxpy-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/cvxpy/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
numpy scipy glpk cvxopt osqp_python ecos_python scs | $(PYTHON_TOOLCHAIN) $(PYTHON)
numpy scipy glpk cvxopt osqp_python ecos_python scs clarabel | $(PYTHON_TOOLCHAIN) $(PYTHON)

----------
All lines of this file are ignored except the first.
2 changes: 1 addition & 1 deletion build/pkgs/cvxpy/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.0
1.4.1
6 changes: 4 additions & 2 deletions build/pkgs/cvxpy/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cd src
# --no-build-isolation to ignore the numpy version pin in pyproject.toml
sdh_pip_install --no-build-isolation .
# Remove numpy version pin in pyproject.toml
sed -E -i.bak -e "s/numpy[ <>=]+[0-9,.<>= ]+/numpy/;" pyproject.toml
cat pyproject.toml
sdh_pip_install .
6 changes: 3 additions & 3 deletions build/pkgs/cylp/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=cylp-VERSION.tar.gz
sha1=1c2d20933abc48ed2fefc1ae45d8f9492fc2eef2
md5=ac0308a916dac5dd84f831dbc0fba5c5
cksum=1532166313
sha1=22398052ca88123b77e691a0045806a030c9b259
md5=ac00f775af15afcee1b7932144441ec0
cksum=2746382211
upstream_url=https://pypi.io/packages/source/c/cylp/cylp-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/cylp/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.91.5
0.92.2
5 changes: 3 additions & 2 deletions build/pkgs/cylp/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cd src
# use pkg-config to discover coin installation
unset COIN_INSTALL_DIR
# --no-build-isolation to ignore the numpy version pin in pyproject.toml
sdh_pip_install --no-build-isolation .
# Remove the Cython version bound and numpy version pin in pyproject.toml
sed -i.bak -e "/^ *'Cython/s/Cython[^']*/Cython/;/^ *'.*numpy/s/oldest-supported-numpy/numpy/;" pyproject.toml
sdh_pip_install .
5 changes: 3 additions & 2 deletions build/pkgs/ecos_python/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cd src
# --no-build-isolation to ignore the numpy version pin in pyproject.toml
sdh_pip_install --no-build-isolation .
# Remove numpy version pin in pyproject.toml
sed -i.bak -e "s/oldest-supported-numpy/numpy/;" pyproject.toml
sdh_pip_install .
6 changes: 3 additions & 3 deletions build/pkgs/osqp_python/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=osqp-VERSION.tar.gz
sha1=d69d05b87c03aaaf80ac0bb11e1a68746cf8c486
md5=ae46dc55aa4ff7a2009db756f2b61d98
cksum=2780901429
sha1=3358e48aa6d81496665a8b0ee157465ce6cd329a
md5=22ee4f843ca15a98437f053e47d15e3d
cksum=2552259420
upstream_url=https://pypi.io/packages/source/o/osqp/osqp-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/osqp_python/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.2.post8
0.6.3
5 changes: 3 additions & 2 deletions build/pkgs/osqp_python/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cd src
# --no-build-isolation to ignore the numpy version pin in pyproject.toml
sdh_pip_install --no-build-isolation .
# Remove numpy version pin in pyproject.toml
sed -i.bak -e "s/oldest-supported-numpy/numpy/;" pyproject.toml
sdh_pip_install .
6 changes: 3 additions & 3 deletions build/pkgs/scs/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=scs-VERSION.tar.gz
sha1=309a035e5031f7a51c4992d5ad6c9236a406adc2
md5=c984027aea923fa88e2f73c61bc06dd0
cksum=1688898932
sha1=92e4ff21b450c9659f610064eb79e804de9167b4
md5=dc86b5ed0a0a22453bb88feacf31539a
cksum=4083736723
upstream_url=https://pypi.io/packages/source/s/scs/scs-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/scs/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.2
3.2.3
5 changes: 3 additions & 2 deletions build/pkgs/scs/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cd src
# --no-build-isolation to ignore the numpy version pin in pyproject.toml
sdh_pip_install --no-build-isolation .
# Remove numpy version pin in pyproject.toml
sed -E -i.bak -e "s,setuptools[ <>=]+[0-9.]+,setuptools,;s/oldest-supported-numpy/numpy/;" pyproject.toml
sdh_pip_install .
4 changes: 2 additions & 2 deletions src/sage/numerical/backends/cvxopt_backend.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,9 @@ cdef class CVXOPTBackend(GenericBackend):
100.0
sage: N(g.solve(), digits=4)
100.0
sage: N(g.get_values(xg[0]), 2)
sage: N(g.get_values(xg[0]), 2) # abstol 1e-15
0.00
sage: N(g.get_values(xg[1]), 2)
sage: N(g.get_values(xg[1]), 2) # abstol 1e-15
0.00
sage: N(g.get_values(xg[2]), digits=4)
100.0
Expand Down
2 changes: 2 additions & 0 deletions src/sage/numerical/backends/cvxpy_backend.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ cdef class CVXPYBackend:
sage: p.set_objective(b[1] + b[2])
sage: cp = copy(p.get_backend())
sage: cp.solve()
doctest:warning...:
FutureWarning:...
0
sage: cp.get_objective_value() # abs tol 1e-7
6.0
Expand Down

0 comments on commit 2fd122b

Please sign in to comment.