table2rules 0.6.1__tar.gz → 0.6.2__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 (32) hide show
  1. {table2rules-0.6.1/src/table2rules.egg-info → table2rules-0.6.2}/PKG-INFO +1 -1
  2. {table2rules-0.6.1 → table2rules-0.6.2}/pyproject.toml +1 -1
  3. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules/maze_pathfinder.py +16 -1
  4. {table2rules-0.6.1 → table2rules-0.6.2/src/table2rules.egg-info}/PKG-INFO +1 -1
  5. {table2rules-0.6.1 → table2rules-0.6.2}/LICENSE +0 -0
  6. {table2rules-0.6.1 → table2rules-0.6.2}/README.md +0 -0
  7. {table2rules-0.6.1 → table2rules-0.6.2}/setup.cfg +0 -0
  8. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules/__init__.py +0 -0
  9. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules/__main__.py +0 -0
  10. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules/_core.py +0 -0
  11. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules/cleanup.py +0 -0
  12. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules/errors.py +0 -0
  13. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules/exporters/__init__.py +0 -0
  14. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules/exporters/base.py +0 -0
  15. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules/exporters/rules.py +0 -0
  16. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules/grid_parser.py +0 -0
  17. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules/models.py +0 -0
  18. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules/py.typed +0 -0
  19. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules/quality_gate.py +0 -0
  20. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules/report.py +0 -0
  21. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules/simple_repair.py +0 -0
  22. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules/spans.py +0 -0
  23. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules.egg-info/SOURCES.txt +0 -0
  24. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules.egg-info/dependency_links.txt +0 -0
  25. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules.egg-info/entry_points.txt +0 -0
  26. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules.egg-info/requires.txt +0 -0
  27. {table2rules-0.6.1 → table2rules-0.6.2}/src/table2rules.egg-info/top_level.txt +0 -0
  28. {table2rules-0.6.1 → table2rules-0.6.2}/tests/test_correctness_oracle.py +0 -0
  29. {table2rules-0.6.1 → table2rules-0.6.2}/tests/test_determinism.py +0 -0
  30. {table2rules-0.6.1 → table2rules-0.6.2}/tests/test_public_api.py +0 -0
  31. {table2rules-0.6.1 → table2rules-0.6.2}/tests/test_regression_golds.py +0 -0
  32. {table2rules-0.6.1 → table2rules-0.6.2}/tests/test_robustness_mutations.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: table2rules
3
- Version: 0.6.1
3
+ Version: 0.6.2
4
4
  Summary: Convert HTML tables to flat, LLM-friendly rules using spatial pathfinding.
5
5
  Author: PebbleRoad Pte Ltd
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "table2rules"
7
- version = "0.6.1"
7
+ version = "0.6.2"
8
8
  description = "Convert HTML tables to flat, LLM-friendly rules using spatial pathfinding."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -151,8 +151,18 @@ def find_headers_for_cell(
151
151
  # Bands are ordered topmost-first (origin row ascending) and prepended, so
152
152
  # the row path reads outer-band > inner-group > row-labels, mirroring the
153
153
  # multi-level column path.
154
+ #
155
+ # A *label-only* band (one carrying an explicit ``rowgroup_extent_end``)
156
+ # groups a ROW RANGE, so it must reach every value row in its extent
157
+ # regardless of which column its single label cell sits in — e.g. a numbered
158
+ # schedule whose group header is in the line-number/stub column while the
159
+ # sub-rows leave that column empty and carry their identity in a different
160
+ # column. Such bands are therefore scanned across ALL columns. Full-width and
161
+ # source ``scope="rowgroup"`` bands keep the column-restricted scan (own
162
+ # column + row-label columns) so unrelated stub dividers don't cross-attach.
163
+ own_cols = {col, *row_header_columns}
154
164
  bands: List[Tuple[int, str]] = [] # (origin_row, text)
155
- for scan_col in [col, *row_header_columns]:
165
+ for scan_col in range(len(grid[0])):
156
166
  for r in range(row - 1, -1, -1):
157
167
  cell = grid[r][scan_col]
158
168
  if not cell or not cell.get("text", "").strip():
@@ -167,6 +177,11 @@ def find_headers_for_cell(
167
177
  else:
168
178
  origin = (r, scan_col)
169
179
  origin_cell = cell
180
+ # A column-restricted band (no stored extent) is only honored from
181
+ # the value's own column or a row-label column; a label-only band
182
+ # (stored extent) is honored from any column.
183
+ if origin_cell.get("rowgroup_extent_end") is None and scan_col not in own_cols:
184
+ continue
170
185
  if origin in seen_origins:
171
186
  continue
172
187
  origin_row, origin_col = origin
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: table2rules
3
- Version: 0.6.1
3
+ Version: 0.6.2
4
4
  Summary: Convert HTML tables to flat, LLM-friendly rules using spatial pathfinding.
5
5
  Author: PebbleRoad Pte Ltd
6
6
  License-Expression: MIT
File without changes
File without changes
File without changes