Skip to content

Commit

Permalink
Revert "Moved image attribute from FloatingItem to DocItem"
Browse files Browse the repository at this point in the history
This reverts commit e48cd47.

Signed-off-by: Shubham Gupta <[email protected]>
  • Loading branch information
Shubham Gupta authored and sh-gupta committed Nov 14, 2024
1 parent cbbcec0 commit cbb23b0
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 71 deletions.
2 changes: 1 addition & 1 deletion docling_core/types/doc/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,6 @@ class DocItem(

label: DocItemLabel
prov: List[ProvenanceItem] = []
image: Optional[ImageRef] = None

def get_location_tokens(
self,
Expand Down Expand Up @@ -625,6 +624,7 @@ class FloatingItem(DocItem):
captions: List[RefItem] = []
references: List[RefItem] = []
footnotes: List[RefItem] = []
image: Optional[ImageRef] = None

def caption_text(self, doc: "DoclingDocument") -> str:
"""Computes the caption as a single text."""
Expand Down
88 changes: 22 additions & 66 deletions docs/DoclingDocument.json
Original file line number Diff line number Diff line change
Expand Up @@ -363,17 +363,6 @@
},
"title": "Prov",
"type": "array"
},
"image": {
"anyOf": [
{
"$ref": "#/$defs/ImageRef"
},
{
"type": "null"
}
],
"default": null
}
},
"required": [
Expand Down Expand Up @@ -428,17 +417,6 @@
"title": "Prov",
"type": "array"
},
"image": {
"anyOf": [
{
"$ref": "#/$defs/ImageRef"
},
{
"type": "null"
}
],
"default": null
},
"orig": {
"title": "Orig",
"type": "string"
Expand Down Expand Up @@ -659,17 +637,6 @@
"title": "Prov",
"type": "array"
},
"image": {
"anyOf": [
{
"$ref": "#/$defs/ImageRef"
},
{
"type": "null"
}
],
"default": null
},
"captions": {
"default": [],
"items": {
Expand All @@ -694,6 +661,17 @@
"title": "Footnotes",
"type": "array"
},
"image": {
"anyOf": [
{
"$ref": "#/$defs/ImageRef"
},
{
"type": "null"
}
],
"default": null
},
"annotations": {
"default": [],
"items": {
Expand Down Expand Up @@ -1077,17 +1055,6 @@
"title": "Prov",
"type": "array"
},
"image": {
"anyOf": [
{
"$ref": "#/$defs/ImageRef"
},
{
"type": "null"
}
],
"default": null
},
"orig": {
"title": "Orig",
"type": "string"
Expand Down Expand Up @@ -1269,17 +1236,6 @@
"title": "Prov",
"type": "array"
},
"image": {
"anyOf": [
{
"$ref": "#/$defs/ImageRef"
},
{
"type": "null"
}
],
"default": null
},
"captions": {
"default": [],
"items": {
Expand All @@ -1304,6 +1260,17 @@
"title": "Footnotes",
"type": "array"
},
"image": {
"anyOf": [
{
"$ref": "#/$defs/ImageRef"
},
{
"type": "null"
}
],
"default": null
},
"data": {
"$ref": "#/$defs/TableData"
}
Expand Down Expand Up @@ -1354,17 +1321,6 @@
"title": "Prov",
"type": "array"
},
"image": {
"anyOf": [
{
"$ref": "#/$defs/ImageRef"
},
{
"type": "null"
}
],
"default": null
},
"orig": {
"title": "Orig",
"type": "string"
Expand Down
1 change: 0 additions & 1 deletion test/data/docling_document/unit/KeyValueItem.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
children: []
image: null
label: text
parent: null
prov: []
Expand Down
1 change: 0 additions & 1 deletion test/data/docling_document/unit/ListItem.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
children: []
enumerated: true
image: null
label: list_item
marker: (1)
orig: whatever
Expand Down
1 change: 0 additions & 1 deletion test/data/docling_document/unit/SectionHeaderItem.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
children: []
image: null
label: section_header
level: 2
orig: whatever
Expand Down
1 change: 0 additions & 1 deletion test/data/docling_document/unit/TextItem.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
children: []
image: null
label: text
orig: whatever
parent: null
Expand Down

0 comments on commit cbb23b0

Please sign in to comment.