Skip to content

Add --dump-options-json flag for option discovery#2032

Draft
MJohnson459 wants to merge 1 commit into
OpenDroneMap:masterfrom
MJohnson459:nodeodm-options-discovery
Draft

Add --dump-options-json flag for option discovery#2032
MJohnson459 wants to merge 1 commit into
OpenDroneMap:masterfrom
MJohnson459:nodeodm-options-discovery

Conversation

@MJohnson459

Copy link
Copy Markdown
Contributor

Adds a --dump-options-json flag to the ODM entrypoint that prints all available options as a JSON object to stdout and exits, before any parsing or validation that would require a dataset.

This lets API clients (e.g. NodeODM) discover the available processing options through the normal entrypoint without relying on internal knowledge of the ODM codebase e.g. NodeODM odmOptionsToJson.py.

The serialization (options_to_json) introspects the parser's actions and stringifies help, metavar, type, default and choices for each option.

Note this was primarily done by Claude Opus but I tested its output and verified it worked with a modified NodeODM and a the pixi environment.

Adds a --dump-options-json flag to the ODM entrypoint that prints all
available options as a JSON object to stdout and exits, before any
parsing or validation that would require a dataset.

This lets API clients (e.g. NodeODM) discover the available processing
options through the normal entrypoint (run.sh / run.bat / pixi run odm),
instead of importing opendm/config.py directly and monkeypatching
argparse to scrape option metadata. The output format matches what that
scraping currently produces, so it is a drop-in for existing clients.

The serialization (options_to_json) introspects the parser's actions and
stringifies help, metavar, type, default and choices for each option.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant