Skip to content

test(us): feed measured pedon elevation into the bulk harness - #399

Merged
johannesparty merged 1 commit into
mainfrom
test/us-bulk-feed-elevation
Sep 29, 2026
Merged

johannesparty merged 1 commit into
mainfrom
test/us-bulk-feed-elevation

Conversation

@johannesparty

@johannesparty johannesparty commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

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, so rank_soils fell back to its internal EPQS (National Map) lookup for every pedon. This change passes the pedon's measured elevation (present for ~76% of cases) into rank_soils instead, 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 None and fall back to rank_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

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>
@johannesparty
johannesparty merged commit 512d6fd into main Sep 29, 2026
7 checks passed
@johannesparty
johannesparty deleted the test/us-bulk-feed-elevation branch September 29, 2026 18:15
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