Answer stability round 1: each US place's draw is seeded by its GEOID, so a changed source moves only the places near the cut; item 78 leaves the plan and the multi-county fetch is filed
This commit is contained in:
+3
-2
@@ -94,8 +94,9 @@ replacement, and each removed path, column or flag.
|
||||
it. `sv_SE.address` and `en_US.address` bind those records once, so
|
||||
`en_US.address.street` no longer carries `name` and `suffix`, and a locale's `address`
|
||||
reads its country's `geo` module. Every Swedish postort ships, and a tenth of the US
|
||||
incorporated places owning a ZCTA, drawn by population down to villages of a few
|
||||
hundred people; each place carries a tenth of its streets, at least ten.
|
||||
incorporated places that are a postal code's main town, drawn by population down to
|
||||
villages of a hundred people, so a city of any size may be missing; each place carries
|
||||
a tenth of its streets, at least ten.
|
||||
- `{date(from,to,'layout')}` and `{time('layout')}`: a second between two days, or
|
||||
within one, in a single-quoted Go layout, drawn in UTC; `from` may equal `to`.
|
||||
`sv_SE.date`, `en_US.date`, `sv_SE.time` and `en_US.time` render through them, so
|
||||
|
||||
@@ -311,13 +311,16 @@ neighbouring one.
|
||||
|-------|----------|----------|--------|
|
||||
| `region` | län, by code or name | state, by USPS abbreviation or name; `code` is the FIPS code | population |
|
||||
| `municipality` | kommun, by code or name | county, by FIPS code or name | population |
|
||||
| `locality` | postort, by name; [`geo-se.py`](data-import/geo-se.py)'s `localities` picks the candidates, and one with no street is dropped | a tenth of the incorporated places owning a ZCTA, drawn with odds by population, by GEOID or name; Hawaii has none | tätort population, the kommun's where the postort names it, else 200; place population |
|
||||
| `locality` | postort, by name; [`geo-se.py`](data-import/geo-se.py)'s `localities` picks the candidates, and one with no street is dropped | incorporated place, by GEOID or name; Hawaii has none | tätort population, the kommun's where the postort names it, else 200; place population |
|
||||
| `postal-code` | postnummer with street delivery, by code | ZCTA, by code | one; address ranges |
|
||||
| `street` | gatunamn, the tenth with most road segments per postort, at least ten | street name, the tenth with most address ranges per place, at least ten | segments; address ranges |
|
||||
|
||||
`geo.SE.region[Skåne län].municipality` draws a kommun in Skåne,
|
||||
`geo.SE.locality[Lund].street` a street in Lund, and
|
||||
`geo.US.region[IL].locality[Springfield]` settles which Springfield. A region row
|
||||
`geo.US.region[IL].locality[Springfield]` settles which Springfield. The US places are a
|
||||
tenth of the incorporated places that are a postal code's main town, drawn with odds by
|
||||
population, so a city of any size may be missing: look one up in
|
||||
[`locality.tsv`](data/geo/US/locality.tsv) before selecting it. A region row
|
||||
carries its `timezone`, the state's predominant zone, and a locality its `lat` and
|
||||
`lon`. What ports across countries is the five table names, the `name` column,
|
||||
selection by name, and the `address` record's columns `street`, `street-number`,
|
||||
|
||||
@@ -128,12 +128,12 @@ def localities(cache, counties):
|
||||
|
||||
|
||||
def drawn(places, share):
|
||||
"""The share of the places with people, each drawn with odds by its population, the same set on every run:
|
||||
Efraimidis and Spirakis's weighted sampling without replacement."""
|
||||
rng = random.Random(0)
|
||||
peopled = sorted(code for code, p in places.items() if p["population"] > 0)
|
||||
key = {code: math.log(1 - rng.random()) / places[code]["population"] for code in peopled}
|
||||
return {code: places[code] for code in sorted(peopled, key=key.get, reverse=True)[:round(len(peopled) * share)]}
|
||||
"""The share of the places with people, each drawn with odds by its population: Efraimidis and Spirakis's weighted
|
||||
sampling without replacement. Each place's random number is seeded by its code, so a place added or dropped from
|
||||
the sources moves only the places near the cut."""
|
||||
peopled = [code for code, p in places.items() if p["population"] > 0]
|
||||
key = {code: math.log(1 - random.Random(code).random()) / places[code]["population"] for code in peopled}
|
||||
return {code: places[code] for code in sorted(peopled, key=lambda c: (key[c], c), reverse=True)[:round(len(peopled) * share)]}
|
||||
|
||||
|
||||
def zcta_localities(cache, localities):
|
||||
|
||||
+952
-952
File diff suppressed because it is too large
Load Diff
+357
-378
File diff suppressed because it is too large
Load Diff
+1818
-1782
File diff suppressed because it is too large
Load Diff
+57812
-54296
File diff suppressed because it is too large
Load Diff
+12
-10
@@ -605,16 +605,18 @@ them; a data package imports only the packages it reads.
|
||||
|
||||
## The default embed holds every Swedish postort the import can place, a tenth of the US places owning a ZCTA drawn by population, and a tenth of each place's streets, at least ten
|
||||
|
||||
2026-10-11, Lilleman auf Larv, through `todo.md` item 78. Goals 2 and 14: ten streets a
|
||||
place crowded 500 Stockholm customers onto ten streets, and US places of 25,000 or more
|
||||
left out every town and village. `geo-us.py` draws among the places owning a ZCTA, since
|
||||
a place owning none can carry no postal code, with Efraimidis and Spirakis's weighted
|
||||
sampling from a fixed seed, so a rerun on the same sources draws the same places. The
|
||||
draw keeps about 950 of the 1,584 places of 25,000 or more, and its smallest place holds
|
||||
210 people. On 2026-10-11 the embed grew from 1.3 MB to 5.2 MB, and the first draw of
|
||||
`en_US.address` took 75 ms against 19 ms before, within goal 13. `--place-share`,
|
||||
`--street-share` and `--min-streets` on the import scripts build another set. Valid while
|
||||
the first reach of a country stays unnoticed beside a test run.
|
||||
2026-10-11, Lilleman auf Larv. Goals 2 and 14: ten streets a place crowded 500
|
||||
Stockholm customers onto ten streets, and US places of 25,000 or more left out every
|
||||
town and village. `geo-us.py` draws among the places owning a ZCTA, since a place owning
|
||||
none can carry no postal code, with Efraimidis and Spirakis's weighted sampling. Each
|
||||
place's random number is seeded by its GEOID, so a rerun on the same sources draws the
|
||||
same places, and a place added to or dropped from the sources moves only the places near
|
||||
the cut. The draw keeps 968 of the 1,584 places of 25,000 or more and 310 of those of
|
||||
100,000 or more, and its smallest place holds 93 people. On 2026-10-11 the embed grew
|
||||
from 1.3 MB to 5.2 MB, and the first draw of `en_US.address` took 75 ms against 19 ms
|
||||
before, within goal 13. `--place-share`, `--street-share` and `--min-streets` on the
|
||||
import scripts build another set. Valid while the first reach of a country stays
|
||||
unnoticed beside a test run.
|
||||
|
||||
## A locale's `address` binds its country's record once and prints it whole
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
`Bar = 9`
|
||||
|
||||
`Next ID = 198`
|
||||
`Next ID = 200`
|
||||
|
||||
| Goal | W |
|
||||
|---|---|
|
||||
@@ -66,7 +66,6 @@
|
||||
|
||||
| ID | Release | Exempt | Item | R | S | A | G | Goals | Score |
|
||||
|---|---|---|---|---|---|---|---|---|---|
|
||||
| 78 | 0.1.0 | decision | **Ship 10% of every place's streets, at least 10, and 10% of all US places drawn by population, each place weighted by population.** | 6 | 7 | 10 | 10 | 2, 14 | 31.2 |
|
||||
| 61 | 0.1.0 | | **Add a locale, with its `geo/` tree, for each of the ten most-spoken languages and each Nordic country.** | 4 | 9 | 9 | 10 | 2.1 | 30.8 |
|
||||
| 185 | 0.1.0 | decision | **Seat a panel of the README's audience personas to pull data in through the module API and build a custom CLI, and fix what it names.** | 1 | 3 | 7 | 8 | 2.3, 1 | 28.2 |
|
||||
| 16 | 0.1.0 | | **Add locale categories: company, phone, finance, vehicle, words.** | 3 | 8 | 8 | 9 | 2.2, 15 | 28.1 |
|
||||
@@ -76,6 +75,7 @@
|
||||
| 129 | 0.1.0 | decision | **Take a template wherever the library renders, so `fake:"{/sv_SE.person.first}"` and `Fake("{/sv_SE.person}")` render, and text with no `{…}` prints as written, as the CLI already does.** | 5 | 8 | 8 | 10 | 5.9, 7 | 25.0 |
|
||||
| 163 | 0.1.0 | | **Lift the CLI's `--repeat` cap, since the CLI streams each render, and give the builtins' count and decimal caps a technical reason in the README.** | 2 | 2 | 7 | 7 | 2, 5.7 | 24.8 |
|
||||
| 57 | 0.1.0 | | **Rewrite `CHANGELOG.md`'s `[Unreleased]` as what v0.1.0 holds.** | 1 | 2 | 6 | 6 | 1.1 | 22.5 |
|
||||
| 199 | 0.1.0 | question | **Decide whether every state capital, or every US place of 100,000 or more, ships beside the drawn tenth.** | 2 | 2 | 6 | 6 | 2, 16 | 20.9 |
|
||||
| 196 | 0.1.0 | decision | **Name, in the error for a reference nothing loaded provides, the module the reader's manifest reads by default that would provide it, or say none does.** | 3 | 4 | 6 | 8 | 6.2, 9.2 | 20.0 |
|
||||
| 164 | 0.1.0 | | **Let a table's format or a cell bind a name, which lives in that format or cell and keeps one pick through the draw.** | 2 | 2 | 5 | 7 | 4.1, 5.3 | 19.4 |
|
||||
| 157 | 0.1.0 | | **Show in the README's CLI section how PowerShell and cmd.exe pipe a template, one line per shell family.** | 1 | 1 | 5 | 6 | 7.2 | 17.1 |
|
||||
@@ -106,6 +106,7 @@
|
||||
| 24 | 0.2.0 | defect | **Stop `misc.territory[EH].tld` rendering `.eh`, the one shipped TLD `misc.tld` does not hold.** | 1 | 1 | 4 | 7 | 4 | 18.6 |
|
||||
| 178 | 0.2.0 | | **Plan with the systems architect which `internal/` packages the engine splits into, by area, and how each type stops being written by more than one stage, then file the moves as items.** | 1 | 3 | 2 | 9 | 3, 3.2 | 18.4 |
|
||||
| 193 | 0.2.0 | decision | **Move the largest shipped packages into nested Go modules that keep their import paths, once item 192's gate fails.** | 6 | 6 | 6 | 7 | 2.3, 2 | 17.8 |
|
||||
| 198 | 0.2.0 | | **Fetch the TIGER files of every county a drawn US place spans, so a place's streets and postal codes cover all of it.** | 3 | 3 | 5 | 6 | 2 | 17.6 |
|
||||
| 92 | 0.2.0 | | **Name the hyphenated field in a `calc`'s refusal, and say to rename it: today `{calc(postal-code * 2)}` reports `no field "postal"`.** | 1 | 2 | 5 | 6 | 6 | 17.5 |
|
||||
| 194 | 0.2.0 | decision | **Let a data author write and check their own `.fejkdata.json` index with the library or the CLI, and fail a load whose index leaves out a category file.** | 2 | 4 | 5 | 7 | 6.3, 9.1 | 17.5 |
|
||||
| 53 | 0.2.0 | | **Let a table column carry a `datatype`, so `--format json` writes `"safe": true` and `--format sql` a boolean.** | 4 | 5 | 6 | 6 | 4 | 16.9 |
|
||||
@@ -174,10 +175,6 @@
|
||||
|
||||
## Details
|
||||
|
||||
### 78. Ship 10% of every place's streets, at least 10, and 10% of all US places drawn by population, each place weighted by population.
|
||||
|
||||
Ten streets per place crowds 500 Stockholm customers onto ten streets. `geo-se.py` and `geo-us.py` keep 10% of each place's streets, at least 10. `geo-us.py` draws 10% of every Census place, down to the smallest village, picking each with odds by population, and every table weights a place by its population, so a draw is not mostly tiny villages. Replaces the decision "The default embed holds every Swedish postort the import can place and give a street-delivery code and a street, and the US places of 25,000 or more", which the maintainer withdrew on 2026-10-03. Re-pin seeded output and the shape in their own commits.
|
||||
|
||||
### 61. Add a locale, with its `geo/` tree, for each of the ten most-spoken languages and each Nordic country.
|
||||
|
||||
Pick the ten from a published ranking of languages by total speakers, such as Ethnologue's, each in the country where it has the most speakers, and record the ranking in the decision that names them. The Nordic ones are sv_SE (shipped), nb_NO, da_DK, fi_FI and is_IS. A new country decides three rules `geo-se.py` fixes for SE: `well_cased` drops a name spelled in capitals, and Bring's register spells every poststed so; a locality is keyed by name in SE and by code in US; and `data_test.go`'s `geoPlaces` reads every country but US by SE's column positions. A second country reading GeoNames' postal codes moves `geonames()` from `geo-se.py`, and the nearest-centroid street assignment in its `streets()`, into `geo.py`. Each locale carries goal 2.2's categories, and its `address` reads its country's `geo/` tree by reference. `rows.Pins` holds eight pins inline, sized for a five-deep geo tree; a deeper tree needs more to keep a render off the heap.
|
||||
@@ -281,6 +278,10 @@ The README's Audience names a bulk fixture author writing millions of rows, and
|
||||
|
||||
Nothing has shipped, so "no longer paths", "where it used to fail" and "where it used to be an empty string" describe versions no reader can have installed.
|
||||
|
||||
### 199. Decide whether every state capital, or every US place of 100,000 or more, ships beside the drawn tenth.
|
||||
|
||||
The draw by population leaves out about 25 of the 335 places of 100,000 or more, and some state capitals, so a test author pinning a city they know may hit `no row of locality`. Shipping them always would keep such selectors working across a refresh of the sources, at the cost of a draw that is no longer one rule.
|
||||
|
||||
### 196. Name, in the error for a reference nothing loaded provides, the module the reader's manifest reads by default that would provide it, or say none does.
|
||||
|
||||
Carries out the decision "The shipped data is Go packages a library imports by choice, and the CLI carries every one, from 0.1.0", and ends the locale-address decision's conflict with goal 6.2. Carved out of item 182 on 2026-10-11, after six rounds of the comprehension panel ruled each attempt worse. Tried and ruled worse: a module list carried per category from each source's manifest (two routes, `walked` and `indexed`); the union of every manifest's list on the `Generator`, noted at four entry points; and the same noted inside `loadReached`, its list threaded through `loadInline` and `structCompile`. Each named every module read, even loaded ones, until the list held namespaces and the note named only those nothing in the tree provides, which the product-owner and goals reviewers accepted. A shipped locale's `Modules()` already carries its places, so this serves a bare `FS` beside a stand-in, a `--data-path` folder and anyone else's module; the error names the module and points to `Modules()`, as the 2026-10-11 bench asked. Bench the manifest key and the note's wording with the data author, since entries changed from import paths to namespaces after the 2026-10-11 bench.
|
||||
@@ -419,6 +420,10 @@ The decision "The template engine stays the root package until item 107; what re
|
||||
|
||||
Carries out the decision "The shipped data is Go packages a library imports by choice, and the CLI carries every one, from 0.1.0". Each nested module requires the core release that drops its package, so no build sees the package twice. It brings per-module tags and a workspace, so it moves into the release of the chunk whose data trips the gate.
|
||||
|
||||
### 198. Fetch the TIGER files of every county a drawn US place spans, so a place's streets and postal codes cover all of it.
|
||||
|
||||
`streets()` in `geo-us.py` fetches only each drawn place's main county, the one holding most of its people. A ZCTA in a place's other counties then has no address range and is dropped: New York, under Kings County, ships Brooklyn's codes, one Manhattan code and none on Staten Island, and its streets are a tenth of mostly Brooklyn's. Whether a neighbouring county is fetched depends on which other places the draw picks. The fix reads every county in `localities`' `county_part`.
|
||||
|
||||
### 92. Name the hyphenated field in a `calc`'s refusal, and say to rename it: today `{calc(postal-code * 2)}` reports `no field "postal"`.
|
||||
|
||||
A hyphen is always subtraction in a calc, and the shipped data has hyphenated fields (`postal-code` and `street-number` in `geo.SE.address`). The refusal names the first fragment, not the field the author meant.
|
||||
|
||||
Reference in New Issue
Block a user