Document exclusive-end --chunk range in curate_pai_samples.py#87
Open
lonexreb wants to merge 1 commit intoNVlabs:mainfrom
Open
Document exclusive-end --chunk range in curate_pai_samples.py#87lonexreb wants to merge 1 commit intoNVlabs:mainfrom
lonexreb wants to merge 1 commit intoNVlabs:mainfrom
Conversation
scripts/curate_pai_samples.py and scripts/download_pai.py both accept a
"start-end" range form for chunk IDs and both implement it as
range(start, end), i.e. exclusive of `end`. download_pai.py spells this
out in its --chunk-ids help string ("range '0-3' (exclusive end,
downloads 0,1,2)"), but curate_pai_samples.py does not -- so a user
following the in-file example `--chunk 3116-3119 --num-samples 16`
silently gets 3 chunks (3116-3118), not the 4 they probably expected.
This commit:
- Updates the --chunk argparse help to mirror the wording used by
download_pai.py and explicitly call out the exclusive-end behavior
+ cross-references download_pai.py so the two stay in lockstep.
- Adjusts the docstring example from `--chunk 3116-3119` to
`--chunk 3116-3120` and adds an inline note clarifying that 3120 is
excluded. The new example still selects 4 chunks (3116-3119), which
matches the obvious reading of the original example.
Pure docs/UX change. The implementation of `_parse_chunk_ids` is
unchanged.
Signed-off-by: lonexreb <[email protected]>
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.
Problem
scripts/curate_pai_samples.pyandscripts/download_pai.pyboth accept astart-endrange form for chunk IDs and both implement it asrange(start, end)(exclusive ofend).download_pai.pyspells this out in its--chunk-idshelp string:curate_pai_samples.pydoes not, and its docstring example actively misleads:A user following that example reasonably expects 4 chunks (3116, 3117, 3118, 3119) but silently gets 3 (3116, 3117, 3118), because:
Fix
Pure docs / UX change. The
_parse_chunk_idsimplementation is unchanged.--chunkargparse help to mirrordownload_pai.py's wording and explicitly call out the exclusive-end behavior, with a cross-reference so the two stay in lockstep.--chunk 3116-3119to--chunk 3116-3120and add an inline note clarifying that3120is excluded. The new example still selects 4 chunks (3116-3119), matching the obvious reading of the original example.Verification
No code logic touched. New help text correctly describes existing behavior of
_parse_chunk_ids.