memoir wordcount automation precision
authorM. Taylor Saotome-Westlake <[email protected]>
Sun, 8 Jan 2023 19:35:35 +0000 (11:35 -0800)
committerM. Taylor Saotome-Westlake <[email protected]>
Sun, 8 Jan 2023 19:45:41 +0000 (11:45 -0800)
I think the LibreOffice Calc graph I brought up earlier was just
graphing the datapoints in sequence; the horizontal axis was "Git tree
time" (sampled every 5 commits) rather than sidereal time. If we grab
an end-of-day wordcount for every day, and stuff every day into the
spreadsheet, then the datapoints in sequence are sidereal time.

notes/memoir_wordcounts.csv
notes/memoir_wordcounts.py

index 52d63c6..bfb43b5 100644 (file)
-03/25/2022,5965\r
+03/26/2022,5965\r
+03/27/2022,5965\r
+03/28/2022,5965\r
+03/29/2022,5965\r
+03/30/2022,5965\r
+03/31/2022,5965\r
+04/01/2022,5965\r
+04/02/2022,5965\r
+04/03/2022,5965\r
+04/04/2022,5965\r
+04/05/2022,5965\r
+04/06/2022,5965\r
+04/07/2022,5965\r
+04/08/2022,5965\r
 04/09/2022,5965\r
+04/10/2022,5965\r
+04/11/2022,5965\r
+04/12/2022,5965\r
+04/13/2022,5965\r
+04/14/2022,5965\r
 04/15/2022,5965\r
+04/16/2022,5965\r
+04/17/2022,5965\r
+04/18/2022,5965\r
+04/19/2022,5965\r
+04/20/2022,5965\r
 04/21/2022,5990\r
+04/22/2022,5990\r
+04/23/2022,5990\r
 04/24/2022,5997\r
+04/25/2022,5997\r
+04/26/2022,5997\r
+04/27/2022,5997\r
+04/28/2022,6126\r
 04/29/2022,6141\r
+04/30/2022,6746\r
+05/01/2022,7125\r
+05/02/2022,7125\r
+05/03/2022,7125\r
+05/04/2022,7125\r
+05/05/2022,7125\r
 05/06/2022,7127\r
+05/07/2022,7392\r
 05/08/2022,7392\r
+05/09/2022,7392\r
+05/10/2022,7392\r
+05/11/2022,7392\r
 05/12/2022,7392\r
+05/13/2022,7412\r
 05/14/2022,7412\r
-05/15/2022,7420\r
-05/15/2022,7757\r
+05/15/2022,8117\r
+05/16/2022,8117\r
+05/17/2022,8117\r
+05/18/2022,8117\r
 05/19/2022,7819\r
 05/20/2022,8783\r
-05/22/2022,8682\r
-05/22/2022,8783\r
-05/29/2022,8858\r
-05/29/2022,9785\r
+05/21/2022,8783\r
+05/22/2022,8787\r
+05/23/2022,8787\r
+05/24/2022,8787\r
+05/25/2022,8682\r
+05/26/2022,8682\r
+05/27/2022,8682\r
+05/28/2022,8682\r
+05/29/2022,10110\r
 05/30/2022,10308\r
-06/04/2022,10655\r
-06/05/2022,11001\r
+05/31/2022,10308\r
+06/01/2022,10308\r
+06/02/2022,10308\r
+06/03/2022,10308\r
+06/04/2022,10921\r
 06/05/2022,11437\r
+06/06/2022,11437\r
+06/07/2022,11537\r
+06/08/2022,11537\r
 06/09/2022,11537\r
 06/10/2022,11537\r
+06/11/2022,13077\r
 06/12/2022,13077\r
-06/16/2022,13076\r
+06/13/2022,13077\r
+06/14/2022,13077\r
+06/15/2022,13077\r
+06/16/2022,13077\r
+06/17/2022,13076\r
+06/18/2022,13089\r
+06/19/2022,13089\r
+06/20/2022,13089\r
+06/21/2022,13089\r
+06/22/2022,13089\r
+06/23/2022,13089\r
 06/24/2022,13089\r
-06/26/2022,13285\r
+06/25/2022,12391\r
+06/26/2022,13313\r
+06/27/2022,13313\r
+06/28/2022,13313\r
+06/29/2022,13313\r
+06/30/2022,13313\r
+07/01/2022,13313\r
+07/02/2022,13313\r
 07/03/2022,13341\r
