Skip to content

[utils] Detach the scores of an empty list of pages in detach_scores - #2214

Merged
felixdittrich92 merged 1 commit into
mindee:mainfrom
RavSinghChandan:detach-scores-empty
Nov 2, 2026
Merged

felixdittrich92 merged 1 commit into
mindee:mainfrom
RavSinghChandan:detach-scores-empty

Conversation

@RavSinghChandan

Copy link
Copy Markdown
Contributor

detach_scores([]) raised ValueError: not enough values to unpack (expected 2, got 0) from zip(*...) on an empty generator. It now returns ([], []), like a list with one page without any box already gives one empty array in each list.

Tests added to test_detach_scores for no pages and for a page without any box; the first one fails on main

@codecov

codecov Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.78%. Comparing base (b690ba9) to head (9cedfd4).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2214   +/-   ##
=======================================
  Coverage   97.78%   97.78%           
=======================================
  Files         170      170           
  Lines       10993    10995    +2     
=======================================
+ Hits        10750    10752    +2     
  Misses        243      243           
Flag Coverage Δ
unittests 97.78% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@felixdittrich92 felixdittrich92 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks 👍

@felixdittrich92 felixdittrich92 self-assigned this Nov 2, 2026
@felixdittrich92 felixdittrich92 added this to the 1.2.0 milestone Nov 2, 2026
@felixdittrich92 felixdittrich92 added type: enhancement Improvement module: utils Related to doctr.utils ext: tests Related to tests folder labels Nov 2, 2026
@felixdittrich92
felixdittrich92 merged commit ce49515 into mindee:main Nov 2, 2026
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext: tests Related to tests folder module: utils Related to doctr.utils type: enhancement Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants