Skip to content

Conversation

@henrykironde
Copy link
Contributor

@henrykironde henrykironde commented Dec 2, 2025

Note

Guard PIL imports against AttributeError/TypeError in main/model modules and enable informational Codecov patch status.

  • Imports/Runtime robustness:
    • src/deepforest/main.py: Remove OmegaConf import; wrap PIL.Image import in try/except to tolerate AttributeError/TypeError.
    • src/deepforest/model.py: Wrap PIL.Image import in try/except to tolerate AttributeError/TypeError.
  • CI:
    • codecov.yml: Enable coverage.status.patch.default.informational: true.

Written by Cursor Bugbot for commit f63344b. This will update automatically on new commits. Configure here.

@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

❌ Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.39%. Comparing base (c10846a) to head (6ebafd8).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/deepforest/main.py 60.00% 2 Missing ⚠️
src/deepforest/model.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1218      +/-   ##
==========================================
- Coverage   87.47%   87.39%   -0.08%     
==========================================
  Files          20       20              
  Lines        2586     2611      +25     
==========================================
+ Hits         2262     2282      +20     
- Misses        324      329       +5     
Flag Coverage Δ
unittests 87.39% <60.00%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on January 2

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

try:
from PIL import Image
except (AttributeError, TypeError):
pass
Copy link

Choose a reason for hiding this comment

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

Bug: Silent PIL import failure leaves Image undefined

The try-except block silently passes when importing Image from PIL fails with AttributeError or TypeError, leaving Image undefined. When predict_image() in main.py or val_dataset_confusion() in model.py later calls Image.open(), a confusing NameError will be raised instead of a clear import error message. If the intent is to handle specific PIL import issues, the code needs to either provide a fallback definition for Image or re-raise a more descriptive error.

Additional Locations (1)

Fix in Cursor Fix in Web

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