+07/04/2022,13341\r
+07/05/2022,13341\r
+07/06/2022,13341\r
+07/07/2022,13341\r
 07/08/2022,13341\r
-07/17/2022,15026\r
-07/17/2022,16167\r
-07/22/2022,16458\r
-07/23/2022,15642\r
-07/23/2022,15717\r
-07/23/2022,19852\r
-07/29/2022,18832\r
-07/29/2022,20082\r
-07/31/2022,20229\r
+07/09/2022,13349\r
+07/10/2022,14761\r
+07/11/2022,14761\r
+07/12/2022,14761\r
+07/13/2022,14761\r
+07/14/2022,14761\r
+07/15/2022,14983\r
+07/16/2022,14983\r
+07/17/2022,16414\r
+07/18/2022,16414\r
+07/19/2022,16414\r
+07/20/2022,16414\r
+07/21/2022,16458\r
+07/22/2022,17815\r
+07/23/2022,20289\r
+07/24/2022,20082\r
+07/25/2022,20082\r
+07/26/2022,20082\r
+07/27/2022,20082\r
+07/28/2022,20082\r
+07/29/2022,20170\r
+07/30/2022,19882\r
+07/31/2022,20391\r
+08/01/2022,20391\r
+08/02/2022,20391\r
 08/03/2022,20388\r
+08/04/2022,20381\r
 08/05/2022,21349\r
-08/07/2022,23247\r
-08/13/2022,24379\r
-08/14/2022,25009\r
-08/19/2022,25483\r
-08/20/2022,26132\r
+08/06/2022,22781\r
+08/07/2022,24301\r
+08/08/2022,24301\r
+08/09/2022,24301\r
+08/10/2022,24301\r
+08/11/2022,24301\r
+08/12/2022,24379\r
+08/13/2022,24800\r
+08/14/2022,25177\r
+08/15/2022,25177\r
+08/16/2022,25177\r
+08/17/2022,25177\r
+08/18/2022,25205\r
+08/19/2022,25615\r
 08/20/2022,34503\r
+08/21/2022,34900\r
+08/22/2022,34900\r
+08/23/2022,34900\r
+08/24/2022,34900\r
 08/25/2022,35059\r
-08/27/2022,36215\r
+08/26/2022,35853\r
+08/27/2022,36459\r
 08/28/2022,36784\r
-09/02/2022,37671\r
-09/03/2022,39599\r
+08/29/2022,36784\r
+08/30/2022,36784\r
+08/31/2022,36784\r
+09/01/2022,37008\r
+09/02/2022,38663\r
+09/03/2022,40167\r
 09/04/2022,40484\r
+09/05/2022,41661\r
+09/06/2022,41661\r
+09/07/2022,41661\r
+09/08/2022,41661\r
 09/09/2022,41815\r
-09/11/2022,44068\r
+09/10/2022,42902\r
+09/11/2022,44094\r
+09/12/2022,44094\r
+09/13/2022,44094\r
+09/14/2022,44171\r
 09/15/2022,44858\r
+09/16/2022,45554\r
 09/17/2022,45628\r
-09/18/2022,45706\r
+09/18/2022,46675\r
+09/19/2022,46675\r
+09/20/2022,46675\r
+09/21/2022,46675\r
 09/22/2022,46724\r
-09/25/2022,47740\r
-09/30/2022,49173\r
+09/23/2022,46724\r
+09/24/2022,46745\r
+09/25/2022,47741\r
+09/26/2022,47741\r
+09/27/2022,47741\r
+09/28/2022,47741\r
+09/29/2022,47865\r
 09/30/2022,49533\r
-10/02/2022,51024\r
-10/07/2022,51922\r
-10/09/2022,52989\r
-10/14/2022,53472\r
-10/16/2022,56344\r
-10/20/2022,58146\r
+10/01/2022,50660\r
+10/02/2022,51674\r
+10/03/2022,51674\r
+10/04/2022,51674\r
+10/05/2022,51674\r
+10/06/2022,51826\r
+10/07/2022,52190\r
+10/08/2022,52618\r
+10/09/2022,53486\r
+10/10/2022,53486\r
+10/11/2022,53486\r
+10/12/2022,53486\r
+10/13/2022,53408\r
+10/14/2022,53841\r
+10/15/2022,56326\r
+10/16/2022,58138\r
+10/17/2022,58138\r
+10/18/2022,58138\r
+10/19/2022,58138\r
+10/20/2022,58312\r
 10/21/2022,60860\r
