Parse unregistered config options with warning instead of error#4140
Parse unregistered config options with warning instead of error#4140ahojnnes merged 5 commits intocolmap:maincolmap/colmap:mainfrom StonerLing:feature/allow-read-unregistered-optionsStonerLing/colmap:feature/allow-read-unregistered-optionsCopy head branch name to clipboard
Conversation
Summary of ChangesHello @StonerLing, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the configuration parsing mechanism to gracefully handle unrecognized options in config files. Instead of terminating with an error, the system will now log a warning for any unknown options encountered, while still processing the valid ones. This change improves the robustness and user-friendliness of configuration loading, allowing for more flexible and forward-compatible configuration files. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the configuration parsing to allow unregistered options, logging them as warnings instead of throwing errors. The change is implemented by adding an allow_unregistered parameter to the Read methods in BaseOptionManager and OptionManager, with a default that enables this new, more permissive behavior. The implementation is clean, correctly using boost::program_options to detect and report unrecognized options. A new unit test effectively verifies the functionality. The changes are well-executed and improve the user experience when dealing with configuration files.
Co-authored-by: Johannes Schönberger <jsch@demuc.de>
…hub.com/StonerLing/colmap into feature/allow-read-unregistered-options
Enable allow_unregistered when parsing config files, unregistered options are preserved and logged as warnings instead of errors.
This is necessary because many custom options are defined within COLMAP’s controllers and are not pre-registered in the
OptionManager. Without enabling allow_unregistered, these controller-specific parameters would cause parsing failures.