prop/test/microwaveprop/pskr
Graham McIntire 7ee19c5b6a
perf+test: cache nearest_hrrr per cell, batch pg_inherits, +property tests
Two performance fixes the property tests pinned down:

* CalibrationSampler.build_for_hour/1 walked every cell through
  nearest_hrrr/3 twice — once in the producer and again in
  build_sample. Now computed once into a (band, lat, lon) → hrrr_or_nil
  map, halving the O(cells × profiles) scan (~10M comparisons saved
  per fire at typical sizes).
* PartitionManager.ensure_quarterly_partitions/2 issued one
  pg_inherits scan per (parent × lookahead). Refactored to one scan
  per parent with in-memory coverage check across all quarters.

Property tests for both modules:

* PartitionManager: tile-coverage invariant (no gaps, no overlaps),
  exact 3-month bounds, name format, multi-call idempotence,
  multi-parent independence — caught a real NaiveDateTime sort bug
  in the original test helpers. Default Enum.sort_by/2 falls back to
  term comparison on NaiveDateTime; now uses NaiveDateTime as the
  comparator module.
* CalibrationSampler: enqueued points = unique missing midpoints,
  empty enqueue when fully covered, sample row count invariant under
  HRRR availability.

Saved operational gotchas to CLAUDE.md (Oban leader election spans
all app=prop pods, kubectl exec deploy/prop ambiguity, half-year
partition coexistence, HRRR f000 publish lag).

3310 tests + 228 properties, 0 failures.
2026-05-05 17:40:13 -05:00
..
aggregator_test.exs feat(pskr): preserve full locator precision from MQTT spots 2026-05-04 12:42:46 -05:00
calibration_sampler_property_test.exs perf+test: cache nearest_hrrr per cell, batch pg_inherits, +property tests 2026-05-05 17:40:13 -05:00
calibration_sampler_test.exs test(pskr): two-pass HRRR pipeline integration test + tighter specs 2026-05-05 17:31:17 -05:00
mqtt_test.exs refactor(pskr): drop emqtt, talk MQTT 3.1.1 over :gen_tcp directly 2026-05-04 09:52:34 -05:00
recalibrator_test.exs feat(pskr): weekly recalibration analysis on the calibration corpus 2026-05-04 16:18:17 -05:00