From 83dfce1a61da182af42e39b07ddbe28397fc372c Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 28 Sep 2025 19:30:37 +0200 Subject: [PATCH] Change to weekly downloads --- popcorn.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/popcorn.py b/popcorn.py index 4e044f3..de6199d 100644 --- a/popcorn.py +++ b/popcorn.py @@ -129,14 +129,19 @@ def _(): @app.cell def _(df: pl.DataFrame): + weekly_downloads = ( + df.sort("date") + .group_by_dynamic("date", every="1w") + .agg(pl.col("downloads").sum()) + .sort("date") + ) ( - lp.ggplot( - df.group_by("date").agg(pl.col("downloads").sum()).sort("date"), - lp.aes("date", "downloads"), - ) + lp.ggplot(weekly_downloads, lp.aes("date", "downloads")) + lp.geom_line() + + lp.geom_smooth(method="loess") + + lp.geom_smooth(method="lm") + lp.labs( - title="Daily downloads", + title="Weekly downloads", ) ) return @@ -187,6 +192,12 @@ def _(sizes_df): # further ideas: +# +# - daily download habits: +# - which weekday has most downloads? +# - are we downloading further spread of versions on specific days +# - are there 'update' days, where things converge? specific weekday/on holidays/etc? +# # - which kernels have been DL when? (simplified for semver) # - when did specific kernels enter the repos? #