Cleanup: Delete ALL 242 shims, update ALL consumer imports
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 41s
CI / test-go-edu-search (push) Successful in 32s
CI / test-python-klausur (push) Failing after 2m41s
CI / test-python-agent-core (push) Successful in 34s
CI / test-nodejs-website (push) Successful in 39s

klausur-service: 183 shims deleted, 26 test files + 8 source files updated
backend-lehrer: 59 shims deleted, main.py + 8 source files updated

All imports now use the new package paths directly.
Zero shims remaining in the entire codebase.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-04-26 00:11:33 +02:00
parent d093a4d388
commit 5f2ed44654
288 changed files with 214 additions and 1182 deletions

View File

@@ -14,15 +14,15 @@ sys.path.insert(0, '/app')
import cv2
import numpy as np
import pytest
from cv_vocab_types import PageZone, DetectedBox
from grid_editor_api import (
from ocr.types import PageZone, DetectedBox
from grid.editor.api import (
_merge_content_zones_across_boxes,
_filter_border_ghosts,
_detect_header_rows,
_detect_heading_rows_by_color,
_detect_heading_rows_by_single_cell,
)
from cv_ocr_engines import _text_has_garbled_ipa, fix_ipa_continuation_cell
from ocr.engines.engines import _text_has_garbled_ipa, fix_ipa_continuation_cell
# ---------------------------------------------------------------------------
@@ -818,7 +818,7 @@ class TestSlashIpaConversion:
def _run_step_5h(self, text: str) -> str:
"""Run the Step 5h regex logic on a single text string."""
import re
from cv_ocr_engines import _lookup_ipa
from ocr.engines.engines import _lookup_ipa
_SLASH_IPA_RE = re.compile(
r'(\b[a-zA-Z]+[²³¹]?)\s*'
@@ -926,7 +926,7 @@ class TestRedFalsePositiveSuppression:
def test_low_saturation_red_classified_as_black(self):
"""Black text with slight warm scanner tint (sat ~85) → black, not red."""
import numpy as np
from cv_color_detect import detect_word_colors
from ocr.detect.color_detect import detect_word_colors
# Create a 40x20 image with dark gray pixels (slight warm tint)
# HSV: hue=5 (red range), sat=85 (above 55 threshold but below 90), val=40
@@ -941,7 +941,7 @@ class TestRedFalsePositiveSuppression:
def test_high_saturation_red_classified_as_red(self):
"""Genuinely red text (sat=150) → red."""
import numpy as np
from cv_color_detect import detect_word_colors
from ocr.detect.color_detect import detect_word_colors
# White background with red text region
# Background: white (H=0, S=0, V=255)
@@ -984,7 +984,7 @@ class TestBlueBulletFilter:
zone = {"zone_index": 0, "cells": [cell], "rows": [], "columns": []}
# Run the bullet filter logic inline
from grid_editor_api import _build_grid_core
from grid.editor.api import _build_grid_core
# Instead, test the logic directly
wbs = cell["word_boxes"]
to_remove = set()
@@ -1057,7 +1057,7 @@ class TestWordBoxReadingOrder:
def test_single_line_sorted_by_left(self):
"""Words on same Y line sorted by X (left) position."""
from cv_ocr_engines import _group_words_into_lines
from ocr.engines.engines import _group_words_into_lines
wbs = [
{"text": "up", "left": 376, "top": 264, "width": 22, "height": 19},
{"text": "tie", "left": 284, "top": 264, "width": 23, "height": 14},
@@ -1069,7 +1069,7 @@ class TestWordBoxReadingOrder:
def test_two_lines_preserves_line_order(self):
"""Words on two Y lines: first line first, then second line."""
from cv_ocr_engines import _group_words_into_lines
from ocr.engines.engines import _group_words_into_lines
wbs = [
{"text": "b)", "left": 100, "top": 290, "width": 20, "height": 15},
{"text": "cat", "left": 50, "top": 264, "width": 30, "height": 15},
@@ -1082,7 +1082,7 @@ class TestWordBoxReadingOrder:
def test_already_sorted_unchanged(self):
"""Already-sorted word_boxes stay in same order."""
from cv_ocr_engines import _group_words_into_lines
from ocr.engines.engines import _group_words_into_lines
wbs = [
{"text": "tie", "left": 284, "top": 264, "width": 23, "height": 14},
{"text": "sb/sth", "left": 309, "top": 264, "width": 57, "height": 20},