Follow-up to #145, which was fixed by #146. Two PRs raced on that issue and each got something right; this issue collects what the merged one left on the table.
Current state after #146: _cmd_run and _cmd_eval_set each carry an inline try/except ConfigError around their replace(task, epochs=...) call, with the ConfigError import repeated mid-function in both.
Wanted:
Small and self-contained; a good second contribution for anyone who worked on #145.
Follow-up to #145, which was fixed by #146. Two PRs raced on that issue and each got something right; this issue collects what the merged one left on the table.
Current state after #146:
_cmd_runand_cmd_eval_seteach carry an inlinetry/except ConfigErroraround theirreplace(task, epochs=...)call, with theConfigErrorimport repeated mid-function in both.Wanted:
_apply_epochs_or_exithelper next to_resolve_or_exit, following the sameraise SystemExit(str(exc)) from excidiom. fix(cli): guided error for --epochs 0/negative instead of raw traceback #148 already had this shape, including movingreplaceinto the helper and importingTaskunderTYPE_CHECKING; it is the reference.--epochs: Epochs count must be >= 1, got 0doubles up. The issue proposed--epochs must be >= 1, got 0. Keep the task attribution in the eval-set path.pytest.raises(..., match=...)exact-message pinning in the epochs tests (again per fix(cli): guided error for --epochs 0/negative instead of raw traceback #148) rather than substring asserts.Small and self-contained; a good second contribution for anyone who worked on #145.