Skip to content
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

error when trying to update biomass #31

Open
Christiansj83 opened this issue Oct 31, 2018 · 3 comments
Open

error when trying to update biomass #31

Christiansj83 opened this issue Oct 31, 2018 · 3 comments

Comments

@Christiansj83
Copy link


TypeError Traceback (most recent call last)
in ()
----> 1 update.update_biomass(d,model_so)

~/.local/lib/python3.6/site-packages/BOFdat-0.1.7-py3.6.egg/BOFdat/util/update.py in update_biomass(dict_of_coefficients, model)
115 :return: none
116 """
--> 117 biomass = _get_biomass_objective_function(model)
118 find_in_biomass(biomass, dict_of_coefficients)
119

~/.local/lib/python3.6/site-packages/BOFdat-0.1.7-py3.6.egg/BOFdat/util/update.py in _get_biomass_objective_function(model)
62 def _get_biomass_objective_function(model):
63 from cobra.util.solver import linear_reaction_coefficients
---> 64 return linear_reaction_coefficients(model).keys()[0]
65
66 #------------------------------#

TypeError: 'dict_keys' object does not support indexing

@EBosi
Copy link
Contributor

EBosi commented Nov 13, 2018

Hi, I cannot push anything right now, I'm writing how to solve it hoping that someone can commit a fixed code.
The method dict.keys() in python 3 doesn't return a list. You should use list(dict) to get a list of keys, in that it works for both python 2 and 3

@jclachance
Copy link
Owner

Hi Christian,

Are you still struggling with this issue?

Thank you,

JC

@Christiansj83
Copy link
Author

Christiansj83 commented Apr 16, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants