Repository navigation
Stats NZ territorial-authority resident population, 30 June 2025 (NZ, G8-d2) - #355
Merged
Merged
Conversation
Emit 67 provisional all-age ERP observations from individual Table 2 E cells, using pinned TA 2025 publisher codes and names. Preserve the whole worksheet, exact labels and guards; exclude local boards, earlier years, changes and the national row. Reuse the unchanged workbook and manifests. Single-source build_bundle measurement (year=2023, only new package; output deleted): facts=67; geography_count=67; source_count=1 (stats_nz); packages=1; tables=1 (stats_nz:Subnational population estimates: At 30 June 2025 (provisional), Table 2); warnings=0; errors=0; period_count=1; entity_count=1; duplicate counts=0. by_period: calendar_year:2025=67; by_entity: person=67; by_source: stats_nz=67. by_geography delta: 67 keys local_authority:nz-ta-NNN (the 67 Table 2 TA codes, 001 to 076 with gaps), each +1 fact. Default bundle delta relative to main pins: facts=+67 (1030137 -> 1030204); geographies=+1 (20548 -> 20549), new key local_authority:nz-ta-067; 66 other keys already covered by MBIE; sources=+0 (56); packages=+1 (379 -> 380); tables=+1 (321 -> 322); warnings=+2 (118 -> 120); period_count=+0 (511); entity_count=+0 (12). The two merged name warnings were measured through the existing warning function using declared package geography metadata (no combined bundle build): local_authority:nz-ta-018 (Otorohanga / Ōtorohanga District) and local_authority:nz-ta-027 (Opotiki / Ōpōtiki District). Counts: stats_nz +67 (1948 -> 2015), CY2025 +67, person +67 (496036 -> 496103); new Table 2 source_table +67; every by_geography key above +1. No new period/entity/source keys, aggregate/semantic duplicate keys, errors, or skipped sources. Full bundle and merged-consumer-contract test remain CI-only. Validation: validate-package and single-source build-suite pass (67 facts, 2226 preserved cells, complete lineage); one-source build_bundle passes. Tests: new package 94 passed (also 94 passed after restoring mutants), existing population package 30 passed with unchanged 85 facts; six required mutants all rejected and restored. The NZ bundle roster line (NZ_BUNDLE_SOURCES in chronicle/bundle.py) was outside the ingestor role's paths; the NZ hub applied it, as for G8-d1. Classification publication and remote verification are owned by the NZ hub. Co-Authored-By: GPT-6.1 Sol <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The NZ hub published the classification with publish-raw and streamed the object back from raw/nz/stats_nz/territorial_authority_2025_codes/2025/db033184…/; its SHA-256 matched the manifest, which is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
marked this pull request as ready for review
October 13, 2026 19:08
- Mark the TA 2025 classification JSON `binary` beside its regional-council sibling, so a renormalisation can never rewrite its pinned CRLF bytes. - README: record the hub's verified R2 publication; row order never assigns a code (not "not ... alone"). - `ruff format` (0.14.10, uv.lock) on the new test file; 94 pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Merged by the NZ hub (session local_e407a527) at 81fdaa6 with --squash. Gates: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A new package,
stats_nz/subnational_population_ta_2025: 67 Stats NZ estimated resident population facts, one per territorial authority, at 30 June 2025 (provisional). It is G8-d2 of the NZ Microcosm plan (microcosm#1183), the territorial-authority population input.subnational_population_estimates_2025package already pins (sha256001e8a89…50a6, unchanged). The package reads one cell per fact from column E, headed2025 P.geography_level: local_authority,geography_id: nz-ta-NNN,geography_vintage: ta_2025. That is the conventionmbie/tenancy_bond_rents_tla_2026already uses, so these facts join the TLA rent facts.Territorial_Authority_2025code, name and ASCII-name attributes (68 features, sha256db033184…c225, 14,315 B).raw/nz/stats_nz/territorial_authority_2025_codes/2025/db033184…/and verified the remote object by SHA-256.Not emitted (preserved in the parsed worksheet):
New Zealand(3)row. The existing package already emits 5,324,700 from Table 1!D25.No sums, shares, reconciliation or ageing. The 67 TA cells sum to 5,324,430 against the published 5,324,700; the workbook's footnote 3 (inlets, islands, ships, oil rigs outside any territorial authority) and its rounding note qualify the comparison; the workbook doesn't say how the 270 gap splits between them, and neither figure is adjusted.
Shared files
chronicle/source_package.py: one alias.chronicle/bundle.py: one line in the curated NZ roster (NZ_BUNDLE_SOURCES), the same kind of edit G8-d1 (Census 2023 weekly rent paid by households, by regional council (NZ, G8-d1) #341) made. The lane's role couldn't write it, so the hub applied it.tests/test_source_package_alias_drift.py: the NZ roster counts 66 → 67.tests/test_chronicle_bundle.py: the default-bundle pins move by this package's measured single-source delta. The full bundle test runs in CI only.local_authority:nz-ta-067, Chatham Islands, which MBIE doesn't cover);Tests
tests/test_chronicle_nz_subnational_population_ta.py, 94 cases.Mutants, each failing the tests (lane run):
2024 Pcolumn instead of2025 P;New Zealand(3)row emitted;Whangareiwithout the macron);The existing population package still passes with 85 facts.
validate-packageand the single-sourcebuild-suitepass.Invariants
Review
test_chronicle_nz_population.py30 passed (85 facts);validate-packagevalid, 0 errors, 0 warnings.chronicle/bundle.pychange is the one roster line.binaryin.gitattributes, beside its regional sibling.ruff format(0.14.10, the uv.lock version) on the new test file; 94 pass.db033184….ledger-raw/raw/nz/stats_nz/territorial_authority_2025_codes/2025/db033184…/territorial-authority-2025-codes.jsonback from R2: sha256db033184…c225, 14,315 bytes, equal to the manifest. It is an internal package statement and publishes no number.ledger-source-ingestorallow-list (chronicle/bundle.py,chronicle/source_package.py,db/data/**,docs/**,changelog.d/**). These are the per-package files every NZ source package touches, as in Census 2023 weekly rent paid by households, by regional council (NZ, G8-d1) #341 and Add Stats NZ 2023 Census household and family counts by regional council #335.🤖 Generated with Claude Code