Skip to content

DEoptimIterative(convergence =): stopping rule as an argument, outside the chunk cache keys - #55

Merged
eliotmcintire merged 1 commit into
developmentfrom
feat/deoptim-convergence
Oct 16, 2026
Merged

eliotmcintire merged 1 commit into
developmentfrom
feat/deoptim-convergence

Conversation

@eliotmcintire

Copy link
Copy Markdown
Contributor

Fits sometimes stop while the population is still improving. The stopping rule can now be set per call, and a fit that stopped early can be continued with a stricter rule, picking up from the generations it already ran instead of starting over.

Affects: nothing changes unless convergence is given; the defaults (300, 350, 1, 0.1) and the clusters.deoptim* options behave as before.

Technical details

The stop rule was read from options inside DEoptimIterative() (R/DEoptim.R:450, .deoptimPopulationConverged() defaults at R/DEoptim.R:557), so a caller could not put it in its own cache key. DEoptimIterative(convergence = list(window, minGenerations, se, sdChange)) takes any of the four; the rest come from the options, then from defaults now defined once in .optionDefaults. The exported deoptimConvergence() returns the full list. convergence is a formal of DEoptimIterative() and is not passed to the per-chunk Cache() call, so no chunk key contains it.

Test (tests/testthat/test-DEoptimConvergenceArg.R, fails on development): argument > option > default; and a fit that stopped at 5 generations (minGenerations = 4) rerun with minGenerations = 8 on the same cache path replays the 5 cached chunks, makes 32 objective calls (4 new generations x NP 8) and ends at 9 generations. Full tests: 0 failures on the branch and on development; R CMD check --no-manual: 0 errors, 0 warnings, 3 notes (unchanged).

🤖 Generated with Claude Code

https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6

…outside the per-chunk cache keys

deoptimConvergence() resolves argument > clusters.deoptim* option > default; the
defaults are defined once in .optionDefaults.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
@eliotmcintire eliotmcintire added enhancement New feature or request backwards compatible Existing code and results keep working unchanged labels Oct 16, 2026
@codecov

codecov Bot commented Oct 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.01%. Comparing base (218b465) to head (9dc6046).

Additional details and impacted files
@@               Coverage Diff               @@
##           development      #55      +/-   ##
===============================================
+ Coverage        74.53%   75.01%   +0.47%     
===============================================
  Files               22       22              
  Lines             2101     2113      +12     
===============================================
+ Hits              1566     1585      +19     
+ Misses             535      528       -7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eliotmcintire
eliotmcintire merged commit 2c6c1da into development Oct 16, 2026
14 checks passed
@eliotmcintire
eliotmcintire deleted the feat/deoptim-convergence branch October 16, 2026 22:37
eliotmcintire added a commit that referenced this pull request Oct 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards compatible Existing code and results keep working unchanged enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant