def date_to_x(date: dt.date) -> float:
            """Convert datetime.date to an SVG X coordinate"""
            num_days = (date - first_date).days
            total_days = (last_date - first_date).days
            ratio = num_days / total_days
            x = ratio * (DIAGRAM_WIDTH - LEGEND_WIDTH - RIGHT_MARGIN)
            return (x + LEGEND_WIDTH) * SCALE
Convert datetime.date to an SVG X coordinate
_tools/generate_release_cycle.py