Repository navigation
feat: compute emissions factors for JD proxy allocation - #29
Merged
jeffseif merged 7 commits intoNov 6, 2026
Merged
Conversation
Change index from commodity_name to commodity_id Change commodity_name to FAOSTAT name
But leave our invented mappings
jeffseif
commented
Nov 6, 2026
Comment on lines
+152
to
+153
| # The publisher's crop table (`CROPS_matching_v17.xlsx` in figshare's `CODES.zip`), through | ||
| # the authors' 2020 FAOSTAT extract. Both kapok crops are 310, kapok fruit |
Member
Author
There was a problem hiding this comment.
these are provided by the publisher
Comment on lines
+306
to
+309
| # FAOSTAT's own items, where the publisher's table names none or a retired one | ||
| tang_cropgrids.Crop.FLAX.name: 771, # replaced 773, flax fibre and tow | ||
| tang_cropgrids.Crop.GREENBROADBEAN.name: 420, | ||
| tang_cropgrids.Crop.JUTELIKEFIBER.name: 782, # formerly jute-like fibres |
Member
Author
There was a problem hiding this comment.
these probably should have been provided by the publisher
Comment on lines
+310
to
+312
| # Judgement: FAOSTAT's dry chillies and peppers names Pimenta, and popcorn is maize grain | ||
| tang_cropgrids.Crop.PIMENTO.name: 689, | ||
| tang_cropgrids.Crop.POPCORN.name: 56, |
Member
Author
There was a problem hiding this comment.
these are judgement calls which are up for discussion!
Comment on lines
+313
to
+329
| # Fodder, which FAOSTAT has no item for | ||
| tang_cropgrids.Crop.ALFALFA.name: InventedCommodityId.ALFALFA, | ||
| tang_cropgrids.Crop.BEETFOR.name: InventedCommodityId.BEETS_FOR_FODDER, | ||
| tang_cropgrids.Crop.CABBAGEFOR.name: InventedCommodityId.CABBAGE_FOR_FODDER, | ||
| tang_cropgrids.Crop.CARROTFOR.name: InventedCommodityId.CARROTS_FOR_FODDER, | ||
| tang_cropgrids.Crop.CLOVER.name: InventedCommodityId.CLOVER, | ||
| tang_cropgrids.Crop.FORNES.name: InventedCommodityId.FORAGE_PRODUCTS_OTHER, | ||
| tang_cropgrids.Crop.GRASSNES.name: InventedCommodityId.GRASSES_OTHER, | ||
| tang_cropgrids.Crop.LEGUMENES.name: InventedCommodityId.LEGUMES_OTHER, | ||
| tang_cropgrids.Crop.MAIZEFOR.name: InventedCommodityId.MAIZE_FOR_FORAGE_AND_SILAGE, | ||
| tang_cropgrids.Crop.MIXEDGRASS.name: InventedCommodityId.MIXED_GRASSES_AND_LEGUMES, | ||
| tang_cropgrids.Crop.OILSEEDFOR.name: InventedCommodityId.GREEN_OILSEEDS_FOR_FODDER, | ||
| tang_cropgrids.Crop.RYEFOR.name: InventedCommodityId.RYE_GRASS_FOR_FORAGE_AND_SILAGE, | ||
| tang_cropgrids.Crop.SORGHUMFOR.name: InventedCommodityId.SORGHUM_FOR_FORAGE_AND_SILAGE, | ||
| tang_cropgrids.Crop.SWEDEFOR.name: InventedCommodityId.SWEDES_FOR_FODDER, | ||
| tang_cropgrids.Crop.TURNIPFOR.name: InventedCommodityId.TURNIPS_FOR_FODDER, | ||
| tang_cropgrids.Crop.VEGETABLENES.name: InventedCommodityId.VEGETABLES_AND_ROOTS_FOR_FODDER, |
Member
Author
There was a problem hiding this comment.
we decided to leave all of the fodder crops separate, with their own invented FAOSTAT item codes (negative to not collide with real ones).
alternatively, these could be combined into a single fodder crop item or combined into their "for humans" crops.
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 stacks on #28
This implements trace for JDP, including pulling national crop production data from FAOSTAT, updating our FAOSTAT ingest to cover all crops instead of just the allowlist for MAPSPAM, populating the CROPGRIDS <-> FAOSTAT taxonomy crosswalk, and dropping a bunch of hardcoded mappings which we can now parse directly from FAOSTAT.
The changes
Notes
Manual testing
traceforSand observed matching results (within floating epsilon)traceforJDPand verified that national productions matched with FAOSTATSandJDPnumbers against each other, and it shows that allocation factors for the smaller-crop-area crops have much less emissions allocated to them. Definitely worth digging into once we have a global refresh