opencobra / cobrapy

COBRApy is a package for constraint-based modeling of metabolic networks.
http://opencobra.github.io/cobrapy/
GNU General Public License v2.0
455 stars 211 forks source link

fix: reaction bounds in _add_cycle_free function #1375

Closed alexpan00 closed 4 months ago

alexpan00 commented 5 months ago

fix: reaction bounds in _add_cycle_free function are assigned according to the description in CycleFreeFlux paper

In _add_cycle_free function, when the original flux is > 0, the ub is forced to be the maximum value between the flux and the reaction ub. It should be the minimum between these 2 values according to the CycleFreeFlux paper. The same happens with the lb of reactions with flux < 0. It has been modified to be the maximum between the original flux and the reaction lb.

alexpan00 commented 4 months ago

I am not really sure about what is causing the error with lint and how to fix that.

Midnighter commented 4 months ago

Hey,

Thank you for the contribution. The lint errors are not related to your lines of code, but there's probably a new version of black causing this. @cdiener the code changes make sense to me, but you're probably most familiar with the code. Can you take a look, please?

alexpan00 commented 4 months ago

Nice, is there anything else I should do?

cdiener commented 4 months ago

Nice, is there anything else I should do?

Sorry for the delay, currently in the middle of a move. But that looks mostly good. Can you resolve the missing checkpoints? New tests are not necessary here but a mention in the release notes would be required.

alexpan00 commented 4 months ago

I just read the notification, thanks for finishing this for me.