Fix bug in ToolBaseplate when using an optional image input that is not provided#45
Merged
Fix bug in ToolBaseplate when using an optional image input that is not provided#45
ToolBaseplate when using an optional image input that is not provided#45Conversation
Merged
8 tasks
|
Test coverage results for 7589e53:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in ToolBaseplate where using an optional image input (via add_input_image(key, required=False)) that is not provided would cause an error when attempting to read a None filepath. The fix filters out None filepaths before attempting to load images.
- Adds conditional filtering in
parse_args()to skip loading images fromNonefilepaths - Updates the test CLI script to handle optional inputs by checking if they exist before accessing them
- Adds comprehensive integration test for the optional input scenario
- Bumps patch version from 0.7.1 to 0.7.2
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| giatools/cli.py | Adds if filepath is not None filter when creating input_images dictionary to prevent attempting to read from None filepaths |
| tests/integration/test__cli.py | Updates _threshold function to accept optional second input, modifies CLI script to conditionally use optional input, renames existing test for clarity, and adds new test case for single input scenario |
| giatools/version.py | Increments patch version from 1 to 2 (0.7.1 → 0.7.2) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.