Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR makes the --pipeline argument optional when using the GUI, enforces validation otherwise, and ensures GUI settings propagate through the CLI parser into the configuration.
- parser.py: Removed
required=Truefor--pipeline, added validation when--guiis not set, and mapped GUI outputs into individual args (extractor,matcher) instead ofconfig_file. - gui.py: Extracted argument-assembly logic into a private helper and updated
on_submit/get_valuesto use it, mapping GUI selection to extractor/matcher configs. - config.py: Added a GUI branch to pick extractor/matcher directly from parsed GUI args and adjusted validation logic accordingly.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/deep_image_matching/parser.py | Make --pipeline optional under GUI, add CLI validation, map new GUI args |
| src/deep_image_matching/gui.py | Refactor argument assembly into __get_args, update submission methods |
| src/deep_image_matching/config.py | Branch config parsing on GUI mode for extractor/matcher selection |
Comments suppressed due to low confidence (3)
src/deep_image_matching/gui.py:72
- [nitpick] Rename
__get_argsto_get_args(single underscore) to avoid Python name-mangling and align with common private method conventions.
def __get_args(self):
src/deep_image_matching/parser.py:148
- Add a unit test for this validation branch to verify that an error is raised when
--guiis false and no--pipelineis provided.
if not args.gui and args.pipeline is None:
src/deep_image_matching/parser.py:153
- Remove the redundant
args.gui = Trueassignment—args.guiis already set by the CLI parser.
args.gui = True
| Args: | ||
| args (dict): The input arguments provided by the user. | ||
| """ | ||
| is_gui = args["gui"] is not None and args["gui"] |
There was a problem hiding this comment.
Simplify the GUI flag check to is_gui = args["gui"] since args["gui"] is always defined.
Suggested change
| is_gui = args["gui"] is not None and args["gui"] | |
| is_gui = args["gui"] |
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.
currently, the pipeline argument is required although using the gui it is expected to be set there. furthermore, the settings set in the gui are not fully considered in the executed pipeline.
this pull request removes the required flag from the argument but adds also validation to ensure it is correctly set. furthermore, it adapts the parsed arguments to correctly use the parameters set in the gui.
let me know if you wanna fix this differently.