opencobra / optlang

optlang - sympy based mathematical programming language
http://optlang.readthedocs.org/
Apache License 2.0
242 stars 51 forks source link

[BUG] Can't load salmonella test model in cobrapy #214

Closed braceal closed 2 years ago

braceal commented 4 years ago

Steps to reproduce:

install optlangs devel branch. git clone https://github.com/opencobra/cobrapy.git Comment out the specific optlang version requirement in cobrapy/setup.py Run pip install -e . from cobrapy/ Open the python interpreter and run: image

This error seems to occur from master and devel branches in cobrapy. It happens when cobrapy reads a pickled model file containing salmonella.

I can get the code to run if I add an if statement checking that "tolerances" is in state, but I'm not sure if this will introduce other bugs. @cdiener @KristianJensen What do y'all think?

image

cdiener commented 4 years ago

Stumbled over a similar thing. I also have a fix for that one in the OSQP branch in the optlang PR if you want to migrate it. However, this may not fix this issue since the salmonella pickle file in cobrapy is outdated for that optlang version. We usually update those in cobrapy with new optlang versions. I would recommend testing with an SBML file or the ecoli model which is read from SBML I think.

braceal commented 4 years ago

I currently have a branch (linked below) with your OSQP solver and the CBC solver where I am testing everything out. After fixing this bug (temporarily with the if statement) things seem to be running again. But I think you are right, it is just a version issue with the pickle file in cobrapy so the the if statement will not be necessary after the update. So far I have been testing with textbook, ecoli and salmonella. Are there any others you recommend, good benchmarks for moma, fva, fba?

https://github.com/braceal/optlang/tree/test/coinor-cbc_osqp

cdiener commented 4 years ago

Those seem okay. I would test a handful of problems from MIPLIB since they have reference solutions. You could even add a few to the test suite.