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

summary now accepts solution kwarg, resolves if missing #566

Merged
merged 3 commits into from Aug 6, 2017

Conversation

Projects
None yet
3 participants
@pstjohn
Contributor

pstjohn commented Aug 4, 2017

This is a PR to fix #520 and de-couple the summary methods from connection via reaction.flux to the underlying solver in memory.

model.summary() now accepts a kwarg solution, which if given will re-use the fluxes from a previous solution. Otherwise puts in a call to model.optimize() to get an updated set of fluxes. Speeds don't seem to be affected that much, especially if the solver is able to re-use the solution basis.

@pstjohn pstjohn added the ready label Aug 4, 2017

@codecov-io

This comment has been minimized.

Show comment
Hide comment
@codecov-io

codecov-io Aug 4, 2017

Codecov Report

Merging #566 into devel will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel     #566      +/-   ##
==========================================
- Coverage   71.31%   71.31%   -0.01%     
==========================================
  Files          65       65              
  Lines        8715     8742      +27     
  Branches     1475     1479       +4     
==========================================
+ Hits         6215     6234      +19     
- Misses       2234     2240       +6     
- Partials      266      268       +2
Impacted Files Coverage Δ
cobra/flux_analysis/summary.py 81.63% <100%> (+0.98%) ⬆️
cobra/core/model.py 90.55% <100%> (ø) ⬆️
cobra/core/metabolite.py 71.01% <100%> (ø) ⬆️
cobra/test/test_flux_analysis.py 86.25% <100%> (+0.47%) ⬆️
cobra/util/solver.py 80.8% <0%> (-1.61%) ⬇️
cobra/flux_analysis/sampling.py 89.91% <0%> (-1.36%) ⬇️
cobra/core/reaction.py 85.88% <0%> (-0.48%) ⬇️
cobra/core/solution.py 80.45% <0%> (-0.44%) ⬇️
cobra/test/test_solver_model.py 95.35% <0%> (-0.01%) ⬇️

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 b96d1e7...b39b104. Read the comment docs.

codecov-io commented Aug 4, 2017

Codecov Report

Merging #566 into devel will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel     #566      +/-   ##
==========================================
- Coverage   71.31%   71.31%   -0.01%     
==========================================
  Files          65       65              
  Lines        8715     8742      +27     
  Branches     1475     1479       +4     
==========================================
+ Hits         6215     6234      +19     
- Misses       2234     2240       +6     
- Partials      266      268       +2
Impacted Files Coverage Δ
cobra/flux_analysis/summary.py 81.63% <100%> (+0.98%) ⬆️
cobra/core/model.py 90.55% <100%> (ø) ⬆️
cobra/core/metabolite.py 71.01% <100%> (ø) ⬆️
cobra/test/test_flux_analysis.py 86.25% <100%> (+0.47%) ⬆️
cobra/util/solver.py 80.8% <0%> (-1.61%) ⬇️
cobra/flux_analysis/sampling.py 89.91% <0%> (-1.36%) ⬇️
cobra/core/reaction.py 85.88% <0%> (-0.48%) ⬇️
cobra/core/solution.py 80.45% <0%> (-0.44%) ⬇️
cobra/test/test_solver_model.py 95.35% <0%> (-0.01%) ⬇️

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 b96d1e7...b39b104. Read the comment docs.

@hredestig

Thanks for the fix! I pushed some docs changes and have a couple of points below

Show outdated Hide outdated cobra/core/metabolite.py Outdated
Show outdated Hide outdated cobra/flux_analysis/summary.py Outdated
Show outdated Hide outdated cobra/flux_analysis/summary.py Outdated
Show outdated Hide outdated cobra/flux_analysis/summary.py Outdated
@pstjohn

This comment has been minimized.

Show comment
Hide comment
@pstjohn

pstjohn Aug 5, 2017

Contributor

Awesome, thanks for the comments -- agreed on all those points.

Contributor

pstjohn commented Aug 5, 2017

Awesome, thanks for the comments -- agreed on all those points.

@hredestig

Awesome, thanks for this!

@hredestig hredestig merged commit 2f53ed4 into opencobra:devel Aug 6, 2017

4 checks passed

codecov/patch 100% of diff hit (target 71.31%)
Details
codecov/project Absolute coverage decreased by -<.01% but relative coverage increased by +28.68% compared to b96d1e7
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@hredestig hredestig removed the ready label Aug 6, 2017

@pstjohn pstjohn deleted the pstjohn:fix/summary_solution branch Aug 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment