Skip to content

fix: ftINIT with metabolomics data crashes in spdiags - #684

Merged
edkerk merged 1 commit into
develop3from
fix/ftinit-metabolomics-spdiags
Jul 17, 2026
Merged

fix: ftINIT with metabolomics data crashes in spdiags#684
edkerk merged 1 commit into
develop3from
fix/ftinit-metabolomics-spdiags

Conversation

@edkerk

@edkerk edkerk commented Jul 17, 2026

Copy link
Copy Markdown
Member

Main improvements in this PR:

  • fix:
    • ftINIT with metabolomics data errored in ftINITInternalAlg (spdiags) whenever no metabolite reaction was negative-reversible: indexing a scalar with an all-false mask gave a 0-by-0 empty where spdiags needs a 0-by-1 column. The metabolomics path is now usable again.
  • documentation:
    • Corrects the testModel5 expectation in ftINITMetabolomicsRuns; that assertion was unreachable before this fix and asserted a tied-but-not-chosen path. ftINITMetabolomicsRuns now passes under both gurobi and glpk.

Instructions on merging this PR:

  • This PR has develop3 as target branch, and will be resolved with a squash-merge.

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.
@github-actions

Copy link
Copy Markdown

Function test results

288 tests   262 ✅  1m 5s ⏱️
 25 suites   26 💤
  1 files      0 ❌

Results for commit c95c886.

@edkerk
edkerk merged commit 33ee8c4 into develop3 Jul 17, 2026
4 checks passed
@edkerk
edkerk deleted the fix/ftinit-metabolomics-spdiags branch July 17, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant