Skip to content

Commit

Permalink
Retrieve reverse_variable after one has been potentially added
Browse files Browse the repository at this point in the history
  • Loading branch information
meono committed Sep 17, 2014
1 parent dfc85f5 commit 3df7477
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cameo/flux_analysis/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ def _flux_variability_analysis(model, reactions=None):
model.objective = original_objective
df = pandas.DataFrame.from_dict(fva_sol, orient='index')
lb_higher_ub = df[df.lower_bound > df.upper_bound]
assert ((lb_higher_ub.lower_bound - lb_higher_ub.upper_bound) < 1e-6).all() # Assert that these cases really only numerical artifacts
try: # this is an alternative solution to what I did above with flags
assert ((lb_higher_ub.lower_bound - lb_higher_ub.upper_bound) < 1e-6).all() # Assert that these cases really only numerical artifacts
except AssertionError as e:
print zip(model.reactions, (lb_higher_ub.lower_bound - lb_higher_ub.upper_bound) < 1e-6)
df.lower_bound[lb_higher_ub.index] = df.upper_bound[lb_higher_ub.index]
return df

Expand Down

0 comments on commit 3df7477

Please sign in to comment.