Stable run ids (fingerprints) for the form and the register; tests for the site statistics (#25)
CI / test (pull_request) Successful in 43s
CI / test (pull_request) Successful in 43s
- collection/etl/runs.py fingerprints(): a form or register run's id is now <prefix>-<hash of the row's non-empty answers, timestamp included> instead of its row number, so deleting or re-sorting rows in the sheet moves no other run's id, and a column added later changes none. The 32 rows that are exact copies of another row get -2, -3 (identical, so which is which does not matter). A row edited in the sheet gets a new id. Every id in runs_clean.csv and overlap.json changes once; nothing else does (no statistic or model reads the ids). - tests/core/test_site_stats.py (9 tests): measures.yaml conditions, source groups and presets, bond denominators without deliberate deaths (cards, encounters, route map), the riders' paths, and a JSON-safe stats.json, on a fixed sample of the published runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ca411e8315
commit
1dfa8fb4c3
@@ -75,7 +75,7 @@ files:
|
||||
# The columns of runs_clean. type: text, integer, boolean or date. values: every value the column may take
|
||||
# (empty cells are always allowed and mean "does not apply" or "not recorded").
|
||||
columns:
|
||||
run_id: { type: text, required: true, description: "Unique id of the run: sheet-<row of the form export>, thread-<result id>, comment-<Reddit comment id>, reported-<issue number> or bot-<hash>." }
|
||||
run_id: { type: text, required: true, description: "Unique id of the run, stable when rows are deleted or re-sorted: sheet-<hash of the form row's answers and timestamp>, register-<hash of the register row>, thread-<result id>, comment-<Reddit comment id>, reported-<issue number> or bot-<hash>." }
|
||||
source:
|
||||
type: text
|
||||
required: true
|
||||
|
||||
Reference in New Issue
Block a user