Skip to content

[io] Raise a clear error for a line or block whose geometry can not be resolved - #2202

Merged
felixdittrich92 merged 1 commit into
mindee:mainfrom
RavSinghChandan:empty-line-block-geometry
Oct 30, 2026
Merged

felixdittrich92 merged 1 commit into
mindee:mainfrom
RavSinghChandan:empty-line-block-geometry

Conversation

@RavSinghChandan

Copy link
Copy Markdown
Contributor

Block() takes only optional arguments, but without any line or artefact (and no geometry) it raised a bare IndexError: list index out of range while resolving its geometry from its first child. Line([]) did the same, after a Mean of empty slice warning from its objectness score.

Both now raise a ValueError saying that the geometry can not be resolved and should be passed. Elements with children, or with an explicit geometry, are unchanged

@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 Oct 30, 2026
@felixdittrich92 felixdittrich92 added this to the 1.2.0 milestone Oct 30, 2026
@felixdittrich92 felixdittrich92 added type: enhancement Improvement module: io Related to doctr.io ext: tests Related to tests folder labels Oct 30, 2026
@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.77%. Comparing base (2e274dc) to head (44a9df7).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2202      +/-   ##
==========================================
+ Coverage   97.75%   97.77%   +0.01%     
==========================================
  Files         170      170              
  Lines       10974    10979       +5     
==========================================
+ Hits        10728    10735       +7     
+ Misses        246      244       -2     
Flag Coverage Δ
unittests 97.77% <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 merged commit 50c2ef1 into mindee:main Oct 30, 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: io Related to doctr.io type: enhancement Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants