INNER CODE UNIT · Python

previous_pct

OpenChemistry/avogadrolibs · scripts/coverage_summary.py:102

def previous_pct(row: dict[str, str] | None, covered: str, total: str):
    if row is None:
        return None
    c, t = to_int(row.get(covered)), to_int(row.get(total))
    if c is None or t is None:
        return None
    return pct(c, t)


def fmt_pct(value: float | None) -> str:
    return "n/a" if value is None else f"{value:.1f}"


def fmt_delta(now: float | None, before: float | None) -> str:
    if now is None or before is None:
        return "—"
    delta = round(now - before, 1)
    if delta == 0:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…