Procházet zdrojové kódy

fix: remove overview production and fault analysis from report

zhouyang.xie před 6 dny
rodič
revize
89741705a0
2 změnil soubory, kde provedl 3 přidání a 82 odebrání
  1. 1 22
      app/report/criteria.py
  2. 2 60
      app/report/template_builder.py

+ 1 - 22
app/report/criteria.py

@@ -27,28 +27,7 @@ def build_criteria(data: Dict[str, Any]) -> Dict[str, Any]:
     conclusions: List[str] = []
     suggestions: List[str] = []
 
-    # 1 能效/分析概览
-    total_mwh = ov.get("total_mwh")
-    eq_hours = ov.get("equivalent_hours")
-    avg_wind = ov.get("avg_wind")
-    if ov.get("available") and total_mwh is not None:
-        verdict = "低" if (eq_hours is not None and eq_hours < 1500) else "正常"
-        rows.append({
-            "dim": "能效",
-            "criterion": "等效满负荷小时 ≥ 1500 h 为正常,< 1500 h 为低",
-            "threshold": "1500 h",
-            "value": f"{eq_hours} h",
-            "verdict": verdict,
-        })
-        conclusions.append(
-            f"能效判据:等效满负荷小时 {eq_hours} h,{('低于' if verdict == '低' else '达到')} 1500 h 判据,"
-            f"判定为能效{verdict};累计发电量 {total_mwh} MWh,平均风速 {avg_wind} m/s。"
-        )
-    else:
-        rows.append({"dim": "能效", "criterion": "分析概览页面需有对应批次结果", "threshold": "有批次", "value": "无", "verdict": "无法判定"})
-        conclusions.append("能效判据:分析概览页面无覆盖所选时间段的已完成分析批次,暂不判定能效。")
-
-    # 2 健康评估
+    # 健康评估
     avg_score = h.get("avg_score")
     if h.get("available") and avg_score is not None:
         band = _band(avg_score)

+ 2 - 60
app/report/template_builder.py

@@ -44,15 +44,6 @@ def _section_summary(doc, data: Dict[str, Any]):
         "报告围绕风资源与发电性能、设备可靠性、机组潜在风险及功率曲线等维度开展分析,"
         "识别影响机组可靠性和能效的主要问题,并提出针对性的检查与治理建议。",
     )
-    if ov.get("available"):
-        L._para(
-            doc,
-            f"分析期内,风电场累计发电量约 {_num(ov.get('total_mwh'), 2, ' MWh')},"
-            f"等效满负荷小时约 {_num(ov.get('equivalent_hours'), 1, ' h')},"
-            f"平均风速约 {_num(ov.get('avg_wind'), 2, ' m/s')},"
-            f"容量系数约 {_num(ov.get('capacity_factor'), 2, '%')},"
-            f"分钟级数据完整率约 {_num(ov.get('completeness'), 2, '%')}。",
-        )
     h = data.get("health") or {}
     if h.get("available"):
         L._para(
@@ -218,50 +209,8 @@ def _render_yaw(doc, data: Dict[str, Any]):
 
 
 def _section_energy(doc, data: Dict[str, Any], tmp: str):
-    ov = data.get("overview") or {}
     L._heading(doc, "4 能效分析", 1)
-    L._para(doc, "本节主要通过机组生产指标评价和偏航误差分析,对风电场的能效情况进行分析。")
-    L._heading(doc, "4.1 生产指标分析", 2)
-    if not ov.get("available"):
-        L._para(doc, f"分析概览数据不足:{ov.get('error', '未取得分钟级数据')}。")
-        _render_yaw(doc, data)
-        return
-    L._para(
-        doc,
-        "根据机组综合统计,选取累计发电量、等效满负荷小时、平均风速、容量系数和数据完整率"
-        "五项指标,对机组运行状况进行评价。",
-    )
-    L._table(
-        doc,
-        ["指标", "数值", "说明"],
-        [
-            ["累计发电量", _num(ov.get("total_mwh"), 2, " MWh"), "分钟级有功功率积分"],
-            ["等效满负荷小时", _num(ov.get("equivalent_hours"), 1, " h"), "发电量 / 装机容量"],
-            ["平均风速", _num(ov.get("avg_wind"), 2, " m/s"), "按记录数加权"],
-            ["容量系数", _num(ov.get("capacity_factor"), 2, "%"), "发电量 /(容量×时段小时数)"],
-            ["数据完整率", _num(ov.get("completeness"), 2, "%"), "实际记录 / 应有分钟记录"],
-        ],
-        [4.2, 5.0, 7.0],
-    )
-    rows = [
-        [m.get("month"), _num(m.get("gen_mwh"), 2), _num(m.get("avg_wind"), 2), _num(m.get("completeness"), 2, "%")]
-        for m in ov.get("monthly", [])
-    ]
-    if rows:
-        L._table(doc, ["月份", "发电量(MWh)", "平均风速(m/s)", "完整率"], rows, [3.2, 4.2, 4.2, 3.4])
-    L._image(doc, L.charts.monthly_generation(ov.get("monthly", []), os.path.join(tmp, "monthly_gen.png")), "图 4-1 月度发电量与平均风速")
-    L._para(
-        doc,
-        "按机组统计发电量并排序,可快速识别低效机组。机组间差异需结合机位风速、限电、停机与故障记录综合判断,"
-        "不宜仅凭发电量排名直接认定机组性能异常。",
-    )
-    rows = [
-        [t.get("rank"), t.get("name"), _num(t.get("gen_mwh"), 2), _num(t.get("avg_wind"), 2), t.get("points")]
-        for t in ov.get("turbines", [])[:15]
-    ]
-    if rows:
-        L._table(doc, ["排名", "机组", "发电量(MWh)", "平均风速(m/s)", "记录数"], rows, [2.0, 4.0, 4.5, 4.0, 3.0])
-    L._image(doc, L.charts.turbine_generation(ov.get("turbines", []), os.path.join(tmp, "turbine_gen.png")), "图 4-2 机组发电量排名")
+    L._para(doc, "本节通过偏航误差分析,对风电场的能效情况进行分析。")
     _render_yaw(doc, data)
 
 
@@ -402,14 +351,7 @@ def _section_power_curve(doc, data: Dict[str, Any]):
         "功率曲线分析应基于机组风速-功率散点、合同功率曲线和机舱传递函数,对机组发电性能与一致性进行评价。"
         "本期报告生成数据中未包含功率曲线专项数据集,暂不输出功率曲线拟合结果和机组性能结论。",
     )
-    ov = data.get("overview") or {}
-    if ov.get("available"):
-        L._para(
-            doc,
-            f"作为总体参考,本期平均风速约 {_num(ov.get('avg_wind'), 2, ' m/s')},"
-            f"累计发电量约 {_num(ov.get('total_mwh'), 2, ' MWh')};上述数据仅用于运行概况说明,"
-            "不能替代按风速分仓的功率曲线分析。",
-        )
+
 
 
 def _worst_subsystem(t: Dict[str, Any]) -> str: