Skip to content

Commit 9ae8512

Browse files
Travvy88Nikita Shevtsov
and
Nikita Shevtsov
authored
TLDR-473 add bbox class from dedoc (#15)
Co-authored-by: Nikita Shevtsov <[email protected]>
1 parent 38733a9 commit 9ae8512

File tree

4 files changed

+10
-20
lines changed

4 files changed

+10
-20
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
=========
33

4+
v0.3.5 (2023-10-02)
5+
-------------------
6+
* Delete `Serializable` class
7+
* Add `__hash__` method to `BBox`
8+
49
v0.3.4 (2023-09-28)
510
-------------------
611
* Add `Serializable` class

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.4
1+
0.3.5

dedocutils/data_structures/bbox.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55

66
import numpy as np
77

8-
from dedocutils.data_structures.serializable import Serializable
9-
108

119
@dataclass
12-
class BBox(Serializable):
10+
class BBox:
1311
"""
1412
Bounding box around some page object, the coordinate system starts from top left corner.
1513
"""
@@ -138,3 +136,6 @@ def to_relative_dict(self, page_width: int, page_height: int) -> dict:
138136
@staticmethod
139137
def from_dict(some_dict: Dict[str, int]) -> "BBox":
140138
return BBox(**some_dict)
139+
140+
def __hash__(self) -> int:
141+
return hash((self.x_top_left, self.y_top_left, self.width, self.height))

dedocutils/data_structures/serializable.py

-16
This file was deleted.

0 commit comments

Comments
 (0)