Files
tianxuan/analysis/data_loader.py
T
PM-pinou 9f06e40a41 refactor: clean views/clustering.py and split data_loader.py into package
Task A: Replace _run_clustering_pipeline (533L->228L) — remove dead
docstring code, delegate to analysis.services.clustering.

Task B: Split analysis/data_loader.py (746L) into package:
  analysis/data_loader/
    __init__.py  — re-exports all public symbols
    _csv.py      — load_csv_directory, BOM/encoding detection
    _schema.py   — schema merging and validation
    _clean.py    — numeric coercion helper
    _sqlite.py   — save_to_db, load_from_db, load_from_db_lazy, etc.
  Keep old data_loader.py as thin re-export wrapper.

Verified: manage.py check (0 issues), run_pipeline (3 clusters, OK)
2026-07-24 13:52:07 +08:00

19 lines
677 B
Python

"""Thin re-export wrapper — implementation moved to analysis/data_loader/ package.
When both ``analysis/data_loader.py`` and ``analysis/data_loader/`` exist,
Python prefers the package directory, so this file is effectively dead code.
Kept for git history continuity — all real code lives in the package.
If you need to restore the monolithic version, see git history.
"""
from analysis.data_loader._csv import load_csv_directory
from analysis.data_loader._sqlite import (
load_from_db,
load_from_db_lazy,
save_to_db,
drop_sqlite_table,
)
from analysis.data_loader._clean import _coerce_to_float
from analysis.data_loader._sqlite import _dtype_to_sqlite