fix: ftINIT with metabolomics data crashes in spdiags - #684
Merged
Conversation
When metData is supplied but no metabolite reaction is negative-reversible, bigMNegRev(metNegRev(negRevRxns)) indexes a scalar with an all-false mask and returns a 0-by-0 empty. The two spdiags calls that follow need a 0-by-1 column, so the whole metabolomics path (prodWeight 5) errored out. Forcing the result to a column fixes it. Corrects the testModel5 expectation in ftINITMetabolomicsRuns, which asserted the R2 path but was never reached before this fix: the a->g->e route via R11/R13 ties R2 on score (both -2) and the solver takes it, deterministically under both gurobi and glpk.
Function test results288 tests 262 ✅ 1m 5s ⏱️ Results for commit c95c886. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Main improvements in this PR:
ftINITwith metabolomics data errored inftINITInternalAlg(spdiags) whenever no metabolite reaction was negative-reversible: indexing a scalar with an all-false mask gave a 0-by-0 empty wherespdiagsneeds a 0-by-1 column. The metabolomics path is now usable again.testModel5expectation inftINITMetabolomicsRuns; that assertion was unreachable before this fix and asserted a tied-but-not-chosen path.ftINITMetabolomicsRunsnow passes under both gurobi and glpk.Instructions on merging this PR:
develop3as target branch, and will be resolved with a squash-merge.