fix(layout): keep unmapped class ids from naming another group's class

CH
16d ago
+30-2

Fixes #523.

LayoutElements.concatenate remapped class ids only for a group with a non-empty element_class_id_map. An unmapped group kept its raw ids, so they picked up another group's name from the rebuilt map.

The issue left two options open: fresh slots or raise. This goes with a fresh slot named None. iter_elements already returns type=None for an unmapped group, and from_list uses None as the name for an untyped element, so a concatenated unmapped group now reads the same as it did before the merge. It also shares the None slot with a from_list group. A group with no elements adds no slot.

Changes: the elif branch in concatenate, one test in test_elements.py, and a 1.6.15 changelog entry with the version bump.

$ uv run --locked --no-sync pytest test_unstructured_inference/test_elements.py -q    # fix reverted, test kept, base 158db67
FAILED ...::test_layoutelements_concatenate_group_without_class_id_map
1 failed, 50 passed, 1 skipped

$ CI=true uv run --locked --no-sync pytest -n 4 -m "not slow" test_unstructured_inference -q
345 passed, 1 skipped    # base 158db67
346 passed, 1 skipped    # this branch

$ make check    # ruff 0.15.10
All checks passed! / 43 files already formatted / version sync would make no changes

@badGarnet, you wrote concatenate; @CyMule, you were last in this file with #522. If you'd rather an unmapped group raise like __eq__ does, I can switch the branch to a ValueError. Which do you want?