Skip to content

Commit 2030d8e

Browse files
committed
formating
1 parent 67eff80 commit 2030d8e

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

test_unstructured_inference/inference/test_layout_element.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ def test_layoutelement_inheritance_works_correctly():
3636

3737
# Check that both properties are preserved
3838
assert element.source == Source.YOLOX, "LayoutElement should inherit source from TextRegion"
39-
assert (
40-
element.is_extracted
41-
), "LayoutElement should inherit is_extracted from TextRegion"
39+
assert element.is_extracted, "LayoutElement should inherit is_extracted from TextRegion"
4240

4341
# Check that to_dict() works correctly
4442
d = element.to_dict()

test_unstructured_inference/test_elements.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,7 @@ def test_textregions_from_list_collects_sources():
495495
from unstructured_inference.inference.elements import TextRegion
496496

497497
regions = [
498-
TextRegion.from_coords(
499-
0, 0, 10, 10, text="first", source=Source.YOLOX, is_extracted=True
500-
),
498+
TextRegion.from_coords(0, 0, 10, 10, text="first", source=Source.YOLOX, is_extracted=True),
501499
TextRegion.from_coords(
502500
10,
503501
10,
@@ -531,9 +529,7 @@ def test_textregions_iter_elements_preserves_source():
531529
from unstructured_inference.inference.elements import TextRegion
532530

533531
regions = [
534-
TextRegion.from_coords(
535-
0, 0, 10, 10, text="first", source=Source.YOLOX, is_extracted=True
536-
),
532+
TextRegion.from_coords(0, 0, 10, 10, text="first", source=Source.YOLOX, is_extracted=True),
537533
]
538534
text_regions = TextRegions.from_list(regions)
539535

@@ -548,9 +544,7 @@ def test_textregions_slice_preserves_sources():
548544
from unstructured_inference.inference.elements import TextRegion
549545

550546
regions = [
551-
TextRegion.from_coords(
552-
0, 0, 10, 10, text="first", source=Source.YOLOX, is_extracted=True
553-
),
547+
TextRegion.from_coords(0, 0, 10, 10, text="first", source=Source.YOLOX, is_extracted=True),
554548
TextRegion.from_coords(
555549
10,
556550
10,

unstructured_inference/inference/layoutelement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def from_coords(
257257
y2: Union[int, float],
258258
text: Optional[str] = None,
259259
source: Optional[Source] = None,
260-
is_extracted: bool = None,
260+
is_extracted: Optional[bool] = None,
261261
type: Optional[str] = None,
262262
prob: Optional[float] = None,
263263
text_as_html: Optional[str] = None,

0 commit comments

Comments
 (0)