feat(data): 补 000985 中证全指 + 中证800十行业成份股入 constituent_unified (G1+G2)

治幸存者偏差全集: 000985=5128 全市场(解锁策略02小市值全市场池) + 000928~000937 中证800十行业 24~196只(解锁策略03行业轮动)。复用+泛化 000852/932000 csindex 公告回溯流程, 不动硬编码路径。9 宽基无回归, was_removed 治偏差填齐, 全表 14402 行/20 指数。
This commit is contained in:
2026-07-28 20:36:11 +08:00
parent 670498ab01
commit 853d35197e
2 changed files with 149 additions and 5 deletions
+8 -2
View File
@@ -172,8 +172,14 @@ def migrate(db_path: str) -> None:
df_deep["code"] = df_deep["code"].apply(norm_code)
print(f"[深证 union] rows={len(df_deep)}")
# 3. 中证 1000/2000 announce_union 全集(优先); 缺则回退 snapshot 当前
ANNOUNCE_IDX = ["000852", "932000"]
# 3. 中证 announce_union 全集(优先, 自动发现 *_announce_union.parquet); 缺则回退 snapshot
# G1+G2 扩展: 不再硬编码 000852/932000, glob 整个 HIST 目录自动发现新指数
announce_files = sorted(glob.glob(os.path.join(HIST, "*_announce_union.parquet")))
ANNOUNCE_IDX = [
os.path.basename(f).split("_announce_union.parquet")[0]
for f in announce_files
]
print(f"[中证 announce] 发现 {len(ANNOUNCE_IDX)} 个指数: {ANNOUNCE_IDX}")
df_csi = _read_announce_union_aggregated(HIST, ANNOUNCE_IDX)
if df_csi.empty:
# 回退: 旧 snapshot-only 路径(announce_union 未生成时)