refactor(cli): extract shared epochs validation helper#163
Open
nk-pavan-official wants to merge 4 commits into
Open
refactor(cli): extract shared epochs validation helper#163nk-pavan-official wants to merge 4 commits into
nk-pavan-official wants to merge 4 commits into
Conversation
…back Fixes robocurve#145. Wraps the two replace(task, epochs=...) call sites in _cmd_run and _cmd_eval_set with a ConfigError catch, matching the existing _resolve_or_exit pattern. eval-set names the failing task.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors the CLI handling for
--epochsby extracting the duplicatedConfigErrorhandling into a shared helper. It also simplifies the error message for invalid epoch values while preserving task attribution in theeval-setpath.Changes
_apply_epochs_or_exit()next to_resolve_or_exit()replace(task, epochs=...)andConfigErrorhandling into the shared helpertry/exceptblocks from_cmd_runand_cmd_eval_setTaskimport underTYPE_CHECKING--epochs must be >= 1, got Neval-setpath (--epochs must be >= 1, got N (task 'NAME'))pytest.raises(..., match=...)assertionsCHANGELOG.mdunder the Unreleased sectionChecklist
pre-commit installdone; hooks pass (or ranpre-commit run --all-files)pytest --cov)ruff check .andruff format --check .passmypypasses (strict)CHANGELOG.mdupdated under "Unreleased"Related
Closes #152