jump-dev / Convex.jl

A Julia package for disciplined convex programming
https://jump.dev/Convex.jl/stable/
Other
557 stars 119 forks source link

deprecate `+` on constraints #659

Closed ericphanson closed 1 month ago

ericphanson commented 1 month ago

IMO it is kind of goofy, and doesn't match how the rest of Julia works which can make it confusing. There is also not much of a mathematical or translation purpose; I've never seen constraints written that way in a paper.

Also, I've updated the Problem constructors to be less picky about the types, which makes manual construction of the constraints vector (like constraints = []; push!(...) less annoying). I suspect the p = minimize(...); p.constraints += ... thing was partly to make the constructors work.

Lastly, I fixed a small bug: the field constraints was typed as an Array, which meant you could construct a Matrix{Constraint} as the constraints field in Problem, which would then break the new printing code. Here I've typed it as a Vector.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.96%. Comparing base (68e9efc) to head (90016a6). Report is 5 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #659 +/- ## ========================================== + Coverage 97.88% 97.96% +0.07% ========================================== Files 89 89 Lines 5205 5203 -2 ========================================== + Hits 5095 5097 +2 + Misses 110 106 -4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.