Repository navigation
Drop the ConeFormat step in to_conic for newer cvxpy - #23
Merged
TobiaMarcucci merged 1 commit intoOct 9, 2026
Merged
Conversation
Contributor
Author
|
Hi @TobiaMarcucci, a gentle ping: cvxpy's |
Owner
|
Sorry for the slow response. The fix looks good to me. Thanks very much! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #20.
This applies the change @Transurgeon suggested in #20, written so that it works with both the current cvxpy release and cvxpy master. That way it does not have to wait for cvxpy 1.10.
How we noticed
I was updating a cvxpy PR (cvxpy/cvxpy#3490), and its
test_gcsoptcheck failed intests/test_programs.py::TestConvexProgram::test_to_conic:The PR doesn't touch anything that gcsopt uses, so I looked at the same check on cvxpy master. It has been red on every master commit since cvxpy/cvxpy#3525. The last green run was on e7e704c6 (2026-09-11) and the first red one on 773163eb (#3525, 2026-09-13). Since cvxpy's
gcsopt.ymlworkflow runs this suite on every cvxpy PR, every cvxpy PR currently shows a red check. That is what led me to #20.Change
Since the PR #22 changes,
to_conicbuilds the chain withsolver=cp.SCS. In cvxpy master that chain ends with..., ConeFormat, SCS, sochain.reductions[:-1]keepsConeFormat. The program then comes back in SCS's cone layout instead of the stuffed layout that_constrain_in_conedecodes.The fix drops the solver-facing steps by type. The steps are
Solverand, when it can be imported,ConeFormat. On cvxpy releases withoutConeFormat, this is the same as removing the last reduction, as before.Tests
pytest tests:maintest_to_conic,test_to_conic_multiple_soc), 19 passed