fix: auto-fix code issues (cron)
- 修复隐式 Optional 类型注解 (RUF013) - 修复不必要的赋值后返回 (RET504) - 优化列表推导式 (PERF401) - 修复未使用的参数 (ARG002) - 清理重复导入 - 优化异常处理
This commit is contained in:
@@ -181,14 +181,16 @@ async def test_predictions(trend_model_id: str, anomaly_model_id: str) -> None:
|
||||
# 2. 趋势预测
|
||||
print("2. 趋势预测...")
|
||||
trend_result = await manager.predict(
|
||||
trend_model_id, {"historical_values": [10, 12, 15, 14, 18, 20, 22]},
|
||||
trend_model_id,
|
||||
{"historical_values": [10, 12, 15, 14, 18, 20, 22]},
|
||||
)
|
||||
print(f" 预测结果: {trend_result.prediction_data}")
|
||||
|
||||
# 3. 异常检测
|
||||
print("3. 异常检测...")
|
||||
anomaly_result = await manager.predict(
|
||||
anomaly_model_id, {"value": 50, "historical_values": [10, 12, 11, 13, 12, 14, 13]},
|
||||
anomaly_model_id,
|
||||
{"value": 50, "historical_values": [10, 12, 11, 13, 12, 14, 13]},
|
||||
)
|
||||
print(f" 检测结果: {anomaly_result.prediction_data}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user