opencobra/swiglpk

How to change the level of message in swiglpk ?

vacary opened this issue · 1 comments

I am not able to access to lev_msg() through the Swig interface. Is there a special tricks ?
Regards

Not sure what lev_msg() is? Can you point it out in the glpk documentation? Or do you mean the msg_lev field in the struct returned by glp_smcp() (which you'd pass on to glp_simplex)?

Can you try

from swiglpk import glp_smcp
smcp = glp_smcp()
print smcp.msg_lev
# set it to verbose
smcp.msg_lev = 3
print smcp.msg_lev

and let me know if this is what you're trying to do?

BTW, maybe you'd like to try the glpk interface of the python optimization language that I am developing (which uses swiglpk)?
https://github.com/biosustain/optlang/
https://github.com/biosustain/optlang/blob/devel/optlang/glpk_interface.py

There you would just do

from optlang.glpk_interface import Model
model = Model()
model.configuration.verbosity = 3

It doesn't support all the low-level stuff of glpk but 90% of what is needed in most cases.