Skip to content

fix: report ftINIT gap-fill failures instead of reporting success - #678

Merged
edkerk merged 1 commit into
develop3from
fix/ftinit-gapfill-reporting
Jul 17, 2026
Merged

fix: report ftINIT gap-fill failures instead of reporting success#678
edkerk merged 1 commit into
develop3from
fix/ftinit-gapfill-reporting

Conversation

@edkerk

@edkerk edkerk commented Jul 17, 2026

Copy link
Copy Markdown
Member

Main improvements in this PR:

  • fix:
    • ftINITFillGapsForAllTasks reported a task that cannot be gap-filled as Added 0 reaction(s), the same line an already-feasible task prints. It now warns and returns which tasks failed.
    • ftINITFillGapsMILP reported a solve that hit its time limit as optimal, because checkSolution's optimality flag was discarded. This also left the documented time-out exit code unreachable.
    • ftINIT reported an exception from the MILP as MIPGap: Inf, i.e. as a time-limit miss, hiding the real error. Both catch blocks now surface the message.
  • features:
    • ftINITFillGapsForAllTasks returns failedTasks.
  • documentation:
    • Test for an unfillable task in tINIT.m.

Instructions on merging this PR:

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

Three ways a failed gap-fill was reported as a success:

ftINITFillGapsMILP discarded checkSolution's isOptimal, so a solve that hit
its time limit returned exitFlag=1 and its suboptimal gap-fill was reported as
optimal. That also left the documented -2 (time out) unreachable, which in turn
made the exitFlag==-2 branch in ftINITFillGapsForAllTasks dead code.

ftINITFillGapsForAllTasks never checked for exitFlag==-1, so a task no set of
reference reactions can fulfil fell through and printed "Added 0 reaction(s)" —
the same line an already-feasible task prints. It now warns and records the
task in a new failedTasks output.

Both catch blocks discarded the exception. ftINITFillGapsForAllTasks now
includes e.message in its warning, and ftINIT no longer reports a throw as
"Failed to find good enough solution within the time frame. MIPGap: Inf",
which sends users to raise TimeLimit for what is usually a solver or input
problem.

Adds a test for an unfillable task.
@github-actions

Copy link
Copy Markdown

Function test results

241 tests   218 ✅  57s ⏱️
 23 suites   23 💤
  1 files      0 ❌

Results for commit d238bf4.

@edkerk
edkerk merged commit a04342d into develop3 Jul 17, 2026
4 checks passed
@edkerk
edkerk deleted the fix/ftinit-gapfill-reporting branch July 17, 2026 17:06
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