Fit S3's interpolation form, and build the materials seed (#698) - #715
Draft
WesIngwersen wants to merge 2 commits into
Draft
Fit S3's interpolation form, and build the materials seed (#698)#715WesIngwersen wants to merge 2 commits into
WesIngwersen wants to merge 2 commits into
Conversation
WesIngwersen
added a commit
that referenced
this pull request
Aug 25, 2026
The materials interpolation commit d722010 left three constructs black 24.10 rewrites: a parenthesised return annotation on _census_mix_frames, a split %-format key in interpolation_forms' assign, and a nested conditional in the census-mix treatment label. Formatting only -- no behaviour changes. This is the format gate failing on PR #715 and, inherited, on #717 and the service seed branch stacked above it. Fixed here so one change clears all three rather than each branch carrying its own. Gates: black, ruff, mypy clean; pytest 795 passed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
WesIngwersen
added a commit
that referenced
this pull request
Aug 26, 2026
The materials interpolation commit d722010 left three constructs black 24.10 rewrites: a parenthesised return annotation on _census_mix_frames, a split %-format key in interpolation_forms' assign, and a nested conditional in the census-mix treatment label. Formatting only -- no behaviour changes. This is the format gate failing on PR #715 and, inherited, on #717 and the service seed branch stacked above it. Fixed here so one change clears all three rather than each branch carrying its own. Gates: black, ruff, mypy clean; pytest 795 passed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
WesIngwersen
force-pushed
the
step3_materials_interpolation
branch
from
August 26, 2026 18:30
ec27a63 to
454ddb4
Compare
The form left open by S3 is settled, and the candidate the plan named is not the answer. Separate the two things called "interpolation" first. The materials LEVEL is observed every year (ASM to 2021, AIES from 2023), so it never needed interpolating and section 4 rules out doing so. The commodity MIX is observed only at 2017 and 2022, and nothing observes its interior -- the fuels share of the census universe stays between 0.98% and 1.14% -- so the open question was only ever about the mix. The price-carried path is rejected. Carrying the 2017 census mix to 2022 on the commodity price ratio fits theta = 0.00 on the unsuppressed frame and -0.25 (+0.4%) on the full one. The level moves with price; the mix does not. The published summary panel cannot arbitrate the form and its answer must not be used: BEA carries the last benchmark forward, so every interior year of a summary span is itself an interpolation, and since BEA has not taken up the 2022 Economic Census its 2022-2024 tables are still 2017-benchmark carries -- so spans ending in the nowcast horizon are contaminated at the endpoint too. The benchmark detail panel can arbitrate it, because 2007, 2012 and 2017 are three independent Economic-Census-anchored observations. Interpolating 2007 -> 2017 and scoring at the observed 2012, manufacturing: frozen 0.0889, linear 0.0764, geometric 0.0710, endpoint 0.1216. So interpolating beats freezing by 20.1%, geometric beats linear by 7.1%, and adopting the newer observation early is worse than freezing. But do not extend the trend past the last observation: reaching 2017 from 2007 and 2012, holding the 2012 mix scores 0.1232 against 0.1569 linear and 0.1513 geometric -- 27.4% worse on manufacturing, 41.7% on the whole table. S3 therefore ships an asymmetry: geometric interpolation between the two censuses, and the 2022 mix held flat for 2023 and 2024. materials_seed() is that seed, an index on the share with the column total held, moving the block 0.0979 off frozen 2017 by 2022 -- alongside the independently computed 0.0949 in the mix score section. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The materials interpolation commit d722010 left three constructs black 24.10 rewrites: a parenthesised return annotation on _census_mix_frames, a split %-format key in interpolation_forms' assign, and a nested conditional in the census-mix treatment label. Formatting only -- no behaviour changes. This is the format gate failing on PR #715 and, inherited, on #717 and the service seed branch stacked above it. Fixed here so one change clears all three rather than each branch carrying its own. Gates: black, ruff, mypy clean; pytest 795 passed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
WesIngwersen
force-pushed
the
step3_materials_interpolation
branch
from
August 26, 2026 18:31
454ddb4 to
c077b45
Compare
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.
Stacked on #714.
S3's last open item was the interpolation form. It is fitted, and ❌ the
candidate this plan named is not the answer.
First, two different questions were being called "interpolation"
The materials level is observed every year (ASM→2021, AIES 2023), so it never
needed interpolating — §4 rules out doing so. The commodity mix is observed
only at 2017 and 2022, and nothing observes its interior: the fuels share of
the census universe stays between 0.98% and 1.14% across the span, so the coarse
annual partition constrains the mix hardly at all.
❌ The price-carried path is rejected
direct + groupdirect + groupThe level moves with price; the mix does not.
The obvious test — interpolate between two summary years, score the years
between — is circular, and its answer must not be used. BEA carries the last
benchmark forward, so every interior year of a summary span is itself an
interpolation. And since BEA has not incorporated the 2022 Economic Census,
its 2022–2024 tables are still 2017-benchmark carries, so a span ending
anywhere in the nowcast horizon is contaminated at the endpoint as well.
✅ The benchmark detail panel can arbitrate it — a second use for what S0a
built. 2007, 2012 and 2017 are three independent Economic-Census-anchored
observations. Interpolate 2007→2017, score at the observed 2012:
✅ Interpolating beats freezing by 20.1%, geometric beats linear by 7.1%,
and ❌ adopting the newer observation immediately is worse than freezing — so
"just seed every year from the 2022 census" loses to doing nothing.
❌ But do not extend the trend past the last observation
27.4% worse on manufacturing, 41.7% on the whole table. A mix trend does not
persist.
What ships
An asymmetry, every leg measured: geometric between the censuses, 2022 held
flat for 2023–24.
materials_seed(year)is an index on the share (not thelevel — §The 2017 anchor) with the column total held, since Step 3 owns the level
through
GO − VAPRO.The 0.0979 sits alongside §The mix score's independently-computed 0.0949 — the
construction checking out.
census's five-year one. It settles which form; it does not prove the form right.
New CLI:
--form,--seed. Gates:ruff check .clean,mypy bedrockclean(bar 4 pre-existing Windows-only
resourceerrors),pytest795 passed.🤖 Generated with Claude Code