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.
Resolves #622
Description
This PR introduces the initial setup for running xDEM via a command-line interface (CLI). The CLI allows users to pass two DEM files (a reference DEM and a DEM to be aligned) as arguments, and provides additional configuration options like log level and version display. Currently, the command outputs a simple "hello world" message, as the core functionality will be implemented in future iterations (#623).
Key Changes:
Added
xdem_cli.py
:get_parser()
function usingargparse
to handle the following arguments:reference_dem
: Path to the reference DEM file.dem_to_be_aligned
: Path to the DEM that will be aligned.--loglevel
: Option to set the logging level (defaults toINFO
).--version
or-v
: Displays the version of xDEM.Added
run()
Function in__init__.py
:reference_dem
,dem_to_be_aligned
, andverbose
.Setup CLI Entry Points in
setup.cfg
:xdem
CLI command.xdem <path_to_reference_dem> <path_to_dem_to_be_aligned>
in the terminal will now trigger the CLI interface.Testing:
A unit test
test_cli.py
has been added to verify that the CLI can be executed and that it produces the expected output.Documentation
Updated the quickstart guide (
doc/source/quickstart.md
) to include a section on using the new CLI, including the available options and an example command.Future Work:
run()
function, which will be handled in [POC] simple CLI nuth and kaab #623.