Skip to content

Conversation

@qued
Copy link
Contributor

@qued qued commented Oct 31, 2025

Added TextSource for tracking source of element text.


Note

Introduces IsExtracted across TextRegion/TextRegions/LayoutElement(s) with refactored auto-initialization, updates slicing/concat/cleaning/equality to carry the flag and sources, and bumps version to 1.1.0.

  • Core models:
    • Add IsExtracted enum; extend TextRegion with is_extracted and from_coords(..., is_extracted=...).
    • Refactor TextRegions.__post_init__ to auto-initialize optional arrays from scalar fields (sourcesources, is_extractedis_extracted_array).
    • Ensure slicing, iteration, and from_list preserve sources and is_extracted_array.
  • Layout elements:
    • Propagate is_extracted through LayoutElement/LayoutElements (to_dict, from_region, from_coords, from_list, concatenate, iter_elements, slice, __eq__).
    • Include is_extracted_array in cleaning utilities (clean_layoutelements*) and concatenation outputs.
  • Tests:
    • Update/expand tests to validate sources and is_extracted propagation, slicing, from_list, and inheritance behavior.
  • Release:
    • Bump version to 1.1.0 and update CHANGELOG.md.

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

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Comment on lines +253 to +255
# NOTE(alan): I would expect if I try to access a single element, it should return a
# TextRegion, not a TextRegions. Currently, you get an error when trying to access a single
# element.
Copy link
Collaborator

Choose a reason for hiding this comment

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

this can be a new ticket/issue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@qued qued merged commit f8bf10d into main Nov 5, 2025
19 checks passed
@qued qued deleted the enhancement/add-text-sources branch November 5, 2025 01:30
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.

3 participants