cobrapy icon indicating copy to clipboard operation
cobrapy copied to clipboard

User defined constraints

Open Hemant27031999 opened this issue 5 years ago • 2 comments

Description of feature

User Defined Constraint: This new feature from fbc-v3 has been added to COBRApy as well as to JSON and other formats also. A user can now add his own constraints to the model. He can do this even more easily by just passing the constraint expression (for eg. "2v1 - 3v2*v2 +0.4 * v3" where v1, v2 and v3 are either reaction ids to define fluxes or some variable) along with the lower and upper bounds.

Tests

Tests for the functionality has been added along with a new example model.

Note:

  • This PR is build upon the metadata pull request, and should be merged only after that.
  • The libsbml library currently doesn't support fbc-v3, so SBML parser has not been added for it.

Hemant27031999 avatar Aug 28 '20 06:08 Hemant27031999

Codecov Report

Merging #996 into devel will decrease coverage by 2.60%. The diff coverage is 71.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel     #996      +/-   ##
==========================================
- Coverage   84.45%   81.84%   -2.61%     
==========================================
  Files          58       65       +7     
  Lines        5036     6220    +1184     
  Branches     1092     1372     +280     
==========================================
+ Hits         4253     5091     +838     
- Misses        508      755     +247     
- Partials      275      374      +99     
Impacted Files Coverage Δ
src/cobra/core/formula.py 25.00% <ø> (ø)
src/cobra/core/metabolite.py 70.65% <ø> (ø)
src/cobra/core/reaction.py 88.02% <ø> (ø)
src/cobra/flux_analysis/deletion.py 93.33% <ø> (ø)
src/cobra/flux_analysis/loopless.py 91.11% <ø> (ø)
src/cobra/flux_analysis/variability.py 92.78% <ø> (ø)
src/cobra/sampling/achr.py 100.00% <ø> (ø)
src/cobra/sampling/optgp.py 96.92% <ø> (ø)
src/cobra/summary/metabolite_summary.py 89.65% <ø> (ø)
src/cobra/summary/model_summary.py 86.66% <ø> (ø)
... and 29 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ad49414...8b2d6dc. Read the comment docs.

codecov-commenter avatar Aug 28 '20 06:08 codecov-commenter

It's almost impossible to tell what this PR adds because it includes all of the changes of the other branch. @matthiaskoenig can you open a branch on this repository, please, for the other work and then make a pull request from this branch targetting that new branch?

Midnighter avatar Aug 28 '20 07:08 Midnighter