indico_toolkit 7.2.0__tar.gz → 7.2.1__tar.gz

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.
Files changed (76) hide show
  1. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/PKG-INFO +1 -1
  2. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/__init__.py +1 -1
  3. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/etloutput/etloutput.py +8 -12
  4. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/etloutput/range.py +2 -2
  5. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/etloutput/table.py +20 -6
  6. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/polling/autoreview.py +1 -1
  7. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/pyproject.toml +1 -1
  8. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/LICENSE +0 -0
  9. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/README.md +0 -0
  10. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/association/__init__.py +0 -0
  11. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/association/association.py +0 -0
  12. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/association/extracted_tokens.py +0 -0
  13. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/association/line_items.py +0 -0
  14. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/association/positioning.py +0 -0
  15. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/association/splitting.py +0 -0
  16. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/auto_review/__init__.py +0 -0
  17. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/auto_review/auto_review_functions.py +0 -0
  18. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/auto_review/auto_reviewer.py +0 -0
  19. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/client.py +0 -0
  20. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/errors.py +0 -0
  21. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/etloutput/__init__.py +0 -0
  22. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/etloutput/cell.py +0 -0
  23. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/etloutput/errors.py +0 -0
  24. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/etloutput/token.py +0 -0
  25. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/indico_wrapper/__init__.py +0 -0
  26. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/indico_wrapper/download.py +0 -0
  27. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/indico_wrapper/indico_wrapper.py +0 -0
  28. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/indico_wrapper/modelop.py +0 -0
  29. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/indico_wrapper/workflow.py +0 -0
  30. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/metrics/__init__.py +0 -0
  31. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/metrics/compare_ground_truth.py +0 -0
  32. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/metrics/compare_models.py +0 -0
  33. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/metrics/metrics.py +0 -0
  34. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/metrics/plotting.py +0 -0
  35. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/ocr/__init__.py +0 -0
  36. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/ocr/ondoc_object.py +0 -0
  37. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/ocr/standard_object.py +0 -0
  38. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/pipelines/__init__.py +0 -0
  39. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/pipelines/file_processing.py +0 -0
  40. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/polling/__init__.py +0 -0
  41. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/polling/downstream.py +0 -0
  42. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/polling/queries.py +0 -0
  43. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/py.typed +0 -0
  44. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/__init__.py +0 -0
  45. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/document.py +0 -0
  46. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/errors.py +0 -0
  47. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/normalization.py +0 -0
  48. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/predictionlist.py +0 -0
  49. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/predictions/__init__.py +0 -0
  50. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/predictions/box.py +0 -0
  51. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/predictions/citation.py +0 -0
  52. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/predictions/classification.py +0 -0
  53. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/predictions/documentextraction.py +0 -0
  54. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/predictions/extraction.py +0 -0
  55. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/predictions/formextraction.py +0 -0
  56. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/predictions/group.py +0 -0
  57. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/predictions/prediction.py +0 -0
  58. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/predictions/span.py +0 -0
  59. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/predictions/summarization.py +0 -0
  60. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/predictions/unbundling.py +0 -0
  61. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/result.py +0 -0
  62. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/review.py +0 -0
  63. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/task.py +0 -0
  64. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/results/utils.py +0 -0
  65. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/retry.py +0 -0
  66. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/snapshots/__init__.py +0 -0
  67. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/snapshots/snapshot.py +0 -0
  68. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/structure/__init__.py +0 -0
  69. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/structure/create_structure.py +0 -0
  70. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/structure/queries.py +0 -0
  71. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/structure/utils.py +0 -0
  72. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/types/__init__.py +0 -0
  73. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/types/classification.py +0 -0
  74. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/types/extractions.py +0 -0
  75. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/types/predictions.py +0 -0
  76. {indico_toolkit-7.2.0 → indico_toolkit-7.2.1}/indico_toolkit/types/workflow_object.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: indico-toolkit
3
- Version: 7.2.0
3
+ Version: 7.2.1
4
4
  Summary: Classes, functions, and abstractions for Indico IPA
5
5
  License: MIT
