Repository navigation
test(us): feed measured pedon elevation into the bulk harness - #399
Merged
Merged
Conversation
Pass the pedon's measured elevation (present for ~76% of cases) into rank_soils so the US site score (slope + elevation) is actually exercised, instead of hard-coding pElev=None. Missing cases still fall back to rank_soils' internal EPQS lookup (which resolves only ~6% of the time here). Adds a TODO to consider filling elevation for the missing ~24% later. No algorithm change; affects the bulk harness only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
garobrik
approved these changes
Sep 29, 2026
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.
tldr from Johannes: bulk-test wasn't passing in elevation even when it is in the test data, and the internal EPQS lookup fails most of the time. fix: pass in elevation when we have it.
From claude:
What
The US bulk-test harness hard-coded
pElev=None, sorank_soilsfell back to its internal EPQS (National Map) lookup for every pedon. This change passes the pedon's measured elevation (present for ~76% of cases) intorank_soilsinstead, so the US site score (slope + elevation) is actually exercised. NaN/"NA" →None.Why
The site score's Gower distance only activates with ≥2 non-null site features; bedrock/cracks aren't in this dataset, so without elevation the site score never turns on (slope alone is inert). Measuring showed EPQS resolves only ~6% of the time here (times out on the rest), so the previous harness effectively ran with almost no site score.
Impact on accuracy is small (recall@1 67.0 → 67.2; paired 102 improved / 84 worsened / 0 newly-found), but this makes the harness reflect the production path (client/backend supplies elevation) rather than an unreliable lookup.
Behavior for missing elevation
Cases without a measured value still pass
Noneand fall back torank_soils' internal EPQS lookup (~6% success) — intentionally left in place. A code comment adds a TODO (not done here) to consider filling elevation for the missing ~24% via a reliable DEM lookup so the site score is exercised across the whole set.Scope
Bulk harness only — no algorithm change, no snapshot impact.
🤖 Generated with Claude Code