Place the Mogollon Rim Trail in the White Mountains of Arizona, and refuse a place that lies in none of a trail's states or provinces

A new registry range, white-mountains-arizona, shown as White Mountains, in Arizona. The
validator now fails a record whose place's where shares no state or province with the
record's regions, and place_trails.py no longer places a trail in a place outside its regions.
The rule also caught the Hot Springs Trail (Nevada missing from its regions) and the North
Boundary Trail (British Columbia missing), which now list those regions, and the Sentier
international des Appalaches, whose track carries the Maine IAT into Katahdin Woods and Waters:
that placement is removed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Sonnet 5.5 committed 2026-11-20 12:22:58 -07:00
1 parent 7e4d1de494
commit 3b745f706c
12 files changed
+111 -26

No files matched your search

+7
View File
@@ -151,6 +151,13 @@ def check_record(tid, rec, tdir, registry, errors):
errors.append(f"{where} slug must be a non-empty string")
elif kind in KINDS and (kind, slug) not in registry:
errors.append(f"{where} {kind}/{slug} is not in places.toml")
if kind in KINDS and (kind, slug) in registry:
lies = [str(c) for c in registry[(kind, slug)].get("where") or []]
regions = [str(c) for c in rec.get("regions") or []]
if lies and regions and not set(lies) & set(regions):
errors.append(f"{where} {kind}/{slug} lies in {', '.join(lies)}, none of the "
f"record's regions ({', '.join(regions)}); a place must lie in at "
f"least one of the trail's states or provinces")
if (kind, slug) in seen:
errors.append(f"{where} lists {kind}/{slug} more than once; a place is listed once per record")
seen.add((kind, slug))