Repository navigation
feat: condition grassland biomass on rangeland/pastureland - #11
Conversation
a93ac33 to
f4273a2
Compare
| grassland_carbon = get_grassland_carbon( | ||
| climate_zones=climate_zones, from_pasture=conversion_record.from_pasture | ||
| ) |
There was a problem hiding this comment.
Codex is worried about cache invalidation:
This changes emitted and dropped pasture carbon, but
emit.workflowremains at cache version 1. Existing materializations bypass this calculation entirely; base and head produce the same key for identical tile arguments (verified with30S_060W). That can mix the old and new methodology across cached and uncached tiles. Please invalidate the affected dependency chain before using or releasing this revision: emit,statistical.get_downscaled_luc_emissions,statistical.workflow, andjurisdictional_direct.workflow. Their caches do not incorporate upstream versions, so changing emit alone still leaves previously calculated factors stale. More planned changes do not make the current result reproducible with an existing scratch root.
There was a problem hiding this comment.
and I just saw your note about not doing because more changes are coming... I wonder if that approach makes sense? maybe this is a reason to get some code versioning going?
There was a problem hiding this comment.
Codex also flagged this for #13, here's the consensus result
Following up after reviewing #13: I rechecked the actual cache locations at both PR bases and heads; they are unchanged for identical arguments. The affected chain also includes
trace.workflow: a cached final table bypasses attribution entirely.A coordinated invalidation once the stack is ready seems reasonable, provided it happens before backfill or release. Across #11 and #13 that means emit, statistical downscale, both attribution workflows, and trace. For #13 alone, only the three parquet stages need invalidation.
Code versioning could help, but it needs to account for helper and upstream changes; hashing only a cached wrapper's source would miss these. The existing manual version bumps or a verified purge are sufficient for this release.
There was a problem hiding this comment.
thanks for surfacing this!
yup, not bumping the cache versions allowed me to reuse and reference warmed caches intentionally so that I could save time during the before/after measurements.
I think the main feature a data orchestration system would provide is having caches break when their upstreams change. our current setup presents the risk of downstreams yielding from stale caches, but gen AI is pretty good at flagging this.
|
I skimmed the methodology and it seemed fine, asked codex to take a look too and it agrees, but probably would be good to get some other eyes on that part as well
Why the pasture default is reasonableThe implementation correctly transcribes total above- and below-ground herbaceous biomass and applies the 0.47 carbon fraction. Roots are already included, so an additional root-to-shoot multiplier would double-count them. These are broad defaults: the table gives a nominal 75% uncertainty, so the decimal precision should not imply comparable accuracy for individual pixels. IPCC 2006, Chapter 6, Table 6.4. Orbae v2.3, Table 5 uses the same non-woody pasture assumption. That is a useful consistency check, but agreement between methods using the same input is not independent validation of pasture carbon or final commodity factors. The clarification in Natural grassland and source-class uncertaintyKeeping BLUE for natural grassland until the woody component is resolved is a reasonable interim boundary. Replacing its combined vegetation stock with an herbaceous-only value would omit woody carbon; retaining BLUE does not, however, establish that its current values are correct. The inference that CTrees values of 15–26 Mg/ha are implausible solely because tree canopy is below 10%. Tree canopy is not shrub cover or biomass. GPW's general grassland extent allows up to 50% tree canopy; the below-10% restriction belongs specifically to open shrubland. The pipeline combines natural/semi-natural grassland and open shrubland as rangeland sources, so a separately filtered sample would need to be documented before generalizing that argument. GPW v2 definitions. Likewise, cultivated grassland is a management class, not proof of treelessness. My inference is that a non-woody default can understate losses on woody or silvopastoral pasture. Annual natural/cultivated class flicker also remains important: the existing last-departure rule now selects between materially different carbon stocks. Lower totals alone would not demonstrate better conversion detection. Regional effects and limits of the claimed improvementThe change is not uniformly downward. Calculated from the old and new code tables:
The montane BLUE fallback is explicitly documented and avoids inventing a missing table row. Boreal dry is an exception to the statement in These percentages describe pasture vegetation stock, not total LUC emissions. The reported 3–15% decreases in selected Latin American tiles are plausible, but these have not been independently reproduced them; retaining their inputs and calculation would make that impact claim reviewable. This PR also retains the existing full-source-stock release convention, destination-stock treatment and amortization. It improves the source-stock defaults without independently validating those other assumptions. |
f4273a2 to
a73e113
Compare
jeffseif
left a comment
There was a problem hiding this comment.
probably would be good to get some other eyes on that part as well
good call! you're not the only input on this change -- this was a gap between CS and Orbae and this PR closes that. I think I could have been more clear about that motivation.
| grassland_carbon = get_grassland_carbon( | ||
| climate_zones=climate_zones, from_pasture=conversion_record.from_pasture | ||
| ) |
There was a problem hiding this comment.
thanks for surfacing this!
yup, not bumping the cache versions allowed me to reuse and reference warmed caches intentionally so that I could save time during the before/after measurements.
I think the main feature a data orchestration system would provide is having caches break when their upstreams change. our current setup presents the risk of downstreams yielding from stale caches, but gen AI is pretty good at flagging this.
Background
Previously, grassland biomass was estimated using BLUE's vegetation carbon density. While this is appropriate for rangeland, it estimated pastureland's biomass too high (e.g., 18 tC/ha vs 7.6 for tropical moist and wet zones). Now, biomass (and emissions) are conditioned on the type of grassland. Offline measurements estimate that emissions should fall by 3-15% for several tiles within latin america.
This closes a methodological gap with Orbae 2.3 for pasture, but differences remain for natural grasslands and would require ingestion of CTREES for topping up -- which requires some more investigation. The gap is mentioned in this spreadsheet.
Notes
emit's output, I didn't bump the cache version because more changes are coming