|
@@ -81,7 +81,11 @@ def read_minute(table: str, start: date, end: date) -> pd.DataFrame:
|
|
|
def export_zyx(df: pd.DataFrame, out_root: Path, period: str) -> Path:
|
|
def export_zyx(df: pd.DataFrame, out_root: Path, period: str) -> Path:
|
|
|
# hdkg-run 的 HDKG_T5_SCADA_ROOT 指向 intake-root/<场码>/<期>;
|
|
# hdkg-run 的 HDKG_T5_SCADA_ROOT 指向 intake-root/<场码>/<期>;
|
|
|
# 该目录下再放 T5 的相对层级。
|
|
# 该目录下再放 T5 的相对层级。
|
|
|
- root = out_root / "WOF091200030" / period / SITES["WOF091200030"]["t5"]
|
|
|
|
|
|
|
+ intake = out_root / "WOF091200030" / period
|
|
|
|
|
+ root = intake / SITES["WOF091200030"]["t5"]
|
|
|
|
|
+ # 平台没有原始 266 列秒级;建立空目录让读数层按“无数据”处理,
|
|
|
|
|
+ # 避免 UnmountedSource 把内部路径写进页面原因(产物只标未评分,不伪造)。
|
|
|
|
|
+ (intake / "张崾先_华电二期/华电张崾先风电场二期/scada_sec").mkdir(parents=True, exist_ok=True)
|
|
|
target = root / SITES["WOF091200030"]["minute_dir"]
|
|
target = root / SITES["WOF091200030"]["minute_dir"]
|
|
|
target.mkdir(parents=True, exist_ok=True)
|
|
target.mkdir(parents=True, exist_ok=True)
|
|
|
# StdCsvExportSource 按 YYYY/MM/DD/<台号>/<台号>_YYYYMMDD.csv 找文件
|
|
# StdCsvExportSource 按 YYYY/MM/DD/<台号>/<台号>_YYYYMMDD.csv 找文件
|
|
@@ -96,7 +100,9 @@ def export_zyx(df: pd.DataFrame, out_root: Path, period: str) -> Path:
|
|
|
return target
|
|
return target
|
|
|
|
|
|
|
|
|
|
|
|
|
-def export_qth(df: pd.DataFrame, cache_root: Path) -> Path:
|
|
|
|
|
|
|
+def export_qth(df: pd.DataFrame, cache_root: Path, out_root: Path, period: str) -> Path:
|
|
|
|
|
+ # 平台没有原始五秒 99 列;建立空目录,避免 UnmountedSource 把内部路径带进页面。
|
|
|
|
|
+ (out_root / "WOF046400029" / period / "七台河_华锐/解压/sec").mkdir(parents=True, exist_ok=True)
|
|
|
target = cache_root / SITES["WOF046400029"]["cache"]
|
|
target = cache_root / SITES["WOF046400029"]["cache"]
|
|
|
target.parent.mkdir(parents=True, exist_ok=True)
|
|
target.parent.mkdir(parents=True, exist_ok=True)
|
|
|
# 写全列,保留平台标准字段;ParquetStdSource 按用途取列
|
|
# 写全列,保留平台标准字段;ParquetStdSource 按用途取列
|
|
@@ -125,7 +131,7 @@ def main():
|
|
|
if SITES[args.site]["kind"] == "zyx":
|
|
if SITES[args.site]["kind"] == "zyx":
|
|
|
target = export_zyx(df, Path(args.out_root), args.period)
|
|
target = export_zyx(df, Path(args.out_root), args.period)
|
|
|
else:
|
|
else:
|
|
|
- target = export_qth(df, Path(args.cache_root))
|
|
|
|
|
|
|
+ target = export_qth(df, Path(args.cache_root), Path(args.out_root), args.period)
|
|
|
print(f"exported {len(df)} rows -> {target}")
|
|
print(f"exported {len(df)} rows -> {target}")
|
|
|
|
|
|
|
|
|
|
|