v26 P2 #5: error-style consistency sweep#47
Merged
lucapinello merged 1 commit intomainfrom Apr 24, 2026
Merged
Conversation
Uniform treatment of user-facing error messages across the CLI and oracle surfaces, closing the last v26 audit item. No behavioural changes — just readability and actionability. CLI (cli/_tokens.py, cli/main.py, cli/_setup_prefetch.py): - All `logger.error(...)` messages now end with a period. - HF-token-rejected errors point at https://huggingface.co/settings/tokens (retry hint). - `chorus remove --oracle`, `chorus genome download`, `chorus setup` errors include the exact follow-up command to try. - `_setup_prefetch.py` return-tuple error strings are capitalised and period-terminated for uniform rendering under main.py's `" - {err}"` loop. Oracles (oracles/*.py, not _source/): - All "Failed to load X model in environment" errors now name the conda env (`chorus-X`) and point at `chorus health --oracle X`. - All "Failed to load X model: {e}" errors end with a period (dropping superfluous `str(e)` since f-string formatting handles __str__ automatically). - ChromBPNet's 6 `ValueError` calls for bad assay/cell/fold combos become `InvalidAssayError`, matching how Enformer / Borzoi / SEI / AlphaGenome handle the same class of user error. Dual `ChorusError, ValueError` inheritance (from v26 P2 #19) means `except ValueError` still works. - AlphaGenome's HF-auth error message ends with a period. Tests: 340 passed, 1 skipped on fast suite. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Closes the final v26 audit item (P2 #5 — inconsistent error style). No behavioural changes; just uniform periods and actionable fix hints across the CLI and oracle surfaces.
CLI
logger.error(...)messages all end with a period; HF-token rejections point athttps://huggingface.co/settings/tokens.chorus remove --oracle,chorus genome downloaderrors name the exact follow-up command._setup_prefetch.pyreturn-tuple strings capitalised + period-terminated so the" - {err}"render underchorus setupreads uniformly.Oracles
"Failed to load X model in environment"→ names the conda env (chorus-X) + points atchorus health --oracle X, across Enformer / Borzoi / ChromBPNet / Sei / LegNet."Failed to load X model: {e}"now ends with a period; dropped redundantstr(e).ValueErrorcalls for bad assay/cell/fold becomeInvalidAssayError(matches Enformer/Borzoi/Sei/AlphaGenome). DualChorusError, ValueErrorinheritance keepsexcept ValueErrorcallers working.Scope: 9 files, +97/−46.
Test plan
pytest tests/ --ignore=tests/test_smoke_predict.py -q→ 340 passed, 1 skippedchorus setup --oracle fakeoracle→ clean period-terminated message with valid listchorus remove --oracle fakeoracle→ "Environment for 'fakeoracle' does not exist. Run `chorus list` to see installed oracles."v26 status after this
All 16 v26 items closed. No outstanding audit findings.
🤖 Generated with Claude Code