Skip to content

Give NZ's geography layers their support columns' labels - #1707

Draft
MaxGhenis wants to merge 2 commits into
mainfrom
nzhub/nz-geo-layer-labels
Draft

MaxGhenis wants to merge 2 commits into
mainfrom
nzhub/nz-geo-layer-labels

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What

On main, nz.geo.assign refuses before it places any household. NZ's step-4 run would stop there.

atomic_geography._bind requires each layer's source, vintage and relation to equal the support column it reads. In nz/geography_assignment.json, all four layers declared:

  • source atomic_geography_support.json;
  • vintage ta2026_regc2025_au2017;
  • relation exact.

The columns in nz/transport_atomic_geography_support.json say otherwise:

Layer Source Vintage Relation
ta_code Stats NZ Meshblock Higher Geographies 2026 ta_2026 official_tabulation
region_code Stats NZ Meshblock Higher Geographies 2026 regc_2025 official_tabulation
as_area G8-m SA1 interior-point/centroid AU2017 bridge au_2017 best_fit
as_area_alt as_area_crosswalk.json modal_area ta_2025 best_fit

Change

  • tools/build_nz_transport_graph.py: each layer now copies its three labels from the support column it reads. This is the same in-memory definition the generator writes as the transport support, as_area_alt included.
  • nz/geography_assignment.json: regenerated. No other generated resource changes; --check passes for all three NZ builders.
  • tests/golden/nz_country_spec.json: the new hash for geography_assignment.json and the new NZ fingerprint.
  • test_nz_joint_geography.py: a new test runs the committed assignment on the committed transport support through assignment, derivation and the gate. It also checks that changing any one label of any layer refuses. On main the test fails with "Atomic geography: layer source, relation or vintage differs"; on this branch it passes. The existing test built its layers from the column labels, so it never read the committed assignment.
  • changelog.d/nz-geography-layer-labels.fixed.md: the fragment.

The draws key on the definition's hash, so households' sampled areas change. No NZ run has produced output at the old bytes.

Scope

NZ-only. There are no changes to shared code and no shared test hunks. Belgium found this while mapping its own geography step.

Local checks

Serial run of five files at d9b0207 (the head before the changelog-only commit 622a98e): test_nz_joint_geography.py, test_atomic_geography.py, test_country_spec.py, test_nz_transport_declarations.py and test_spec_engine_country_bundles.py. All pass; the pinned-source replay tests skip without their environment variables. ruff check and ruff format --check pass on the changed Python files.

axiom: n/a: Microcosm geography declaration fix; no Axiom encoding, RuleSpec or runtime change

🤖 Generated with Claude Code

MaxGhenis and others added 2 commits November 22, 2026 02:47
On main, nz.geo.assign refuses before placing any household: the four layers in
nz/geography_assignment.json declared source "atomic_geography_support.json",
vintage "ta2026_regc2025_au2017" and relation "exact", while the transport
support's columns say otherwise (for example, as_area is a best_fit AU2017
bridge). atomic_geography._bind requires each layer's labels to equal its
support column's. Take-up reads this node's outputs, so step 4 would have
stopped here.

The generator now copies each layer's source, vintage and relation from the
support column it reads. A new test runs the committed assignment on the
committed transport support through assignment, derivation and the gate, and
checks that changing any one label refuses. The existing test built its
layers from the column labels, so it never read the committed assignment.

Found by the Belgium lane while mapping its own geography step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant