Attribute Adpingid 11729927 to 黄政 via roster supplement
New roster_extra.json fills in Adpingids missing from 投手.xlsx. It only applies when the roster has no entry for that id, so a future roster always wins. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -61,6 +61,18 @@ for r in roster.iter_rows(min_row=2, values_only=True):
|
||||
continue
|
||||
amap[k] = b.lstrip('@').strip()
|
||||
|
||||
# 花名册补充:只填花名册里查不到的 Adpingid(花名册优先)
|
||||
EXTRA_PATH = os.path.join(HERE, 'roster_extra.json')
|
||||
extra_used = []
|
||||
if os.path.exists(EXTRA_PATH):
|
||||
for a, b in json.load(open(EXTRA_PATH)).get('adpings', {}).items():
|
||||
a = str(a).strip()
|
||||
if a in EXCL_ADP or a in dropped_ids:
|
||||
continue
|
||||
if a not in amap:
|
||||
amap[a] = str(b).strip().lstrip('@').strip()
|
||||
extra_used.append(a)
|
||||
|
||||
owned = collections.Counter(amap.values()) # 每位投手名下的 Adpingid 数(已扣除排除包名)
|
||||
|
||||
# --- 平台消耗统计:逐文件读取,按日期归组,新文件覆盖同一天的旧数据 ---
|
||||
@@ -161,6 +173,8 @@ json.dump(data, open(os.path.join(HERE, 'data.json'), 'w'), ensure_ascii=False,
|
||||
|
||||
print('源文件:', ', '.join(os.path.basename(f) for f in SRC_FILES))
|
||||
print('投手表取自:', os.path.basename(roster_file))
|
||||
if extra_used:
|
||||
print('roster_extra 补充生效:', ', '.join(f'{a}->{amap[a]}' for a in extra_used))
|
||||
print(f"窗口 {start} -> {end}")
|
||||
print(f"排除包名命中 {excluded_rows} 行,剔除花费 {excluded_spend:.2f}")
|
||||
print(f"合计 {data['grand_total']:.2f} / Adpingid {data['week34_id_count']}")
|
||||
|
||||
Reference in New Issue
Block a user