Skip to content

fix: two more edge cases in the expansion-share statistical allocation - #44

Merged
jeffseif merged 3 commits into
jeffseif/improve-validationfrom
jeffseif/bugfixes-for-statistical
Nov 20, 2026
Merged

jeffseif merged 3 commits into
jeffseif/improve-validationfrom
jeffseif/bugfixes-for-statistical

Conversation

@jeffseif

Copy link
Copy Markdown
Member

Background

Claude spotted these

The fixes

  • e1fee52 get_hectares_per_pixel's calculation uses the spacing between pixels ... but when a raster is only one pixel wide or tall, it yields NaN which is coalesced to zero downstream. We were calling the function after clipping to jurisdictions which could be smaller than the coarse MAPSPAM grid. The fix is to call the function on the tile before clipping
  • 38a6f33 ensure that 2020 individual crops broken out from 2010 groups are tracked consistently before/after when calculating their expansion (for expansion-share allocation)
  • a third commit for docs

@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.

fixes look good, both have opportunities for generalization later

@jeffseif
jeffseif merged commit 255e792 into main Nov 20, 2026
2 checks passed
@jeffseif
jeffseif deleted the jeffseif/bugfixes-for-statistical 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