From 08737e1baa1b862d5f0847a109987c67fb0d44de Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 29 Sep 2025 21:27:27 +0200 Subject: [PATCH] Add in-text kernel usage dates --- popcorn.py | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/popcorn.py b/popcorn.py index 63af80a..04d8641 100644 --- a/popcorn.py +++ b/popcorn.py @@ -379,14 +379,18 @@ def _(kernel_df_v99: pl.DataFrame): @app.cell def _(kernel_df_lazy: pl.LazyFrame): + weekly_kernel_df = ( + kernel_df_lazy.with_columns(pl.col("major_ver").cast(pl.String)) + .select(["date", "major_ver", "downloads"]) + .sort("date") + .group_by_dynamic("date", every="1w", group_by="major_ver") + .agg(pl.col("downloads").sum()) + .collect() + ) + ( lp.ggplot( - kernel_df_lazy.with_columns(pl.col("major_ver").cast(pl.String)) - .select(["date", "major_ver", "downloads"]) - .sort("date") - .group_by_dynamic("date", every="1w", group_by="major_ver") - .agg(pl.col("downloads").sum()) - .collect(), + weekly_kernel_df, lp.aes("date", "downloads", color="major_ver"), ) + lp.geom_line() @@ -397,6 +401,38 @@ def _(kernel_df_lazy: pl.LazyFrame): ) +@app.cell(hide_code=True) +def _(weekly_kernel_df: pl.DataFrame): + from datetime import date + + last_kernel4: date = weekly_kernel_df.filter(pl.col("major_ver") == "4")[-1][ + "date" + ].item() + first_kernel5: date = weekly_kernel_df.filter(pl.col("major_ver") == "5")[0][ + "date" + ].item() + last_kernel5: date = weekly_kernel_df.filter(pl.col("major_ver") == "5")[-1][ + "date" + ].item() + mo.md( + rf""" + + A timeline analysis of the kernels used to report daily downloads shows that people generally + adopt new major kernel versons at roughly the same time. This change is especially stark between + major kernel versions 5 and 6, which seem to have traded place in usage almost over night. + + The first time that major version 5 of the kernel shows up is on {first_kernel5}. From here, it + took a long time for the last of the version 4 kernels to disappear, coinciding with the big + switch between major version 5 and 6. The last time a major version 4 is seen is on + {last_kernel4}, while the last major version 5 kernels still pop up. + It would seem, then, that the people still running kernel version 4 used the opportunity of + everybody switching to the stable version of 6 to also upgrade their machines. + + """ + ) + return + + @app.cell(hide_code=True) def _(): mo.md(