INNER CODE UNIT · Python

target

simonlin1212/Vibe-Research · calc/cli.py:144

    target = (Path(run_dir) / rel).resolve(strict=True)
    try:
        target.relative_to(raw_root.resolve(strict=True))
    except ValueError as e:
        raise ValueError(f"{kind}.raw_ref 越出运行目录的 raw/:{rel!r}") from e
    if not target.is_file():
        raise ValueError(f"{kind}.raw_ref 不是文件:{rel!r}")
    return target


def _dig(obj, dotted: str):
    """按点路径取值:data.sz300308.qfqday;数字段当列表下标。"""
    cur = obj
    for part in [p for p in dotted.split(".") if p != ""]:
        if isinstance(cur, list):
            if not part.isdigit() or int(part) >= len(cur):
                raise ValueError(f"rows_path 段 {part!r} 不是有效列表下标")
            cur = cur[int(part)]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…