cvxpy icon indicating copy to clipboard operation
cvxpy copied to clipboard

Some examples still use python 2

Open PTNobel opened this issue 2 years ago • 4 comments

Some of the examples still use python 2; it would be nice to replace them with up to date code!

As an example, https://www.cvxpy.org/examples/applications/nba_ranking.html uses print as a statement.

It would be nice to have someone go through examples, test if they run and fix them if they don't. The source code for the examples is mostly in https://github.com/cvxpy/cvxpy/tree/master/doc/source/examples

CC: @phschiele

PTNobel avatar Apr 04 '23 09:04 PTNobel

To make the most out of this effort, we should give some thought to how we want to manage the examples going forward. At the very least, we should mention something like "last updated using CVXPY 1.3.1". Ideally, we would further include some automated testing.

phschiele avatar Apr 04 '23 10:04 phschiele

Now that we have backwards compatibility guarantees, we could just make the examples integration tests we have to pass or justify failing before we can make a release.

PTNobel avatar Apr 04 '23 20:04 PTNobel

That sounds reasonable, provided the examples don’t run too long.

On Tue, Apr 4, 2023 at 4:09 PM Parth Nobel @.***> wrote:

Now that we have backwards compatibility guarantees, we could just make the examples integration tests we have to pass or justify failing before we can make a release.

— Reply to this email directly, view it on GitHub https://github.com/cvxpy/cvxpy/issues/2095#issuecomment-1496536516, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRLIFE5D6QDG4M5PCI46EDW7R5YBANCNFSM6AAAAAAWSNUAEE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

rileyjmurray avatar Apr 04 '23 20:04 rileyjmurray

I would recommend to use only notebooks as examples and integrate them in a jupyterbook. They can then be executed during the compilation of the notebook. Problems can be observed...

tschm avatar Apr 05 '23 19:04 tschm