Skip to content

Fix bug in ToolBaseplate when using an optional image input that is not provided#45

Merged
kostrykin merged 4 commits intomasterfrom
dev/cli_bug
Dec 29, 2025
Merged

Fix bug in ToolBaseplate when using an optional image input that is not provided#45
kostrykin merged 4 commits intomasterfrom
dev/cli_bug

Conversation

@kostrykin
Copy link
Member

No description provided.

@github-actions
Copy link

Test coverage results for 7589e53:

  • 🧩 Unit tests: 75%
  • 📦 Module tests: 54%
  • 🔄 Integration tests: 87%
  • Total coverage: 98%

@kostrykin kostrykin marked this pull request as ready for review December 29, 2025 23:01
@kostrykin kostrykin requested a review from Copilot December 29, 2025 23:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 from None filepaths
  • 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.

@kostrykin kostrykin merged commit 6eb6ed8 into master Dec 29, 2025
16 checks passed
@kostrykin kostrykin deleted the dev/cli_bug branch December 29, 2025 23:09
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.

2 participants