This repository was archived by the owner on Mar 6, 2026. It is now read-only.
fix: Add handling for documents missing all layout elements. - #161
Merged
Conversation
- Bounding boxes will show up as 0,0,0,0 - Fixes #160
dizcology
reviewed
Sep 5, 2023
dizcology
reviewed
Sep 5, 2023
| return 0, 0, 0, 0 | ||
|
|
||
| top, left = vertices[0] | ||
| bottom, right = vertices[2] |
Contributor
There was a problem hiding this comment.
Before this PR, this vertices[0] could result in an IndexError, also it is still unclear what happens to vertices[1]. I would suggest eventually restructure and improve the code here (not blocking this PR). We also seem to be assuming that bounding_poly is always a bounding box (as opposed to more general polygons) - do we know that the service always returns boxes?
Additionally, if the utility function needs only bounding_poly.normalized_vertices, it should receive just a list of normalized vertices and not the whole bounding_poly.
dizcology
approved these changes
Sep 5, 2023
galdawave
approved these changes
Sep 5, 2023
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
0,0,0,0Fixes #160 🦕