-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Raise ContainerAlreadyContains when running optimizations #1421
Comments
Hi, thanks for the report. Can you fill out the rest of the issue template, espcially the environment part so we can check which versions that affects?
|
Also do you have an example with a publically available model? I could not find the one from your bug report to reproduce (eciLC858_v3.0). |
I have already paste the result information of my environment. |
iLC858_v1.1.zip import cobra ecModel_file="./data/iLC858_v1.1.sbml" ####################### |
Hi, It's working fine for me in cobrapy 0.29.1: Python 3.12.8 (main, Dec 13 2024, 13:19:48) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cobra
>>> model = cobra.io.read_sbml_model("iLC858_v1.1.sbml")
>>> model.optimize()
<Solution 2.446 at 0x7fc51e6de7e0>
>>> res = cobra.flux_analysis.pfba(model)
>>> res
<Solution 1207.393 at 0x7fc51d873440>
>>> res.fluxes.bio1
np.float64(2.4464999433818218) Note that the pFBA objective value is from parsimonious objective (sum of absolute fluxes). The individual fluxes are kept in the fluxes attribute. It looks like your cobrapy version is 0.21.0 which is 4 years old. So updating to a more recent version should fix this. |
Thanks cdiener! I'll try upgrading just the cobra and add if I have problems. |
Is there an existing issue for this?
Problem description
我在尝试测试我的模型,但我发现当我在一个ipynb中多次优化时,从第二个开始就会提示ContainerAlreadyContains: Container '<optlang.container.Container object at 0x000002286E0D5DC0>' already contains an object with name 'bio1'.只有重启整个ipynb才可以。
Code sample
Code run:
Traceback:
Environment
Dependency Information
Build Tools Information
Platform Information
Anything else?
No response
The text was updated successfully, but these errors were encountered: