Repository navigation
baselines: independent IDW + NN reference module (scipy optional, #107) - #132
Merged
Merged
Conversation
added 2 commits
October 16, 2026 11:45
- ppgrid/baselines.py: idw() + nearest() on exact k-NN (scipy cKDTree, blocked query), independent of ppgrid.pipeline; BaselineResult carries the full search config (power/k/neighbour policy/search method/scipy version) + measured wall/RSS vs configured limits, with methods() rendering a paper methods-section paragraph - BaselineConfig + load_config: config-driven scale (workload + wall/RSS limits) from bench/config/baselines.json; v1 default = claimed regime (20M pts / 1M queries / <10 min / <32 GB) flagged needs_andryo_confirmation=true (a claim, not a threshold) - domain_from_pipeline(): identical domain for a finished run (same points/CRS/res/grid/box-count coverage mask, seeded holdout; mask independently verified against pullpush.box_count); synthetic_workload + bench/baselines_bench.py harness - scipy as [baselines] optional extra (core install unchanged); scipy tests gated pytest.importorskip; +19 tests (closed-form IDW, NN vs brute force 10k, policy matrix, config validation, domain vs real run, 100k/10k sanity scale)
marzukia
approved these changes
Oct 16, 2026
marzukia
added a commit
that referenced
this pull request
Oct 16, 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.
Scope — issue #107 (B-10 repo side): independent IDW + nearest-neighbour baselines
New
ppgrid/baselines.py:idw(points, values, query, power=2.0, k=8, min_neighbours="k")andnearest(points, query, values=None)— exact k-NN via scipycKDTree, blocked 100k-row queries, zero runtime dependency onppgrid.pipeline/pullpush(the single bridge isdomain_from_pipeline, attribute reads only).[baselines]optional extra — core install and core lock unchanged (verified:uv sync --dry-runwithout extras uninstalls scipy); scipy tests gatedpytest.importorskipbench/config/baselines.json(workload + limits), strict schema. v1 default = claimed regime 20M/1M/<10min/<32GB flaggedneeds_andryo_confirmation: true— limits are reported, never enforcedBaselineResultcarries the exact search config (power/k/policy/k_used/scipy version/CRS) + measured wall & peak RSS vs limits;methods()renders a pasteable paper methods paragraphppgrid.__all__unchanged; import viafrom ppgrid.baselines import ...tests/test_baselines.py): hand-computed IDW closed forms (p=2, p=1), k=1↔nearest, zero-distance coincident, policy matrix, blocked-vs-direct, NN-vs-brute-force, coverage mask byte-equal vspullpush.box_count, domain vs a real Melbourne run, 100k/10k sanity scale with 120s CI wall guardGates (re-run by the reviewer, not worker-claimed)
uv run pytest -x -q→ 569 passed, 2 skipped (pre-existing macOS-only skips)bench/check_anchors.py→ PASS, byte-identical (melb10 + melb500, cinterp)ruff check .+ruff format --check .→ clean;uv lock --check→ exit 0Review
Adversarial review (owner lens: connascence, bugs, fragility, DRY): PASS — no blockers, no majors. 7 minors recorded below, accepted as-is for this PR (candidates for the next tidy wave):
CHANGELOG "Tests: +12" miscount→ fixed on branch (tip now d9e2647)grid_querydocstring: "y increasing with row" is true of internal arrays only; the published GeoTIFF is north-first (row-flipped) — consumer comparing to a rasterio read must flip or map by (x,y)_DEFAULTSdict) — can silently divergedomain_from_pipelinere-derives x0/nx/ny instead of readingp.x0/...(deliberate: works pre-grid(); regression-guarded, but a grid-rule change must touch both)_peak_rss_mib()sampled twice per result (stored ≥ flag value; harmless, peak is monotonic)from_dictstrict validation (named ValueError surfaces later; acceptable)Worker:
pi-bg/20261015-233432-1975030(5bb9ffa + d9e2647). Reviewer:pi-bg/20261016-004811-913082. Verdict:~/.pi-bg-art/review-107-20261015-233432-1975030.md.