docling-core 2.41.0__py3-none-any.whl → 2.42.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of docling-core might be problematic. Click here for more details.

@@ -35,10 +35,10 @@ from pydantic import (
35
35
  )
36
36
 
37
37
  from docling_core.types.doc.base import (
38
- _CTX_COORD_PREC,
39
38
  BoundingBox,
40
39
  CoordOrigin,
41
- _serialize_precision,
40
+ PydanticSerCtxKey,
41
+ round_pydantic_float,
42
42
  )
43
43
  from docling_core.types.doc.document import ImageRef
44
44
 
@@ -119,7 +119,7 @@ class BoundingRectangle(BaseModel):
119
119
 
120
120
  @field_serializer("r_x0", "r_y0", "r_x1", "r_y1", "r_x2", "r_y2", "r_x3", "r_y3")
121
121
  def _serialize(self, value: float, info: FieldSerializationInfo) -> float:
122
- return _serialize_precision(value, info, _CTX_COORD_PREC)
122
+ return round_pydantic_float(value, info.context, PydanticSerCtxKey.COORD_PREC)
123
123
 
124
124
  @property
125
125
  def width(self) -> float:
@@ -290,6 +290,10 @@ class TextCell(ColorMixin, OrderedElement):
290
290
  confidence: float = 1.0
291
291
  from_ocr: bool
292
292
 
293
+ @field_serializer("confidence")
294
+ def _serialize(self, value: float, info: FieldSerializationInfo) -> float:
295
+ return round_pydantic_float(value, info.context, PydanticSerCtxKey.CONFID_PREC)
296
+
293
297
  def to_bounding_box(self) -> BoundingBox:
294
298
  """Convert the cell rectangle to a BoundingBox."""
295
299
  return self.rect.to_bounding_box()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: docling-core
3
- Version: 2.41.0
3
+ Version: 2.42.0
4
4
  Summary: A python library to define and validate data types in Docling.
5
5
  Author-email: Cesar Berrospi Ramis <ceb@zurich.ibm.com>, Panos Vagenas <pva@zurich.ibm.com>, Michele Dolfi <dol@zurich.ibm.com>, Christoph Auer <cau@zurich.ibm.com>, Peter Staar <taa@zurich.ibm.com>
6
6
  Maintainer-email: Panos Vagenas <pva@zurich.ibm.com>, Michele Dolfi <dol@zurich.ibm.com>, Christoph Auer <cau@zurich.ibm.com>, Peter Staar <taa@zurich.ibm.com>, Cesar Berrospi Ramis <ceb@zurich.ibm.com>
@@ -40,10 +40,10 @@ docling_core/transforms/visualizer/table_visualizer.py,sha256=iJPjk-XQSSCH3oujcj
40
40
  docling_core/types/__init__.py,sha256=MVRSgsk5focwGyAplh_TRR3dEecIXpd98g_u3zZ5HXo,260
41
41
  docling_core/types/base.py,sha256=PusJskRVL19y-hq0BgXr5e8--QEqSqLnFNJ8UbOqW88,8318
42
42
  docling_core/types/doc/__init__.py,sha256=8hOhm5W9mArf3zwgfoMxDs1pHizhLFSAZlLu1tPBBRk,1641
43
- docling_core/types/doc/base.py,sha256=u8sFLA29x8QphvLzgy2wAKu3HXyM2GODfBXqEwQMrTY,15527
44
- docling_core/types/doc/document.py,sha256=YAJIIdT2fBnlp8ASWvzJTjUbil_ZCwuBBSjmiwhZ1KI,158630
43
+ docling_core/types/doc/base.py,sha256=i98y4IF250adR-8BSS374K90fwfwG-vBfWh14tLC5Cs,15906
44
+ docling_core/types/doc/document.py,sha256=ShxqS9A9N1KhVS73C7eoTBo0WgCI-TRbjwW8frhFEns,199154
45
45
  docling_core/types/doc/labels.py,sha256=-W1-LW6z0J9F9ExJqR0Wd1WeqWTaY3Unm-j1UkQGlC4,7330
46
- docling_core/types/doc/page.py,sha256=CH9DY3LLgnUdhRuJBWfnkDkPBdRzz9yi4el1LsxJSME,41651
46
+ docling_core/types/doc/page.py,sha256=35h1xdtCM3-AaN8Dim9jDseZIiw-3GxpB-ofF-H2rQQ,41878
47
47
  docling_core/types/doc/tokens.py,sha256=z22l9J81_sg9CYMvOuLmPuLsNT7h_s7wao2UT89DvI8,9278
48
48
  docling_core/types/doc/utils.py,sha256=JpAi7x9DHksFlIj_gRJPcSZOHa8AHvVPEO_K9aSnw4c,2608
49
49
  docling_core/types/gen/__init__.py,sha256=C6TuCfvpSnSL5XDOFMcYHUY2-i08vvfOGRcdu6Af0pI,124
@@ -74,9 +74,9 @@ docling_core/utils/generate_jsonschema.py,sha256=uNX1O5XnjyB5nA66XqZXTt3YbGuR2ty
74
74
  docling_core/utils/legacy.py,sha256=5lghO48OEcV9V51tRnH3YSKgLtdqhr-Q5C_OcJZ8TOs,24392
75
75
  docling_core/utils/validate.py,sha256=aQ11UbFyl8iD_N7yTTZmm_VVeXz8KcCyn3GLXgkfYRM,2049
76
76
  docling_core/utils/validators.py,sha256=azcrndLzhNkTWnbFSu9shJ5D3j_znnLrIFA5R8hzmGU,2798
77
- docling_core-2.41.0.dist-info/licenses/LICENSE,sha256=2M9-6EoQ1sxFztTOkXGAtwUDJvnWaAHdB9BYWVwGkIw,1087
78
- docling_core-2.41.0.dist-info/METADATA,sha256=CqsXanxB2dd22G__-Ws0XdLDzkf9uwMGmx98V2h9f3k,6453
79
- docling_core-2.41.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
80
- docling_core-2.41.0.dist-info/entry_points.txt,sha256=ER4zROQWkFMHIrY-oqY5E4HeCcCIg8dLkNztYGxdb7c,59
81
- docling_core-2.41.0.dist-info/top_level.txt,sha256=O-tcXpGiurlud-1ZxMq1b-OmrfAVA4sajcgWU32RtfA,13
82
- docling_core-2.41.0.dist-info/RECORD,,
77
+ docling_core-2.42.0.dist-info/licenses/LICENSE,sha256=2M9-6EoQ1sxFztTOkXGAtwUDJvnWaAHdB9BYWVwGkIw,1087
78
+ docling_core-2.42.0.dist-info/METADATA,sha256=R7dpA43x-3YVrXztgu3_Pt87SWRrjaeBW0jXPndawdw,6453
79
+ docling_core-2.42.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
80
+ docling_core-2.42.0.dist-info/entry_points.txt,sha256=ER4zROQWkFMHIrY-oqY5E4HeCcCIg8dLkNztYGxdb7c,59
81
+ docling_core-2.42.0.dist-info/top_level.txt,sha256=O-tcXpGiurlud-1ZxMq1b-OmrfAVA4sajcgWU32RtfA,13
82
+ docling_core-2.42.0.dist-info/RECORD,,