Thermograph monorepo: graded-climate API + SSR frontend + infra, domain-specific containerized deploys
Find a file
Emi Griffith 7aaad17603 Deduplicate the data-layer plumbing in climate.py and grading.py (#46)
climate.py repeated the same four mechanical patterns:
- the Open-Meteo daily params dict (3x) -> _om_daily_params(cell, **window)
- the doy attach line (6x) -> _with_doy
- makedirs + drop-doy + zstd to_parquet (3x) -> _write_cache
- the identical _to_frame/_nasa_to_frame tail (feels-like, valid-day
  filter, doy) -> _finalize_frame

grading.py encoded the tier tables twice — TEMP_BANDS/RAIN_BANDS plus the
hand-aligned _TEMP_LADDER/_RAIN_LADDER ('kept aligned' by comment). The
ladders are now derived from the bands (_ladder_from; verified
byte-identical to the old tables before landing), so tier boundaries have
exactly one definition. grade_range's inline dry-streak walk is replaced
with the existing dry_streaks(); its per-(doy,var) sample cache now also
memoizes the window mask per doy instead of recomputing it once per
metric (9x per day-of-year).

New tests pin the refactor: _to_frame schema/day-filter/missing-series
tolerance, the combined feels-like side selection, NASA unit conversions
and fill-sentinel handling, _om_daily_params windows, and _write_cache
stripping the derived doy column.
2026-07-11 20:05:57 +00:00
tests Deduplicate the data-layer plumbing in climate.py and grading.py (#46) 2026-07-11 20:05:57 +00:00
app.py Move the suggestion policy into places.py (#45) 2026-07-11 20:00:24 +00:00
audit.py Initial commit: app + 2026-07-10 17:29:47 -07:00
climate.py Deduplicate the data-layer plumbing in climate.py and grading.py (#46) 2026-07-11 20:05:57 +00:00
grading.py Deduplicate the data-layer plumbing in climate.py and grading.py (#46) 2026-07-11 20:05:57 +00:00
grid.py Worldwide coverage: grade any point on Earth (#32) 2026-07-11 15:02:28 +00:00
migrate.py Single-source cache identity; shared fetch preamble and cache flow (#43) 2026-07-11 19:49:15 +00:00
places.py Move the suggestion policy into places.py (#45) 2026-07-11 20:00:24 +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 Single-source cache identity; shared fetch preamble and cache flow (#43) 2026-07-11 19:49:15 +00:00