mirror of
https://github.com/p-e-w/heretic.git
synced 2026-07-09 17:28:29 +00:00
fix: correct total trial count when adding additional trials (#385)
When a study is cancelled mid-way and the user selects 'Run additional trials', settings.n_trials was incremented by n_additional_trials, accumulating the original total into the new count. E.g. cancelling 200 trials at 30 and adding 10 gave n_trials=210 instead of 40, causing 'Running trial 31 of 210...' and planning 180 more trials instead of 10. Fix by recalculating n_trials from actual completed trials + additional, so the total reflects the new intended target, not the old one. Fixes #379 Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
b186d6c28e
commit
554a58aa0f
1 changed files with 1 additions and 1 deletions
|
|
@ -802,7 +802,7 @@ def run():
|
|||
if n_additional_trials == 0:
|
||||
continue
|
||||
|
||||
settings.n_trials += n_additional_trials
|
||||
settings.n_trials = len(study.trials) + n_additional_trials
|
||||
study.set_user_attr("settings", settings.model_dump_json())
|
||||
study.set_user_attr("finished", False)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue