Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Initial CLI Setup for xDEM #626

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

vschaffn
Copy link
Contributor

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:

  1. Added xdem_cli.py:

    • Implements the main CLI functionality.
    • Defines a get_parser() function using argparse 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 to INFO).
      • --version or -v: Displays the version of xDEM.
  2. Added run() Function in __init__.py:

    • This function currently prints "hello world" as a placeholder for the actual DEM comparison functionality that will be added later.
    • It accepts three arguments: reference_dem, dem_to_be_aligned, and verbose.
  3. Setup CLI Entry Points in setup.cfg:

    • Configured the entry point for the xdem CLI command.
    • Running 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:

  • The current CLI implementation does not perform any actual DEM comparison. The next step will be to integrate coregistration functionality into the run() function, which will be handled in [POC] simple CLI nuth and kaab #623.
  • More comprehensive tests and documentation will be added once the core functionality is implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[POC] simple CLI
1 participant