Skip to content

Add conditions rating, report and best-time/best-spot answers - #31

Merged
xquantize merged 1 commit into
feature/conditionsfrom
agent/conditions-rating-1588
Oct 14, 2026
Merged

xquantize merged 1 commit into
feature/conditionsfrom
agent/conditions-rating-1588

Conversation

@xquantize

Copy link
Copy Markdown
Owner

Part of Stage 3 (#21). Implements #30. Targets feature/conditions.

Every judgement in a conditions answer is made here, in code. A later reply only phrases this report.

  • rate_hour classifies the primary swell (swell_height_m, period, direction), the wind, and the tide, then scores the hour from 0 to 10. Weights are named constants in thresholds.py.
  • Swell size and kind are the base. Flat is 0 and ignores wind, window and tide. Small windswell is low. Fun and solid groundswell are high. Big uses the same base as solid; the score is not a safety call, and hazards stay on the report.
  • Wind moves that base: glassy and offshore up, cross-offshore a smaller lift, cross-shore unchanged, cross-onshore and onshore down. Strong and very strong winds reduce an offshore bonus and do not turn it into a penalty.
  • Swell outside the window caps the score at 2. Marginal swell takes a point off. A tide that suits adds a point and one that does not takes a point off, but only when the tide call is certain. A conflicting or unknown profile, or a missing tide, changes nothing.
  • Labels are poor (0-2), fair (3-4), good (5-6), great (7-8) and epic (9-10). Each factor keeps the points it actually added, after the window cap and the 0-10 bounds, and those points sum to the score.
  • build_report rates the hours in a half-open window and records the best hour (highest score, earlier on a tie). Uncertainties cover an unverified profile, a conflicting or unknown tide, missing swell or wind, a missing tide, and the forecast fetch time. Hazards come from the profile. Attributions are Open-Meteo and LINZ.
  • rank_spots orders reports by that best hour. Equal scores keep the earlier hour, then the spot id.
  • swellsense check SPOT [--hours 12] prints the hourly score, label and reasons, then uncertainties, hazards and attributions. swellsense check --all prints the ranking.

bash scripts/check.sh passed (260 tests). A live swellsense check mount-main-beach --hours 6 scored a small onshore windswell at 0 and the same afternoon's offshore windswell at 5, with the conflicting tide contributing 0. swellsense check --all --hours 6 ranked the seven Bay of Plenty spots by that best hour.

Open in Web Open in Cursor 

Score each hour in code from the wind, swell and tide classifiers, then
report the best hour and rank spots. The check command prints that report
with the forecast and tide attributions.

Co-authored-by: Zane <xquantize@users.noreply.github.com>
@xquantize
xquantize marked this pull request as ready for review October 14, 2026 22:58
@xquantize
xquantize merged commit 33a0484 into feature/conditions Oct 14, 2026
1 check passed
@xquantize
xquantize deleted the agent/conditions-rating-1588 branch October 14, 2026 22:58
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