INNER CODE UNIT · Python

previous_run

OpenChemistry/avogadrolibs · scripts/coverage_summary.py:81

def previous_run(rows: list[dict[str, str]]):
    """Return ((date, commit, run_id), {module: row}) for the newest run."""
    if not rows:
        return None, {}
    last = rows[-1]
    key = (last.get("date", ""), last.get("commit", ""), last.get("run_id", ""))
    by_module = {
        row["module"]: row
        for row in rows
        if (row.get("date", ""), row.get("commit", ""), row.get("run_id", "")) == key
    }
    return key, by_module


def to_int(value: str | None) -> int | None:
    try:
        return int(value)  # type: ignore[arg-type]
    except (TypeError, ValueError):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…