"""
配置文件
"""
import os


class Config:
    DEBUG = True
    DATABASE = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'SoilAcidification.db')
    SQLALCHEMY_DATABASE_URI = f'sqlite:///{DATABASE}'
    UPLOAD_FOLDER = 'uploads/datasets'  # 上传excel文件保存路径
    MODEL_SAVE_PATH = 'pkl'             # 模型保存路径
    # Celery配置
    CELERY_BROKER_URL = 'redis://localhost:6379/0'
    CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'
    
    # 定义阈值配置
    DEFAULT_THRESHOLD_REDUCE = 30  # 降酸模型默认阈值
    DEFAULT_THRESHOLD_REFLUX = 30  # 反酸模型默认阈值
    
    # 当前使用的阈值
    THRESHOLD_REDUCE = DEFAULT_THRESHOLD_REDUCE  # 降酸模型当前阈值
    THRESHOLD_REFLUX = DEFAULT_THRESHOLD_REFLUX  # 反酸模型当前阈值
    
    # 定义自动训练默认模型类型配置
    DEFAULT_MODEL_TYPE = 'RandomForest'
