chore: improve CLI error on missing env + clarify debug-dump fallback#27
Merged
Conversation
Two small ergonomics fixes: 1. config/train_selfplay.yaml previously listed ``- env: default`` in defaults, but config/env/default.yaml doesn't exist. Bare invocation crashed with an unhelpful "Could not find 'env/default'" error. Switch to ``- env: ???`` so Hydra emits its own actionable "You must specify 'env', e.g, env=<OPTION>" message instead, and --help works. 2. dump_debug_file in utils/utils.py had a TODO that read like deferred work but the surrounding code already did the right thing — try .pprint() when the obs type supports it, fall back to summary stats for bare arrays. Replace the TODO with an explanatory comment. 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
Two tiny ergonomics fixes bundled (both touch one line each).
1. `config/train_selfplay.yaml`: `env: default` → `env: ???`
`config/train_selfplay.yaml` listed `- env: default` in its defaults block, but `config/env/default.yaml` does not exist. Bare invocation (or `--help`) crashed with:
```
hydra.errors.MissingConfigException: In 'train_selfplay.yaml': Could not find 'env/default'
```
Switching to `- env: ???` triggers Hydra's built-in required-key error instead:
```
You must specify 'env', e.g, env=
Available options:
...
```
`--help` also works now. No change for users who already pass `env=/` or `experiment=` — those override the placeholder.
2. `utils.py:dump_debug_file`: TODO → explanatory comment
The TODO at `utils.py:97` ("handle this somehow better, maybe wrap obs object with pprint") looked like deferred work, but the code around it already did the reasonable thing — try `.pprint(i)` when the obs type exposes it, fall back to summary stats (`shape`/`dtype`/`min`/`max`/`mean`) for bare arrays. Replace the misleading TODO with a comment that explains why the fallback exists, so future readers don't think it's incomplete.
Test plan
🤖 Generated with Claude Code