Repository navigation
feat(snapshots): add A_margin as a snapshot object - #1138
Conversation
Wire the Cornerstone margin allocation matrix into SNAPSHOT_NAMES / generate_snapshots so the next full cut emits A_margin.parquet for CEDA-style N @ A_margin handoffs. Document the interim GCS sidecar.
|
@WesIngwersen - until we generate a new snapshot here, the |
|
Confirm the product is a 405x405 matrix with these contents for the 2024 margins. No price adjustment occurs since nominal value is the same as the given values, because |
|
@WesIngwersen could you approve this when you have a moment? Still needed for future Happy to land this alongside #1144; follow-on for time-series MUT rebuild + v1.0 retarget is #1146. |
cc:
Related: #1144, #1146, https://github.com/cornerstone-data/ceda/issues/547
What changed? Why?
Adds
A_margintoSNAPSHOT_NAMESand writes it fromderive_cornerstone_A_marginingenerate_snapshots, so the next canonical snapshot cut emits the Cornerstone commodity x commodity margin allocation matrix next toPhi. Documents the interim GCS sidecar pattern (same as Phi #649) and the CEDA handoff contractN_margin = N @ A_margin(multiply by the consumer's N after mapping codes). Does not bump.SNAPSHOT_KEY.Impact
No change to published USA A/B/q/N or SEF outputs; consumers that load snapshots gain
A_margin.parqueton the next full cut. Until then, CEDA loads the commodity-split interim from #1144 (not the early buyer-split object under the v0.6 snapshot key).Testing
Local derive under
2025_usa_cornerstone_v0_6: 405 x 405, 24 nonzero margin-provider rows inside the Transportation/Wholesale/Retail map, no NaN/Inf; spot-checked goods columns and confirmed col-sum > 1 cases match the filtered margins table ratios.Heads-up
CEDA interim handoff (commodity-split; #1144):
gs://cornerstone-default/snapshots/a_margin/v0.6.0_5d40d42/A_margin.parquetThis PR only registers the snapshot name for future full cuts. Time-series MUT rebuild + v1.0 retarget: #1146.
Evidence
sector(buyer-split derive under canonical v0.6 used for wiring smoke-check)485000,492000,48A000,493000,4200ID221100column all zero