Repository navigation
Add conditions rating, report and best-time/best-spot answers - #31
Merged
Merged
Conversation
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>
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.
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_hourclassifies 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 inthresholds.py.build_reportrates 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_spotsorders 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 --allprints the ranking.bash scripts/check.shpassed (260 tests). A liveswellsense check mount-main-beach --hours 6scored 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 6ranked the seven Bay of Plenty spots by that best hour.