Skip to content

Stop NOAA current contexts from repeating the station name - #254

Merged
clarkbw merged 1 commit into
mainfrom
fix/current-contexts
Oct 9, 2026
Merged

clarkbw merged 1 commit into
mainfrom
fix/current-contexts

Conversation

@clarkbw

@clarkbw clarkbw commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

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.yaml that 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:

Why now

The slackwater-ios bump past #223 stops on those three passes. With this branch packed and installed, its full npm run build:data passes: 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 test passes. The new metadata test fails on main and passes here.
  • npm run validate:database: 12,015 stations and 11,988 routed records
  • npx prettier --check on the changed files
  • slackwater-ios npm run build:data against npm pack of this branch

🤖 Generated with Claude Code

@pkg-pr-new

pkg-pr-new Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@slackwater/database@254

commit: d50ca88

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
clarkbw force-pushed the fix/current-contexts branch from 06c9878 to d50ca88 Compare October 9, 2026 04:01
@clarkbw
clarkbw merged commit e046e80 into main Oct 9, 2026
5 checks passed
@clarkbw
clarkbw deleted the fix/current-contexts branch October 9, 2026 04:05
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.

1 participant