+10/22/2022,61571\r
+10/23/2022,62788\r
+10/24/2022,62788\r
 10/25/2022,62922\r
-10/28/2022,62974\r
-10/29/2022,64086\r
+10/26/2022,62922\r
+10/27/2022,62974\r
+10/28/2022,63215\r
+10/29/2022,64488\r
 10/30/2022,66302\r
-11/04/2022,66317\r
+10/31/2022,66302\r
+11/01/2022,66302\r
+11/02/2022,66302\r
+11/03/2022,66302\r
 11/04/2022,67058\r
+11/05/2022,67849\r
 11/06/2022,68083\r
-11/10/2022,68083\r
+11/07/2022,68113\r
+11/08/2022,68222\r
+11/09/2022,68222\r
+11/10/2022,68227\r
+11/11/2022,68913\r
 11/12/2022,69792\r
-11/18/2022,71296\r
-11/20/2022,71859\r
+11/13/2022,70738\r
+11/14/2022,70738\r
+11/15/2022,70738\r
+11/16/2022,70738\r
+11/17/2022,70806\r
+11/18/2022,71400\r
+11/19/2022,71859\r
+11/20/2022,73074\r
+11/21/2022,73179\r
+11/22/2022,73179\r
+11/23/2022,73179\r
 11/24/2022,73348\r
+11/25/2022,73972\r
+11/26/2022,73972\r
 11/27/2022,74002\r
+11/28/2022,74002\r
+11/29/2022,74002\r
+11/30/2022,74002\r
+12/01/2022,74002\r
+12/02/2022,74002\r
 12/03/2022,74002\r
+12/04/2022,74002\r
+12/05/2022,74002\r
+12/06/2022,74002\r
+12/07/2022,74002\r
+12/08/2022,74020\r
+12/09/2022,74021\r
+12/10/2022,74021\r
+12/11/2022,74021\r
+12/12/2022,74021\r
+12/13/2022,74021\r
+12/14/2022,74021\r
+12/15/2022,74021\r
 12/16/2022,74039\r
+12/17/2022,74039\r
+12/18/2022,74039\r
+12/19/2022,74039\r
+12/20/2022,74039\r
+12/21/2022,74039\r
+12/22/2022,74043\r
+12/23/2022,74043\r
+12/24/2022,74043\r
+12/25/2022,74055\r
 12/26/2022,74255\r
+12/27/2022,74255\r
+12/28/2022,74255\r
+12/29/2022,74255\r
+12/30/2022,74255\r
+12/31/2022,74255\r
+01/01/2023,74255\r
+01/02/2023,74285\r
+01/03/2023,74285\r
+01/04/2023,74295\r
+01/05/2023,74295\r
+01/06/2023,74757\r
index ef36de5..bfe63c7 100755 (executable)
@@ -38,7 +38,7 @@ def look_back():
     wordcounts = []
     keep_going = True
     while keep_going:
-        subprocess.run(["git", "checkout", "HEAD~5"])
+        subprocess.run(["git", "checkout", "HEAD~1"])
         wordcount = wordcount_at_this_sha()
         date = date_at_this_sha()
         if date < datetime.date(2022, 4, 1):
@@ -48,6 +48,17 @@ def look_back():
     subprocess.run(["git", "checkout", "master"])
     return sorted(wordcounts)
 
+def normalize_dates(wordcounts):
+    eod_wordcounts = []
+    for i in range(len(wordcounts)-1):
+        date, wordcount = wordcounts[i]
+        next_date, next_wordcount = wordcounts[i+1]
+        gap = next_date - date
+        if gap >= datetime.timedelta(1):
+            eod_wordcounts.append((date, wordcount))
+            for i in range(gap.days-1):
+                eod_wordcounts.append((date + datetime.timedelta(i+1), wordcount))
+    return eod_wordcounts
 
 def write_csv(wordcounts):
     with open("memoir_wordcounts.csv", 'w') as f:
@@ -57,5 +68,5 @@ def write_csv(wordcounts):
 
 
 if __name__ in "__main__":
-    wordcounts = look_back()
+    wordcounts = normalize_dates(look_back())
     write_csv(wordcounts)