jump-dev / Convex.jl

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

`solve!` returns the problem #658

Closed ericphanson closed 1 month ago

ericphanson commented 1 month ago

Currently it returns nothing. I think this is nicer since then you get the solution summary printed after you do solve!, along with a summary of the problem. It's possible this can help users notice issues if they weren't looking at the problem, but did solve! in the REPL and noticed the output. In addition, looking at some of the examples like https://jump.dev/Convex.jl/dev/examples/mixed_integer/n_queens/, this would add more details to the example without needing a separate example block to show the problem first.

There is currently an explicit test that we return nothing, so I traced back the origin of that test to see why (in case there's some particular reason we need to return nothing). I believe it was added in https://github.com/jump-dev/Convex.jl/pull/62 originally, and was carried forward in various formats since then (eventually in its own testset once we added the problem depot since handle_problem there doesn't necessarily call solve!). Looking at that PR, I don't think returning nothing was necessarily important for anything, it was just testing what we were currently doing then.

codecov[bot] commented 1 month ago

Codecov Report

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

Project coverage is 97.88%. Comparing base (f8a56c4) to head (d448390).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #658 +/- ## ======================================= Coverage 97.88% 97.88% ======================================= Files 89 89 Lines 5205 5205 ======================================= Hits 5095 5095 Misses 110 110 ```

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