from .Initial_Alg_Gen_Tool import get_var_from_file

# 生成 _base_ 变量，传入算法配置、数据集配置、schedule配置
def generate_base_config(alg_file_name, dataset_file_name, schedule_file_name):
    if alg_file_name != None:
        base_config =[
            f'../_base_/models/{alg_file_name}.py',
            f'../_base_/datasets/{dataset_file_name}.py', #换成自己定义的数据集
            f'../_base_/default_runtime.py',
            f'../_base_/schedules/{schedule_file_name}.py'
        ]
    else:
        base_config =[
            f'../_base_/datasets/{dataset_file_name}.py', #换成自己定义的数据集
            f'../_base_/default_runtime.py',
            f'../_base_/schedules/{schedule_file_name}.py'
        ]

    return base_config

if __name__ == '__main__':
    # 示例用法
    alg_file_name = 'ann_r50-d8' # 算法根文件
    dataset_file_name = 'my_dataset_model' # 数据文件
    schedule_file_name = 'schedule_4k_check_400' # schedule文件

    _base_ = generate_base_config(alg_file_name=alg_file_name, dataset_file_name=dataset_file_name, schedule_file_name=schedule_file_name)
    print(_base_)
