Skip to content

fix: derive the loop-detection threshold from the model bounds - #681

Merged
edkerk merged 1 commit into
develop3from
fix/sampling-loop-threshold
Jul 17, 2026
Merged

fix: derive the loop-detection threshold from the model bounds#681
edkerk merged 1 commit into
develop3from
fix/sampling-loop-threshold

Conversation

@edkerk

@edkerk edkerk commented Jul 17, 2026

Copy link
Copy Markdown
Member

Main improvements in this PR:

  • fix:
    • randomSampling detected loop reactions against a hardcoded ±1000. On a model whose bounds are on any other scale (ecModels, 100-scale bounds) that matched nothing, so no reaction was excluded and loops were sampled while the run reported success. The threshold now comes from the model's own bounds, matching how the bound replacement below it already works. Models bounded at ±1000 behave exactly as before.
  • documentation:
    • Test in tSampling.m with a loop running to a 100 cap.

Instructions on merging this PR:

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

randomSampling excluded loop reactions by testing maxF > 999 | minF < -999,
a hardcoded ±1000 while the bound replacement eight lines below derives its
threshold from the model. On any model whose bounds are on another scale
(ecModels, 100-scale bounds) nothing matched, so no reaction was excluded and
loops were sampled while the function reported success.

The threshold now comes from the model's own bounds, and reactions that reach
an infinite bound are excluded explicitly. Models bounded at ±1000 keep the
previous behaviour exactly.

Adds a test with a loop that runs to a 100 cap, which the old threshold missed
entirely.
@github-actions

Copy link
Copy Markdown

Function test results

241 tests   219 ✅  1m 0s ⏱️
 23 suites   22 💤
  1 files      0 ❌

Results for commit f9334b3.

@edkerk
edkerk merged commit f0b822b into develop3 Jul 17, 2026
4 checks passed
@edkerk
edkerk deleted the fix/sampling-loop-threshold branch July 17, 2026 17:08
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