Fix: Update all old-style imports inside packages to new paths
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 1m7s
CI / test-go-edu-search (push) Successful in 46s
CI / test-python-klausur (push) Failing after 2m32s
CI / test-python-agent-core (push) Successful in 33s
CI / test-nodejs-website (push) Successful in 34s
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 1m7s
CI / test-go-edu-search (push) Successful in 46s
CI / test-python-klausur (push) Failing after 2m32s
CI / test-python-agent-core (push) Successful in 33s
CI / test-nodejs-website (push) Successful in 34s
65 files in klausur-service packages + 3 in backend-lehrer packages had stale imports referencing deleted shim modules. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ The actual endpoints live in:
|
||||
- grid_editor_api_unified.py (build-unified-grid, unified-grid)
|
||||
|
||||
This module re-exports the combined router and key symbols so that
|
||||
existing `from grid_editor_api import router` / `from grid_editor_api import _build_grid_core`
|
||||
existing `from grid.editor.api import router` / `from grid.editor.api import _build_grid_core`
|
||||
continue to work unchanged.
|
||||
"""
|
||||
|
||||
@@ -20,7 +20,7 @@ from .api_box import router as _box_router
|
||||
from .api_unified import router as _unified_router
|
||||
|
||||
# Re-export _build_grid_core so callers that do
|
||||
# `from grid_editor_api import _build_grid_core` keep working.
|
||||
# `from grid.editor.api import _build_grid_core` keep working.
|
||||
from grid.build.core import _build_grid_core # noqa: F401
|
||||
|
||||
# Merge all sub-routers into one combined router
|
||||
|
||||
@@ -7,7 +7,7 @@ import logging
|
||||
from fastapi import APIRouter, HTTPException, Request
|
||||
|
||||
from .filters import _words_in_zone
|
||||
from ocr_pipeline_session_store import (
|
||||
from ocr.pipeline.session_store import (
|
||||
get_session_db,
|
||||
update_session_db,
|
||||
)
|
||||
@@ -76,7 +76,7 @@ async def build_box_grids(session_id: str, request: Request):
|
||||
pass
|
||||
layout_overrides = body.get("overrides", {})
|
||||
|
||||
from cv_box_layout import build_box_zone_grid
|
||||
from ocr.detect.box_layout import build_box_zone_grid
|
||||
|
||||
img_w = grid_data.get("image_width", 0) or word_result.get("image_width", 0)
|
||||
img_h = grid_data.get("image_height", 0) or word_result.get("image_height", 0)
|
||||
@@ -119,7 +119,7 @@ async def build_box_grids(session_id: str, request: Request):
|
||||
|
||||
# Apply SmartSpellChecker to all box cells
|
||||
try:
|
||||
from smart_spell import SmartSpellChecker
|
||||
from ocr.spell.smart_spell import SmartSpellChecker
|
||||
ssc = SmartSpellChecker()
|
||||
for cell in box_grid.get("cells", []):
|
||||
text = cell.get("text", "")
|
||||
|
||||
@@ -7,11 +7,11 @@ import logging
|
||||
from fastapi import APIRouter, HTTPException, Query, Request
|
||||
|
||||
from grid.build.core import _build_grid_core
|
||||
from ocr_pipeline_session_store import (
|
||||
from ocr.pipeline.session_store import (
|
||||
get_session_db,
|
||||
update_session_db,
|
||||
)
|
||||
from ocr_pipeline_common import (
|
||||
from ocr.pipeline.common import (
|
||||
_cache,
|
||||
_load_session_to_cache,
|
||||
_get_cached,
|
||||
@@ -60,7 +60,7 @@ async def build_grid(
|
||||
|
||||
# Save automatic grid snapshot for later comparison with manual corrections
|
||||
# Lazy import to avoid circular dependency with ocr_pipeline_regression
|
||||
from ocr_pipeline_regression import _build_reference_snapshot
|
||||
from ocr.pipeline.regression import _build_reference_snapshot
|
||||
|
||||
wr = session.get("word_result") or {}
|
||||
engine = wr.get("ocr_engine", "")
|
||||
@@ -134,7 +134,7 @@ async def rerun_ocr_and_build_grid(
|
||||
# 2. Scan quality assessment
|
||||
scan_quality_info = {}
|
||||
try:
|
||||
from scan_quality import score_scan_quality
|
||||
from ocr.pipeline.scan_quality import score_scan_quality
|
||||
quality_report = score_scan_quality(ocr_input)
|
||||
scan_quality_info = quality_report.to_dict()
|
||||
actual_min_conf = min_conf if min_conf > 0 else quality_report.recommended_min_conf
|
||||
@@ -146,7 +146,7 @@ async def rerun_ocr_and_build_grid(
|
||||
is_degraded = scan_quality_info.get("is_degraded", False)
|
||||
if enhance and is_degraded:
|
||||
try:
|
||||
from ocr_image_enhance import enhance_for_ocr
|
||||
from ocr.image_enhance import enhance_for_ocr
|
||||
ocr_input = enhance_for_ocr(ocr_input, is_degraded=True)
|
||||
logger.info("rerun-ocr: CLAHE enhancement applied")
|
||||
except Exception as e:
|
||||
@@ -159,8 +159,8 @@ async def rerun_ocr_and_build_grid(
|
||||
# RapidOCR
|
||||
rapid_words = []
|
||||
try:
|
||||
from cv_ocr_engines import ocr_region_rapid
|
||||
from cv_vocab_types import PageRegion
|
||||
from ocr.engines.engines import ocr_region_rapid
|
||||
from ocr.types import PageRegion
|
||||
full_region = PageRegion(type="full_page", x=0, y=0, width=img_w, height=img_h)
|
||||
rapid_words = ocr_region_rapid(ocr_input, full_region) or []
|
||||
except Exception as e:
|
||||
@@ -182,7 +182,7 @@ async def rerun_ocr_and_build_grid(
|
||||
})
|
||||
|
||||
# 5. Merge OCR results
|
||||
from ocr_pipeline_ocr_merge import _split_paddle_multi_words, _merge_paddle_tesseract, _deduplicate_words
|
||||
from ocr.pipeline.ocr_merge import _split_paddle_multi_words, _merge_paddle_tesseract, _deduplicate_words
|
||||
rapid_split = _split_paddle_multi_words(rapid_words) if rapid_words else []
|
||||
if rapid_split or tess_words:
|
||||
merged_words = _merge_paddle_tesseract(rapid_split, tess_words)
|
||||
@@ -207,7 +207,7 @@ async def rerun_ocr_and_build_grid(
|
||||
vision_applied = False
|
||||
if vision_fusion:
|
||||
try:
|
||||
from vision_ocr_fusion import vision_fuse_ocr
|
||||
from ocr.pipeline.vision_fusion import vision_fuse_ocr
|
||||
category = doc_category or session.get("document_category") or "vokabelseite"
|
||||
logger.info(f"rerun-ocr: running Vision-LLM fusion (category={category})")
|
||||
merged_words = await vision_fuse_ocr(ocr_input, merged_words, category)
|
||||
|
||||
@@ -6,7 +6,7 @@ import logging
|
||||
|
||||
from fastapi import APIRouter, HTTPException, Request
|
||||
|
||||
from ocr_pipeline_session_store import (
|
||||
from ocr.pipeline.session_store import (
|
||||
get_session_db,
|
||||
update_session_db,
|
||||
)
|
||||
@@ -35,7 +35,7 @@ async def gutter_repair(session_id: str):
|
||||
detail="No grid data. Run build-grid first.",
|
||||
)
|
||||
|
||||
from cv_gutter_repair import analyse_grid_for_gutter_repair
|
||||
from ocr.gutter.repair import analyse_grid_for_gutter_repair
|
||||
|
||||
image_width = grid_data.get("image_width", 0)
|
||||
result = analyse_grid_for_gutter_repair(grid_data, image_width=image_width)
|
||||
@@ -86,7 +86,7 @@ async def gutter_repair_apply(session_id: str, request: Request):
|
||||
# Allows the user to pick a different correction from the alternatives list
|
||||
text_overrides = body.get("text_overrides", {})
|
||||
|
||||
from cv_gutter_repair import apply_gutter_suggestions
|
||||
from ocr.gutter.repair import apply_gutter_suggestions
|
||||
|
||||
suggestions = gutter_result.get("suggestions", [])
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import logging
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from ocr_pipeline_session_store import (
|
||||
from ocr.pipeline.session_store import (
|
||||
get_session_db,
|
||||
update_session_db,
|
||||
)
|
||||
@@ -32,7 +32,7 @@ async def build_unified_grid_endpoint(session_id: str):
|
||||
if not grid_data:
|
||||
raise HTTPException(status_code=400, detail="No grid data. Run build-grid first.")
|
||||
|
||||
from unified_grid import build_unified_grid
|
||||
from grid.unified import build_unified_grid
|
||||
|
||||
result = build_unified_grid(
|
||||
zones=grid_data.get("zones", []),
|
||||
|
||||
@@ -8,7 +8,7 @@ import logging
|
||||
import re
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
from cv_ocr_engines import _text_has_garbled_ipa
|
||||
from ocr.engines.engines import _text_has_garbled_ipa
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -394,7 +394,7 @@ def _detect_colspan_cells(
|
||||
if len(columns) < 2 or not zone_words or not rows:
|
||||
return cells
|
||||
|
||||
from cv_words_first import _assign_word_to_row
|
||||
from ocr.words_first import _assign_word_to_row
|
||||
|
||||
# Column boundaries (midpoints between adjacent columns)
|
||||
col_boundaries = []
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Grid Editor helper functions — barrel re-export module.
|
||||
|
||||
This file re-exports all public symbols from the split sub-modules
|
||||
so that existing ``from grid_editor_helpers import ...`` statements
|
||||
so that existing ``from grid.editor.helpers import ...`` statements
|
||||
continue to work without changes.
|
||||
|
||||
Sub-modules:
|
||||
@@ -55,4 +55,4 @@ from .zones import ( # noqa: F401
|
||||
)
|
||||
|
||||
# --- Re-export from cv_words_first (used by cv_box_layout.py) ---------------
|
||||
from cv_words_first import _cluster_rows # noqa: F401
|
||||
from ocr.words_first import _cluster_rows # noqa: F401
|
||||
|
||||
@@ -12,8 +12,8 @@ import logging
|
||||
import re
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
from cv_vocab_types import PageZone
|
||||
from cv_words_first import _cluster_rows, _build_cells
|
||||
from ocr.types import PageZone
|
||||
from ocr.words_first import _cluster_rows, _build_cells
|
||||
|
||||
from .columns import (
|
||||
_cluster_columns_by_alignment,
|
||||
|
||||
Reference in New Issue
Block a user