Skip to content

feat: split out MILK_CATTLE from BEEF_CATTLE - #47

Merged
jeffseif merged 3 commits into
jeffseif/align-logic-for-crops-pasture-splitfrom
jeffseif/split-cattle-into-beef-milk
Nov 20, 2026
Merged

jeffseif merged 3 commits into
jeffseif/align-logic-for-crops-pasture-splitfrom
jeffseif/split-cattle-into-beef-milk

Conversation

@jeffseif

@jeffseif jeffseif commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Background

Before this, we were assuming the all cattle livestock were for producing beef. This takes head counts (per country, year) for beef and dairy cattle from FAOSTAT and splits cattle emissions proportionally to them.

Notes

  1. This required some additional changes to the FAOSTAT livestock production and patterns datasets to include milking cows and milk, so we took the opportunity to organize primary and fact columns -- both are ingested.
  2. This allowed us to remove livestock commodity names from the taxonomy too
  3. This is applied to STATISTICAL and JURISDICTIONAL_DIRECT_PROXY
  4. We are using national proportions
  5. This is stacked with the other PR's which change attribute and trace, so we'll ride on their cache version bumps

Manual testing

  1. Compare the livestock patterns dataset against known-correct numbers:
SELECT commodity_id, commodity_name, livestock_units
FROM "livestock-patterns.parquet"
WHERE admin_id = 'USA' and year = 2024
;
commodity_id commodity_name livestock_units
866 Cattle 87157400.0
976 Sheep 754500.0
1016 Goats 247000.0
1096 Horses 4972455.43
  1. Compare the production livestock dataset against known-correct numbers and show that dairy makes up ~9% of heads in the USA in 2024:
SELECT commodity_id, commodity_name, heads, production_kg
FROM "production-livestock.parquet"
WHERE admin_id = 'USA' AND year = 2024 AND species = 'CATTLE'
;
commodity_id commodity_name heads production_kg
866 Cattle 87157400.0 NULL
867 Meat of cattle with the bone, fresh or chilled NULL 12289768000.0
882 Raw milk of cattle 9346800.0 102452123000.0
  1. Ran the Matopiba tiles (which were refreshed in fix: align allocations across the two statistical algorithms #46) and found: a reduction of BEEF_CATTLE by 0.076 * 0.85 = 6.46%; ~zero movement in UNATTRIBUTED; agreement between S and JDP for all livestock results, DROPPED, and PASTURE;

…ity instead of species

Extend production to include meat and milk for all species
…ommodities, by proportion of head counts from FAOSTAT
@jeffseif
jeffseif requested a review from blallen November 20, 2026 00:21
@jeffseif
jeffseif added this pull request to stack #45 November 20, 2026 00:22

@blallen blallen left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐑

@jeffseif
jeffseif merged commit f151e13 into main Nov 20, 2026
2 checks passed
@jeffseif
jeffseif deleted the jeffseif/split-cattle-into-beef-milk branch November 20, 2026 19:02
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.

2 participants