Hi! I'm not sure if this is the intended behavior, but these lines of code are overwriting and replacing all absolute bounds that were changed prior to saving the model. So for example, if I have a model with the following reactions-
If I were to try changing the bounds of just reaction C with reactionC.bounds = (-2000,4000), the bounds of all reactions upon saving the model (and subsequently reading it from file) would be-
If this is indeed the intended behavior, I'd argue it doesn't make much sense and entirely defeats the purpose of having a global configuration object altogether. It's especially strange considering these changes only kick in when trying to save a model a file. With the way the code is written now, the lower_bound and upper_bound configurations are entirely ignored once 1 reaction is added to the model.
Suggested fix is removing the first if clause like so-
https://github.com/opencobra/cobrapy/blob/4ef4d797d234e6b7153a1eabca0d9bc1d75a7d9e/src/cobra/io/sbml.py#L1281-L1286
Hi! I'm not sure if this is the intended behavior, but these lines of code are overwriting and replacing all absolute bounds that were changed prior to saving the model. So for example, if I have a model with the following reactions-
If I were to try changing the bounds of just reaction C with
reactionC.bounds = (-2000,4000)
, the bounds of all reactions upon saving the model (and subsequently reading it from file) would be-instead of
If this is indeed the intended behavior, I'd argue it doesn't make much sense and entirely defeats the purpose of having a global
configuration
object altogether. It's especially strange considering these changes only kick in when trying to save a model a file. With the way the code is written now, thelower_bound
andupper_bound
configurations are entirely ignored once 1 reaction is added to the model.Suggested fix is removing the first
if
clause like so-