Repository navigation
Stop NOAA current contexts from repeating the station name - #254
Merged
Merged
Conversation
commit: |
Since NOAA currents keep their qualifier on the name (#223), the water-body lookup could hand back the very water the name already gives: "Rich Passage, East End" got the context "Rich Passage", and 59 current stations read their water twice. The lookup skipped a water only when it matched the whole name; it now skips one matching any comma-separated part of it, and falls through to the next water or the nearest town. No tide station's context changes. Three remote passes have no water or town within reach once their restated context is gone, and a consumer would borrow a region from a gauge 280-350 km away. They get curated contexts: Krysi Pass and Sea Lion Pass are in the Aleutian Islands (the name already says Rat Islands), and Meyers Narrows is by Klemtu, British Columbia. Meyers Narrows also finds no town because it is labelled United States; that is #253. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
clarkbw
force-pushed
the
fix/current-contexts
branch
from
October 9, 2026 04:01
06c9878 to
d50ca88
Compare
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.
Since #223 keeps a NOAA current's qualifier on its name, the water-body lookup could return the very water the name already gives. "Rich Passage, East End" got the context "Rich Passage", and 59 current stations read their water twice, against the rule at the top of
metadata/corrections.yamlthat a context "must never restate the name".The lookup skipped a water only when it matched the whole name. It now skips one that matches any comma-separated part of the name, and falls through to the next water or the nearest town: "Rich Passage, East End" now reads "Puget Sound", and "South Reach, Newark Bay" reads "Bayonne, NJ". Measured on a full build, exactly those 59 current stations change and no tide station does. Comparing words in either direction (
namesOverlap, as the town step does) would also have caught them, but it changed about 450 stations, mostly for the worse ("Halifax" lost "Halifax Harbour"), so the check stays at name parts.Three remote passes then have no water or town within reach, and slackwater-ios refuses to borrow a region line from a gauge that far away (Krysi Pass 352 km, Sea Lion Pass 336 km, Meyers Narrows 281 km). They get curated contexts:
noaa/PCT5721Krysi Pass, Rat Islands andnoaa/PCT5726Sea Lion Pass, Rat Islands: "Aleutian Islands", since the name already says Rat Islandsnoaa/PCT2576Meyers Narrows, Meyers Passage: "Klemtu, British Columbia". Its town lookup finds nothing because the station is labelled United States, which is Four NOAA current stations in British Columbia are labelled United States #253.Why now
The slackwater-ios bump past #223 stops on those three passes. With this branch packed and installed, its full
npm run build:datapasses: the farthest gauge any current borrows a region from is 176 km, under its 250 km guard, and its slugs and station index build. This should go out in the next release (tonight's, after 00:00 UTC) so the app and site can bump to it together.Testing
npm testpasses. The new metadata test fails onmainand passes here.npm run validate:database: 12,015 stations and 11,988 routed recordsnpx prettier --checkon the changed filesnpm run build:dataagainstnpm packof this branch🤖 Generated with Claude Code