tulip-control / polytope

Geometric operations on polytopes of any dimension
https://pypi.org/project/polytope
Other
74 stars 19 forks source link

cvxopt 1.2.0 bug #51

Closed rebeckawinqvist closed 6 years ago

rebeckawinqvist commented 6 years ago

I keep encountering an error when I run Tulip with the latest version of Polytope when using the 1.2.0 version of cvxopt. The error disappears when using cvxopt 1.1.8. This is an example of the output that I receive: rebwin@rebwin-Lenovo-Yoga-2-13:~/tulip-control-master/examples$ python continuous.py GLPK Simplex Optimizer, v4.65 4 rows, 3 columns, 8 non-zeros

It seems like the attribute 'list_poly' is never initialized.

slivingston commented 6 years ago

I reproduced the error locally, and now I am investigating.

slivingston commented 6 years ago

My hypothesis is that version 1.2.0 of cvxopt has a bug in its handling of solver options when provided as an argument to the solver-specific lp function, which is a new feature in version 1.2.0 of cvxopt. I am trying to make a minimal demonstrating example, but meanwhile, a workaround is

diff --git a/polytope/solvers.py b/polytope/solvers.py
index fa9e71a..97e02e0 100644
--- a/polytope/solvers.py
+++ b/polytope/solvers.py
@@ -40,7 +40,7 @@ try:
     installed_solvers.add('glpk')
     # Hide optimizer output
     cvx.solvers.options['show_progress'] = False
-    cvx.solvers.options['glpk'] = dict(msg_lev='GLP_MSG_OFF')
+    cvx.glpk.options['msg_lev'] = 'GLP_MSG_OFF'
 except ImportError:
     logger.warn(
         '`polytope` failed to import `cvxopt.glpk`.')
slivingston commented 6 years ago

I created a bug report at https://github.com/cvxopt/cvxopt/issues/120

slivingston commented 6 years ago

To avoid having to wait on upstream to accept the bug report etc., I recommend that we change our usage as shown above.

@necozay @johnyf thoughts?

necozay commented 6 years ago

I’m fine with the proposed workaround. Thanks.

Necmiye

On Jul 1, 2018, at 11:20 PM, Scott C. Livingston notifications@github.com wrote:

To avoid having to wait on upstream to accept the bug report etc., I recommend that we change our usage as shown above.

@necozay @johnyf thoughts?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.