Repository navigation
Add conditions classifiers: wind, swell and tide relative to a spot - #29
Merged
Merged
Conversation
Pure judgements compare a spot profile with one set of numbers. Thresholds live in one module so they can be tuned without rewriting the rules. 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 #28. Targets
feature/conditions.Pure functions that judge one aspect of conditions for a spot. No combined score yet.
angle_diffis the short compass step (350° and 10° are 20° apart).in_windowtreats an arc that crosses north, such as 330° to 60°, as one window.(facing_deg + 180) % 360. Boundaries stay with the more offshore side: 45° is offshore, 135° is cross-onshore. Strength boundaries belong to the stronger class: 5 kn is light, 25 kn is very strong. Under 5 kn,qualityis glassy andrelationstill records the direction.in_windowisin,marginalwithin 15° outside the window, oroutside. Period: under 8 s windswell, 8 s to under 12 s mixed, 12 s and over groundswell. Size uses open-ocean height, not breaking-wave height: under 0.3 m flat, 0.3 m small, 0.8 m fun, 1.5 m solid, 2.5 m big.best_tides, and is also rising whentide_rising_betteris true. False and none do not require a falling tide.uncertainis true unlesstide_confidenceis agreed. A missing tide is unknown, not a failed tide.Thresholds are named constants in
src/swellsense/conditions/thresholds.py.bash scripts/check.shpassed (206 tests). Against the real profiles and the Tauranga tide fixture at 08:00 NZDT on 2026-01-01: Mount Main Beach was "12 kn from 225°, offshore for a beach facing 45°", a 3 kn onshore wind was glassy, and the mid falling tide suited Mount but was uncertain. The same tide did not suit Waihi Beach, whose profile wants a rising mid.