Repository navigation
fix: align allocations across the two statistical algorithms - #46
Merged
jeffseif merged 5 commits intoNov 20, 2026
Conversation
…ringing alignment with peatland conversion and JDP
jeffseif
force-pushed
the
jeffseif/align-logic-for-crops-pasture-split
branch
from
November 19, 2026 21:58
c4111fc to
5ff8f23
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.
Background
This is another issue Claude spotted
This issue
Conceptually, we want statistical allocation to take place in two stages. First, land conversions are split into those whose destination is cropland and those whose destination is pastureland; second within each destination emissions are all allocated among crops or livestock.
JURISDICTIONAL_DIRECT_PROXYwas doing this correctly, butSTATISTICALwas pooling crop and pasture expansions across cropland- and pastureland-destined emissions. The peatland conversion pulse was already split this way, with its own functions.The fix is to take peatland conversion handling and apply it across all three emissions components (forest, grassland, and peatland conversion). This is one of those rare bugfixes which results in a net deletion of code, because logic that was conditional is now general. It moves ~80 Mt of forest and grassland emissions from crops to grazing worldwide, including ~100 Mt in Brazil.
The necessary bumps for
statisticalandtraceworkflows are applied within this PR and cover the parent branches in the stack.I also took the opportunity to refresh the Matopiba figure in the readme.
Manual testing
Compared the Matopiba tiles (
00N_050W,10S_050W) against thev202611snapshot and verified:DROPPED... except for the one-cell-wide province which became nonzero due to the fix in the fix: two more edge cases in the expansion-share statistical allocation #44BEEF_CATTLE + PASTUREnow match the proxy numbers