Port remaining standalone-script argparse parsers to click - #39
Merged
Conversation
Converts the eight remaining argparse CLIs in src/ivert/ to click, matching the main ivert CLI (issue #7). These are standalone script entry points and are not wired into the main CLI. Intentional CLI differences: - plot_photon_clouds_v2.py: --dem is now repeatable (--dem a --dem b) instead of space-separated; --h5 without a path uses a flag_value sentinel to keep its search-the-cache behavior. - traverse_directory.py: the directory argument is now optional, defaulting to the current directory as its help text always stated.
Collaborator
Author
|
Codacy is having issues (never succeeding, not related to the code). All other checks passed. |
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
Converts the eight remaining argparse CLIs in
src/ivert/to click, matching the mainivertCLI (issue #7). These are standalone script entry points and are not wired into the main CLI.Ported files:
validate_dem.pyvalidate_dem_collection.pyexport_vector.pyplot_photon_clouds_v2.pyicesat2_database_v2.py(argparse subparsers → click group, still defined inside__main__)utils/split_dem.pyutils/traverse_directory.pyutils/list_photon_tiles.pyNo
argparseimports remain insrc/.Intentional CLI differences
plot_photon_clouds_v2.py:--demis now repeatable (--dem a.tif --dem b.tif) instead of space-separated multi-value, since click options don't supportnargs='+'.--h5without a path keeps its search-the-cache behavior via aflag_valuesentinel.traverse_directory.py: the directory argument is now genuinely optional, defaulting to the current working directory as its help text always claimed (argparse required it despite the declared default).All other flags, defaults, and help text are unchanged.
Notes
utils/list_photon_tiles.pywas already broken before this PR: it importsivert.s3, which was removed with the archive directory (Remove archive directory #37). The port compiles, but the script fails at import — candidate for deletion or repointing in a follow-up.Testing
--helpverified for all eight scripts (including theicesat2_database_v2subcommands)traverse_directory.py's single-dash flags (-t,-depth)