Record the maintainer's input-data direction in item 26, and the age bands that weigh a birthdate

This commit is contained in:
2026-10-04 20:27:07 +02:00
committed by Lillem4n
parent 4bf1ee292a
commit 32c1fb6c26
2 changed files with 17 additions and 7 deletions
+10
View File
@@ -0,0 +1,10 @@
# Population by age band — research 2026-10-04
Share of the population in four bands, from each country's register, for weighting a drawn birthdate by age (todo.md item 26). Computed from single-year ages.
| Country | Date | Total | 0–17 | 18–64 | 65–99 | 100+ | Source |
|---|---|---|---|---|---|---|---|
| SE | 2024-12-31 | 10,587,710 | 20.36% | 58.80% | 20.81% | 0.028% (2,961) | SCB Statistikdatabasen, table BE0101A/BefolkningNy, CC0 1.0 |
| US | 2024-07-01 | 340,110,988 | 21.50% | 60.51% | 17.96% | 0.029% (98,034) | Census Bureau, [nc-est2024-agesex-res.csv](https://www2.census.gov/programs-surveys/popest/datasets/2020-2024/national/asrh/nc-est2024-agesex-res.csv), public domain |
At 0.03%, a fixture of 10,000 rows holds about three people aged 100 or more.
+7 -7
View File
@@ -257,13 +257,13 @@ GoReleaser attaches the binaries to the release the tag workflow publishes, and
### 26. Spell `sv_SE.personnummer` with the `+` Skatteverket uses from the year the holder turns 100, judged by a date the caller gives. ### 26. Spell `sv_SE.personnummer` with the `+` Skatteverket uses from the year the holder turns 100, judged by a date the caller gives.
The format hard-codes `-`, and its earliest birthdate, 1930-01-01, makes the oldest draws invalid from 2030. A system holding Swedish personnummer often breaks on the `+`, so a fixture carrying one is a valuable test. Whether a number takes `+` depends on the date it is read, and the decision "No builtin reads the clock, so a date is bounded by days, never by an age" forbids a builtin from reading that date off the clock. Steps: The format hard-codes `-`, and its earliest birthdate, 1930-01-01, makes the oldest draws invalid from 2030. A system holding Swedish personnummer often breaks on the `+`, so a fixture carrying one is a valuable test. Whether a number takes `+` depends on the date it is read, and the decision "No builtin reads the clock, so a date is bounded by days, never by an age" forbids a builtin from reading that date off the clock. Explore the first step before the rest:
- Explore how a caller passes data, such as the date a number is read on, to a render: in the template, as a plain option, or both. Bench the spelling; `--now` reads like the clock, and only the year counts. - Explore how a caller passes input data, such as the date a number is read on, to a render: in the template, as a plain option, or both. Bench the spelling; `--now` reads like the clock, and only the year counts. The same input can narrow what is drawn: only adults, only children, only 65 and over, or a mix. That also covers a test asking for a centenarian.
- Decide and document what renders when the caller gives no date, so the output never depends on the day it runs. - The maintainer's direction, 2026-10-04: the library requires every input that can change, such as the date and the randomness, and the CLI defaults to the system's when its flag is absent. Today `New` without `WithSeed` draws its own randomness, so this reaches beyond the date.
- Reach birthdates back past 100 years, as Skatteverket's test series does from 1890, with birth numbers 980/981 before 1900, so a `+` ships before 2030; draw no birthdate after the given date, and decide what share of draws carries a `+`, such as enough that a few hundred rows hold one. - Draw birthdates far enough back that a `+` can appear today. Read in 2026, the oldest shipped birthdate is 96 years old, so no draw carries a `+` until 2030. Skatteverket's test series reaches back to 1890, with birth numbers 980/981 before 1900. Draw no birthdate after the given date.
- Give a path that always draws a `+` number for the date given, so a test can ask for a centenarian. - Weight the ages by the territory's population, so the share of `+` numbers follows its demography: [research-age-bands.md](docs/research/research-age-bands.md).
- Spell the separator with a builtin, or another construct, that a data author's own category can use too, and update the README's personnummer recipe and its "a day in 1930–2025" count. - Let a data author's own category spell the separator too, through a builtin or a function a data module provides (item 77), and update the README's personnummer recipe and its "a day in 1930–2025" count.
- `sv_SE.samordningsnummer` also hard-codes `-` and draws from 1930. Check whether Lag (2022:1697) om samordningsnummer gives it the same `+`; folkbokföringslagen 18 § states the rule for personnummer only. - Research: `sv_SE.samordningsnummer` also hard-codes `-` and draws from 1930. Check whether Lag (2022:1697) om samordningsnummer gives it the same `+`; folkbokföringslagen 18 § states the rule for personnummer only.
### 81. Refuse at load every `calc` operand not proven numeric and every divisor not proven nonzero, in a string column too. ### 81. Refuse at load every `calc` operand not proven numeric and every divisor not proven nonzero, in a string column too.