List pipeline-level config keys in CLI help (closes #320)#381
List pipeline-level config keys in CLI help (closes #320)#381mmcdermott merged 5 commits intodevfrom
Conversation
Both MEDS_transform-pipeline -h and MEDS_transform-stage -h now list the accepted pipeline-level configuration keys (input_dir, output_dir, stages, description, parallelize.*) alongside the argparse/stage usage, so users can discover them without reading runner.py. Closes #320.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #381 +/- ##
==========================================
+ Coverage 98.16% 98.24% +0.07%
==========================================
Files 54 55 +1
Lines 2510 2619 +109
==========================================
+ Hits 2464 2573 +109
Misses 46 46 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Pull request overview
Adds discoverability for pipeline-level YAML/--overrides keys by surfacing a shared “Pipeline-level configuration keys …” table in both the pipeline runner (MEDS_transform-pipeline -h) and the stage dispatcher help.
Changes:
- Define
PIPELINE_CONFIG_KEYSand a formatter helper to render a consistent help-text block. - Append the help block to
MEDS_transform-stagehelp output. - Add the help block as an
argparseepilog forMEDS_transform-pipeline -h.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/MEDS_transforms/runner.py |
Adds an argparse epilog to include the pipeline-level config keys table in -h output. |
src/MEDS_transforms/__main__.py |
Defines the shared keys table + help-block builder and prints it in stage CLI help. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Move PIPELINE_CONFIG_KEYS and the help-block formatter into a new, dependency-light module src/MEDS_transforms/_cli_help.py. runner.main() no longer imports __main__ (and therefore Hydra) just to format its epilog; __main__.print_help_stage imports the helper lazily at call time. - Rename the function to pipeline_keys_help_block (dropped the leading underscore): it's deliberately a cross-module helper. - Extend test_pipeline_help to assert the new block appears, and add test_stage_help_lists_pipeline_keys for the stage dispatcher.
|
All three comments addressed in a64a03d:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Reword the help-block header so it no longer implies --overrides works for MEDS_transform-stage. New phrasing: keys are settable in the pipeline YAML; --overrides is specifically the pipeline runner's flag.
|
Both round-2 comments addressed:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Clarify in the help-block header that dot-notation (e.g. `parallelize.n_workers`) is the Hydra override path accepted by `--overrides`, and that pipeline YAML needs nested mappings (`parallelize:` → `n_workers:`). Keeps the compact table while removing the implication that `parallelize.n_workers:` is valid YAML. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| is written as a nested mapping (``parallelize:`` with ``n_workers:`` indented beneath). | ||
|
|
||
| Examples: | ||
| >>> block = pipeline_keys_help_block() |
There was a problem hiding this comment.
Done in cb256da — doctest now calls print(pipeline_keys_help_block()) and locks in the full rendered block verbatim. Makes the expected output self-documenting and catches any accidental wording/spacing drift.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Replaces the three piecewise assertions (startswith / in / in) with a single `print(pipeline_keys_help_block())` that shows the whole block. Locks in the exact rendered text and doubles as documentation. Also split the header into three wrapped lines so long CLI help renders without line-wrapping midword; this is the form the doctest now shows. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Closes #320. Users had no way to discover pipeline-level keys (
input_dir,output_dir,parallelize.*,stages,description) from-h; they had to greprunner.py.Both CLIs now append the same table after their usage:
The table is defined once in
src/MEDS_transforms/_cli_help.py(PIPELINE_CONFIG_KEYS) and consumed by both entrypoints.runner.main()imports only_cli_helpso the pipeline runner's help path stays free of the Hydra/ConfigStore imports that__main__pulls in.Test plan
MEDS_transform-pipeline -handMEDS_transform-stage -hboth show the new block.test_pipeline_helpextended and newtest_stage_help_lists_pipeline_keysasserts the block.Closes #320
🤖 Generated with Claude Code