测试并修复api导入路径错误

This commit is contained in:
2026-02-02 11:09:43 +08:00
parent 807e634318
commit 35abaa1ebb
13 changed files with 211 additions and 250 deletions

View File

@@ -1,7 +1,11 @@
from api_ex.pipeline_health_analyzer import PipelineHealthAnalyzer
"""
tests.unit.test_pipeline_health_analyzer 的 Docstring
"""
def test_pipeline_health_analyzer():
from app.algorithms.api_ex.pipeline_health_analyzer import PipelineHealthAnalyzer
# 初始化分析器,假设模型文件路径为'models/rsf_model.joblib'
analyzer = PipelineHealthAnalyzer()
# 创建示例输入数据9个样本
@@ -51,7 +55,7 @@ def test_pipeline_health_analyzer():
), "每个生存函数应包含x和y属性"
# 可选:测试绘图功能(不显示图表)
analyzer.plot_survival(survival_functions, show_plot=True)
analyzer.plot_survival(survival_functions, show_plot=False)
if __name__ == "__main__":