6
6
  Author: Indico Solutions Engineering
@@ -21,4 +21,4 @@ __all__ = (
21
21
  "ToolkitStaggeredLoopError",
22
22
  "ToolkitStatusError",
23
23
  )
24
- __version__ = "7.2.0"
24
+ __version__ = "7.2.1"
@@ -96,15 +96,11 @@ class EtlOutput:
96
96
  else:
97
97
  raise TableCellNotFoundError(f"no table contains {token!r}")
98
98
 
99
- try:
100
- row_index = bisect_left(
101
- table.rows, token_vmid, key=lambda row: row[0].box.bottom
102
- )
103
- row = table.rows[row_index]
104
-
105
- cell_index = bisect_left(row, token_hmid, key=attrgetter("box.right"))
106
- cell = row[cell_index]
107
- except (IndexError, ValueError) as error:
108
- raise TableCellNotFoundError(f"no cell contains {token!r}") from error
109
-
110
- return table, cell
99
+ for cell in table.cells:
100
+ if (
101
+ (cell.box.top <= token_vmid <= cell.box.bottom) and
102
+ (cell.box.left <= token_hmid <= cell.box.right)
103
+ ): # fmt: skip
104
+ return table, cell
105
+ else:
106
+ raise TableCellNotFoundError(f"no cell contains {token!r}")
@@ -21,8 +21,8 @@ class Range:
21
21
  columns = get(cell, list, "columns")
22
22
 
23
23
  return Range(
24
- row=rows[0],
25
- column=columns[0],
24
+ row=min(rows),
25
+ column=min(columns),
26
26
  rowspan=len(rows),
27
27
  columnspan=len(columns),
28
28
  rows=tuple(rows),
@@ -20,6 +20,8 @@ class Table:
20
20
  """
21
21
  page = get(table, int, "page_num")
22
22
  get(table, dict, "position")["page_num"] = page
23
+ row_count = get(table, int, "num_rows")
24
+ column_count = get(table, int, "num_columns")
23
25
 
24
26
  cells = tuple(
25
27
  sorted(
@@ -27,14 +29,26 @@ class Table:
27
29
  key=attrgetter("range"),
28
30
  )
29
31
  )
32
+ cells_by_row_col = {
33
+ (row, column): cell
34
+ for cell in cells
35
+ for row in cell.range.rows
36
+ for column in cell.range.columns
37
+ }
30
38
  rows = tuple(
31
- tuple(cell for cell in cells if row in cell.range.rows)
32
- for row in range(get(table, int, "num_rows"))
33
- )
39
+ tuple(
40
+ cells_by_row_col[row, column]
41
+ for column in range(column_count)
42
+ )
43
+ for row in range(row_count)
44
+ ) # fmt: skip
34
45
  columns = tuple(
35
- tuple(cell for cell in cells if column in cell.range.columns)
36
- for column in range(get(table, int, "num_columns"))
37
- )
46
+ tuple(
47
+ cells_by_row_col[row, column]
48
+ for row in range(row_count)
49
+ )
50
+ for column in range(column_count)
51
+ ) # fmt: skip
38
52
 
39
53
  return Table(
40
54
  box=Box.from_dict(get(table, dict, "position")),
@@ -30,7 +30,7 @@ logger = logging.getLogger(__name__)
30
30
 
31
31
  @dataclass
32
32
  class AutoReviewed:
33
- changes: "dict[str, Any] | list[dict[str, Any]]"
33
+ changes: "list[dict[str, Any]]"
34
34
  reject: bool = False
35
35
  stp: bool = False
36
36
 
@@ -12,7 +12,7 @@ authors = [
12
12
  readme = "README.md"
13
13
  urls = { source = "https://github.com/IndicoDataSolutions/Indico-Solutions-Toolkit" }
14
14
  requires-python = ">=3.10"
15
- version = "7.2.0"
15
+ version = "7.2.1"
16
16
  dependencies = ["indico-client (>=6.14.0,<7.0.0)"]
17
17
 
18
18
  [project.optional-dependencies]
File without changes
File without changes