Thermograph monorepo: graded-climate API + SSR frontend + infra, domain-specific containerized deploys
Find a file
Emi Griffith 38a39df6ab Extract payload builders into views.py; load places index at startup (#42)
app.py had grown three co-resident strata: HTTP/caching plumbing, payload
assembly, and search policy. This moves the payload layer — the four
build_* functions, cal_span clamping, hist_end, PAYLOAD_VER, NullRun and
their helpers — into a new views.py with no web dependencies (pure moves,
public names). app.py keeps routing, ETag/derived-store plumbing, and
page serving; migrate.py imports views instead of reaching into app's
privates.

That import previously constructed the whole FastAPI app and — because
places.start_loading() ran at import time — kicked off a background
GeoNames download from an offline batch script. The index load now hangs
off the app's lifespan hook, so it fires when a server starts, not when
the module is imported (tests, migrate).

New tests: cal_span clamping (months-back default, record bounds, 2-year
cap, inversion), builder shapes (grade window ordering, day obs from the
recent bundle, forecast future-only), a regression test that build_day
degrades to climatology when the recent fetch fails, and a subprocess
layering guard that importing views/migrate pulls in neither FastAPI nor
the app module and starts no index download.
2026-07-11 19:43:41 +00:00
tests Extract payload builders into views.py; load places index at startup (#42) 2026-07-11 19:43:41 +00:00
app.py Extract payload builders into views.py; load places index at startup (#42) 2026-07-11 19:43:41 +00:00
audit.py Initial commit: app + 2026-07-10 17:29:47 -07:00
climate.py Typo-tolerant location search suggestions (#33) 2026-07-11 15:36:14 +00:00
grading.py Initial commit: app + 2026-07-10 17:29:47 -07:00
grid.py Worldwide coverage: grade any point on Earth (#32) 2026-07-11 15:02:28 +00:00
migrate.py Extract payload builders into views.py; load places index at startup (#42) 2026-07-11 19:43:41 +00:00
places.py Typo-tolerant location search suggestions (#33) 2026-07-11 15:36:14 +00:00
requirements-dev.txt Add backend test suite; gate direct pushes; serialize LAN deploys (#41) 2026-07-11 19:37:49 +00:00
requirements.txt Initial commit: app + 2026-07-10 17:29:47 -07:00
store.py Fix compare place names (Nominatim burst) + weekly duplicate location name (#29) 2026-07-11 09:03:57 +00:00
views.py Extract payload builders into views.py; load places index at startup (#42) 2026-07-11 19:43:41 +00:00