|
@@ -190,6 +190,33 @@ def _section_data_collection(doc, data: Dict[str, Any], tmp: str):
|
|
|
L._para(doc, f"· {label}:{sec.get('error', '未取得有效记录')}。", indent=False, size=10)
|
|
L._para(doc, f"· {label}:{sec.get('error', '未取得有效记录')}。", indent=False, size=10)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+def _render_yaw(doc, data: Dict[str, Any]):
|
|
|
|
|
+ y = data.get("yaw") or {}
|
|
|
|
|
+ L._heading(doc, "4.2 偏航误差分析", 2)
|
|
|
|
|
+ if not y.get("available"):
|
|
|
|
|
+ L._para(
|
|
|
|
|
+ doc,
|
|
|
|
|
+ "偏航误差包括静态偏航误差和动态偏航误差。本期页面无静态偏航误差专项结果,"
|
|
|
|
|
+ "因此不对具体机组偏航误差数值作出判断。",
|
|
|
|
|
+ )
|
|
|
|
|
+ return
|
|
|
|
|
+ L._para(
|
|
|
|
|
+ doc,
|
|
|
|
|
+ f"本期静态偏航误差按机组统计,平均绝对偏航误差 {_num(y.get('avg_abs'), 2, '°')};"
|
|
|
|
|
+ f"绝对偏航误差 >3° 的机组 {y.get('over3', 0)} 台,>5° 的机组 {y.get('over5', 0)} 台。"
|
|
|
|
|
+ f"按模板判据,±3° 以内为可接受范围,超过 3° 建议校正。",
|
|
|
|
|
+ )
|
|
|
|
|
+ rows = []
|
|
|
|
|
+ for t in (y.get("turbines") or [])[:10]:
|
|
|
|
|
+ rows.append([t.get("name"), _num(t.get("avg"), 2), _num(t.get("abs_avg"), 2), _num(t.get("abs_max"), 2)])
|
|
|
|
|
+ if rows:
|
|
|
|
|
+ L._table(doc, ["机组", "平均偏航误差(°)", "平均绝对误差(°)", "最大绝对误差(°)"], rows, [4.0, 3.6, 3.6, 3.6])
|
|
|
|
|
+ if y.get("over3_list"):
|
|
|
|
|
+ L._para(doc, f"绝对偏航误差 >3° 的机组:{'、'.join(y['over3_list'])}。", indent=False, size=10)
|
|
|
|
|
+ if y.get("over5_list"):
|
|
|
|
|
+ L._para(doc, f"绝对偏航误差 >5° 的机组:{'、'.join(y['over5_list'])};建议优先校正,校正后积累 2~3 周数据复核。", indent=False, size=10)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
def _section_energy(doc, data: Dict[str, Any], tmp: str):
|
|
def _section_energy(doc, data: Dict[str, Any], tmp: str):
|
|
|
ov = data.get("overview") or {}
|
|
ov = data.get("overview") or {}
|
|
|
L._heading(doc, "4 能效分析", 1)
|
|
L._heading(doc, "4 能效分析", 1)
|
|
@@ -197,12 +224,7 @@ def _section_energy(doc, data: Dict[str, Any], tmp: str):
|
|
|
L._heading(doc, "4.1 生产指标分析", 2)
|
|
L._heading(doc, "4.1 生产指标分析", 2)
|
|
|
if not ov.get("available"):
|
|
if not ov.get("available"):
|
|
|
L._para(doc, f"分析概览数据不足:{ov.get('error', '未取得分钟级数据')}。")
|
|
L._para(doc, f"分析概览数据不足:{ov.get('error', '未取得分钟级数据')}。")
|
|
|
- L._heading(doc, "4.2 偏航误差分析", 2)
|
|
|
|
|
- L._para(
|
|
|
|
|
- doc,
|
|
|
|
|
- "偏航误差包括静态偏航误差和动态偏航误差。本期报告生成数据中未包含可用的偏航误差专项结果,"
|
|
|
|
|
- "因此不对具体机组偏航误差数值作出判断。建议后续接入偏航误差计算结果或秒级风向/机舱位置数据后补充本节。",
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ _render_yaw(doc, data)
|
|
|
return
|
|
return
|
|
|
L._para(
|
|
L._para(
|
|
|
doc,
|
|
doc,
|
|
@@ -240,12 +262,7 @@ def _section_energy(doc, data: Dict[str, Any], tmp: str):
|
|
|
if rows:
|
|
if rows:
|
|
|
L._table(doc, ["排名", "机组", "发电量(MWh)", "平均风速(m/s)", "记录数"], rows, [2.0, 4.0, 4.5, 4.0, 3.0])
|
|
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._image(doc, L.charts.turbine_generation(ov.get("turbines", []), os.path.join(tmp, "turbine_gen.png")), "图 4-2 机组发电量排名")
|
|
|
- L._heading(doc, "4.2 偏航误差分析", 2)
|
|
|
|
|
- L._para(
|
|
|
|
|
- doc,
|
|
|
|
|
- "偏航误差包括静态偏航误差和动态偏航误差。本期报告生成数据中未包含可用的偏航误差专项结果,"
|
|
|
|
|
- "因此不对具体机组偏航误差数值作出判断。建议后续接入偏航误差计算结果或秒级风向/机舱位置数据后补充本节。",
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ _render_yaw(doc, data)
|
|
|
|
|
|
|
|
|
|
|
|
|
def _section_reliability(doc, data: Dict[str, Any], tmp: str):
|
|
def _section_reliability(doc, data: Dict[str, Any], tmp: str):
|