Merge seasons-ship-3 into nav-and-filters: the seasons ship and the places ship touched the same trail files; both sides kept
This commit is contained in:
commit
fd2e6fc6c7
122 files changed
+7437
-211
No files matched your search
@@ -0,0 +1,26 @@
|
||||
name: Season check
|
||||
|
||||
# Once a month, rerun the machine estimate for every estimated season and the fit against the
|
||||
# sourced seasons. A failure lists the estimates whose inputs have changed; see docs/audit.md.
|
||||
on:
|
||||
schedule:
|
||||
- cron: "17 6 1 * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 120
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
- id: month
|
||||
run: echo "month=$(date +%Y-%m)" >> "$GITHUB_OUTPUT"
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/longhikes-climate
|
||||
key: climate-${{ steps.month.outputs.month }}
|
||||
restore-keys: climate-
|
||||
- run: python3 tools/estimate_season.py check
|
||||
@@ -8,6 +8,16 @@
|
||||
- Park outlines are from the National Park Service, Land Resources Division (public domain) and, for Canada, Environment and Climate Change Canada's CPCAD (Open Government Licence, Canada). Wilderness outlines are from Wilderness Connect, University of Montana (public domain). Range outlines are from the GMBA Mountain Inventory v2 (Snethlage et al. 2022, CC BY 4.0). `SOURCES.md` has the terms.
|
||||
- For contributors: every trail now carries its places, the date they were checked and, for a trail with a track, which track was measured (`places_checked`, `places_track` and `[[place]]` in the trail's file; `places.toml` holds the places). `tools/place_trails.py` measures and writes them, the validator fails a trail with no check date or with a track changed since, and a monthly workflow downloads every outline again and re-measures every track against it (`--check --refresh`; the workflow keeps no cache). `docs/audit.md` is the new checklist for the monthly audit, with a step to look again at each place that rests on a page.
|
||||
|
||||
## 2026-11-20 - Every trail now has a season
|
||||
|
||||
- All 223 trails now have a season. 148 come from a page that states one. 6 were set by judgement from pages that disagree, none of them the trail's own, its association's or its route author's. The other 69 are estimates, because no page states a season for them.
|
||||
- An estimate never reads as a fact. A trail's page shows it as "About April to October", with a short note: no page states a season, it was estimated from the climate at the trail's elevation and from similar trails, what sets the season there, how confident the estimate is, and that people do walk the trail outside those months. Lists and tables mark an estimate, and it is left out of the data that search engines read. The 6 set from pages that disagree read the same way, and their note says the pages differ.
|
||||
- How an estimate is made: a reviewer is given the trail's location and elevation, its monthly climate (CHELSA, public domain, with NOAA elevation), a climate model's own estimate, and the ten most similar trails whose season a page states, and sets the months. The climate model alone matched 67.6 percent of the known seasons within a month at each end, under the 75 percent the owner asked for, so it is one input and not the answer.
|
||||
- How it was tested: the same reviewers estimated the 148 trails whose season a page does state, from packets with that season hidden. They matched 114 of them (77.0 percent) within a month at each end: 48 of 52 where they were highly confident, 55 of 76 at medium confidence, and 11 of 20 at low. The reference page and the glossary give these figures, read from a data file.
|
||||
- The "By month" lists now include every trail and mark the estimated seasons, and the note that only some trails have a season is gone. The month filter has a box to leave estimated seasons out.
|
||||
- An estimate is replaced when a page that states a season is found. The monthly audit searches again for every one, and a monthly check reruns the climate model for each estimate and flags any whose inputs have changed.
|
||||
- For contributors: `hike.season_basis` may now be `estimate`, with a `hike.season_method` that ends "Confidence: high.", "Confidence: medium." or "Confidence: low." and one source that cites the climate data; a season is required on every trail, and the validator refuses an estimate that cites an ordinary page. The packet builder and the blind scorer are `tools/season_judge.py`, the reviewers' instruction is `docs/season-judging.md`, and the audit steps are in `docs/audit.md`.
|
||||
|
||||
## 2026-11-20 - Seasons for 39 more trails
|
||||
|
||||
- 39 trails that had no season now have one, each read from a page and marked with where it came from. 10 of them are from the body that manages the trail, the trail's own association, or for a route its author; the other 29 are from other pages, and 2 of those rest on two pages from different publishers. Where a page gives only a start date, one segment or a word like "spring", the season says only that.
|
||||
|
||||
@@ -27,3 +27,7 @@ The files `elevation.json` in the trail directories are computed from each trail
|
||||
- ArcticDEM terrain data DEM(s) were created from DigitalGlobe, Inc., imagery and funded under National Science Foundation awards 1043681, 1559691, and 1542736.
|
||||
- Global ETOPO1 terrain data U.S. National Oceanic and Atmospheric Administration.
|
||||
- Terrain Tiles was accessed from https://registry.opendata.aws/terrain-tiles.
|
||||
|
||||
## Climate
|
||||
|
||||
A season marked as estimated is worked out from monthly climate at the trail's elevation. The climate values are monthly means of daily maximum temperature for 1981 to 2010 from CHELSA V2.1 (https://www.chelsa-climate.org/datasets/chelsa_climatologies, released under CC0 1.0), read by `tools/season_climate.py`, with grid elevation from NOAA's ETOPO 2022 relief model (unrestricted version, https://www.ncei.noaa.gov/products/etopo-global-relief-model). CHELSA asks for this citation: Karger, D. N., Conrad, O., Boehner, J., Kawohl, T., Kreft, H., Soria-Auza, R. W., Zimmermann, N. E., Linder, H. P., Kessler, M. (2017). Climatologies at high resolution for the earth's land surface areas. Scientific Data 4, 170122, https://doi.org/10.1038/sdata.2017.122. Only the estimated seasons derive from it. Each estimated record names it in its sources, and the estimates themselves say they are estimates wherever they are shown.
|
||||
@@ -76,7 +76,11 @@ shape = "point-to-point"
|
||||
terrain = ["desert", "canyon", "alpine"]
|
||||
travel = "some-cross-country"
|
||||
caution = "The author says no part is technical, but the route involves exposure, deep pools, long dry stretches and a Colorado River crossing that needs a packraft or a ride from a river party."
|
||||
checked = "2026-11-15"
|
||||
checked = "2026-11-20"
|
||||
season = "April to June and September to October"
|
||||
months = [4, 5, 6, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Desert heat in summer and snow in the Henrys, La Sals and Bryce country in winter leave spring and fall. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "http://www.acrossutah.com/wordpress/the_route/"
|
||||
@@ -125,6 +129,11 @@ slug = "pine-valley-mountain-wilderness"
|
||||
basis = "stated"
|
||||
source = "http://www.acrossutah.com/wordpress/the_route/"
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -153,3 +162,12 @@ basis = "The page says: \"and then follows the Grandview Trail through the pines
|
||||
basis_url = "http://www.acrossutah.com/wordpress/the_route/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: April to June and September to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -58,7 +58,11 @@ shape = "point-to-point"
|
||||
terrain = ["alpine", "lakes"]
|
||||
travel = "trail"
|
||||
caution = "The Forest Service lists the trail as open to hiking, biking and motorcycle trail riding, with motorized use in specific stretches only and Jewel Basin Special Area rules to check."
|
||||
checked = "2026-11-16"
|
||||
checked = "2026-11-20"
|
||||
season = "July to September"
|
||||
months = [7, 8, 9]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Heavy winter snow at 7,000 feet in the Swan Range melts out by mid-July, and snow returns in October. Confidence: high."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://web.archive.org/web/20201201005308/https://www.fs.usda.gov/recarea/flathead/recreation/recarea/?recid=66288&actid=51"
|
||||
@@ -81,6 +85,11 @@ slug = "rocky-mountains"
|
||||
basis = "track"
|
||||
km = 87.5
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -119,3 +128,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: July to September."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -59,7 +59,11 @@ end = "Conestogo, Ontario"
|
||||
shape = "point-to-point"
|
||||
terrain = ["farmland"]
|
||||
travel = "trail"
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "April to October"
|
||||
months = [4, 5, 6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Winter snow and early-spring mud on Ontario farmland end with the thaw, and the walk runs until late fall. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://avontrail.ca/"
|
||||
@@ -71,6 +75,11 @@ url = "https://avontrail.ca/about/"
|
||||
publisher = "Avon Trail Association"
|
||||
facts = ["summary", "start", "end", "terrain", "travel"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -99,3 +108,12 @@ basis = "OpenStreetMap relation 3442182 gives no roles, and the Avon Trail Assoc
|
||||
basis_url = "https://www.openstreetmap.org/relation/3442182"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: April to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -59,7 +59,11 @@ shape = "point-to-point"
|
||||
high_point = "Apple Pie Hill"
|
||||
terrain = ["forest"]
|
||||
travel = "trail"
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and September to November"
|
||||
months = [3, 4, 5, 9, 10, 11]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Flat Pine Barrens walking is best when it is cool, away from summer heat, ticks and biting flies. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://batona.wildapricot.org/"
|
||||
@@ -81,6 +85,11 @@ url = "https://dep.nj.gov/wp-content/uploads/parksandforests/docs/sps/batona-map
|
||||
publisher = "New Jersey State Park Service"
|
||||
facts = ["high_point"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -100,3 +109,12 @@ basis = "The pages named in the logo note were searched, and none shows an emble
|
||||
basis_url = "https://batona.wildapricot.org/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: March to May and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -61,7 +61,11 @@ end = "Kingston Bay, Massachusetts"
|
||||
shape = "point-to-point"
|
||||
travel = "trail"
|
||||
unfinished = "More than 230 miles are dedicated across 37 cooperating towns, and the final gaps are still being closed."
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and September to November"
|
||||
months = [3, 4, 5, 9, 10, 11]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Humid, buggy summers and icy winters in low-lying eastern Massachusetts leave spring and fall, though it can be walked all year. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.baycircuit.org/"
|
||||
@@ -73,6 +77,11 @@ url = "https://www.baycircuit.org/about/"
|
||||
publisher = "Bay Circuit Alliance"
|
||||
facts = ["summary", "start", "end", "shape", "unfinished"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Bay Circuit Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -106,3 +115,12 @@ basis = "OpenStreetMap relation 12779888 gives no roles. The Bay Circuit Allianc
|
||||
basis_url = "https://www.baycircuit.org/maps-guides/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: March to May and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -55,7 +55,11 @@ end_lonlat = [-91.207, 29.699]
|
||||
shape = "point-to-point"
|
||||
terrain = ["forest"]
|
||||
caution = "The association does not say how much of the route is trail and how much is road or town walking. Its trails page, read on 2026-11-19, lists the Hwy 182 bridge over the Atchafalaya River, between Berwick and Morgan City, as closed, and gives a temporary southern end at the Berwick Branch Library, 3512 5th Street. The notice carries no date of its own and gives the reopening as fall 2026. Check with the association before going."
|
||||
checked = "2026-11-16"
|
||||
checked = "2026-11-20"
|
||||
season = "November to April"
|
||||
months = [1, 2, 3, 4, 11, 12]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Summer heat, humidity, mosquitoes and storms in Louisiana push hiking into the cool, dry winter and early spring. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.bayoustatetrail.com/"
|
||||
@@ -87,6 +91,11 @@ url = "https://services1.arcgis.com/fXHQyq63u0UsTeSM/ArcGIS/rest/services/LDWF_B
|
||||
publisher = "Louisiana Department of Wildlife and Fisheries, boat launches layer: Ivan Lake Boat Ramp on Ivan Lake Road, inside Ivan Lake Recreation Area; the point is the wildlife agency's boat ramp, not a surveyed trailhead"
|
||||
facts = ["start_lonlat"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -133,3 +142,12 @@ basis = "The association's trails page, read on 2026-11-19, still lists the brid
|
||||
basis_url = "https://www.bayoustatetrail.com/trails"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: November to April."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -60,7 +60,11 @@ terrain = ["alpine", "forest"]
|
||||
travel = "trail"
|
||||
permit = "Some trailheads that access this trail require a valid Recreation Pass, per the Forest Service."
|
||||
caution = "East of Bear Meadows the trail is open to motorcycles as well as hikers, horses and bicycles. The Forest Service states the trail is closed to ATV use."
|
||||
checked = "2026-11-16"
|
||||
checked = "2026-11-20"
|
||||
season = "July to October"
|
||||
months = [7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Cascade ridges around 5,000 feet hold snow until July, and heavy rain starts in late October. Confidence: high."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.fs.usda.gov/r06/giffordpinchot/recreation/trails/trail-1-boundary"
|
||||
@@ -73,6 +77,11 @@ slug = "cascade-range"
|
||||
basis = "track"
|
||||
km = 91.7
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -102,3 +111,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: July to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -59,7 +59,11 @@ shape = "point-to-point"
|
||||
terrain = ["alpine", "forest"]
|
||||
travel = "trail"
|
||||
permit = "A free self-issuing wilderness permit, filled out at the trailhead, is required to enter the Pasayten Wilderness."
|
||||
checked = "2026-11-16"
|
||||
checked = "2026-11-20"
|
||||
season = "July to September"
|
||||
months = [7, 8, 9]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. The Pasayten high country at 5,500 to 7,500 feet is under snow until early July, and snow returns in October. Confidence: high."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.fs.usda.gov/r06/okanogan-wenatchee/recreation/trails/boundary-trail"
|
||||
@@ -88,6 +92,11 @@ slug = "pasayten-wilderness"
|
||||
basis = "track"
|
||||
km = 112.3
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -117,3 +126,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: July to September."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -57,7 +57,11 @@ end = "Main Finger Lakes Trail near Mitchellsville, New York"
|
||||
shape = "point-to-point"
|
||||
terrain = ["forest"]
|
||||
travel = "trail"
|
||||
checked = "2026-11-16"
|
||||
checked = "2026-11-20"
|
||||
season = "May to October"
|
||||
months = [5, 6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Snow and mud make winter and early spring uncommon for walking, so the comfortable months run from late spring through fall. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://cnyhiking.com/The%20Bristol%20Hills%20Trail.htm"
|
||||
@@ -69,6 +73,11 @@ url = "https://www.gofingerlakes.org/locations/gannett-hill-park/"
|
||||
publisher = "Go Finger Lakes (Finger Lakes Land Trust)"
|
||||
facts = ["summary", "start"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -89,3 +98,12 @@ basis = "The pages named in the logo note were searched, and none offers usable
|
||||
basis_url = "https://fingerlakestrail.org/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: May to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -72,7 +72,11 @@ shape = "point-to-point"
|
||||
terrain = ["tundra", "alpine"]
|
||||
travel = "mostly-cross-country"
|
||||
caution = "There is almost no trail, and much of the route is floated by packraft, so it needs packrafting skills as well as route-finding."
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "June to September"
|
||||
months = [6, 7, 8, 9]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Arctic tundra is frozen and snowbound most of the year, with river breakup in early June and freeze-up and snow by mid-September. Confidence: low."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://thingstolucat.com/brooks-range-traverse/"
|
||||
@@ -123,6 +127,11 @@ slug = "mollie-beattie-wilderness"
|
||||
basis = "stated"
|
||||
source = "https://thingstolucat.com/arctic-refuge-traverse/"
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -160,3 +169,12 @@ basis = "The page says: \"In June of 2017 Sarah and I hiked and floated through
|
||||
basis_url = "https://thingstolucat.com/arctic-refuge-traverse/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: June to September."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -58,7 +58,11 @@ shape = "point-to-point"
|
||||
days = [30, 30]
|
||||
travel = "trail"
|
||||
permit = "Parking reservations are needed at some parks, and camping is allowed only at designated sites, often by reservation."
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "April to October"
|
||||
months = [4, 5, 6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. The Niagara Escarpment is icy and muddy through winter and early spring, so end-to-end hikes run from the April thaw to the end of October. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://brucetrail.org/explore-the-trail/"
|
||||
@@ -70,6 +74,11 @@ url = "https://www.brucetrail.org/"
|
||||
publisher = "Bruce Trail Conservancy"
|
||||
facts = ["summary"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Bruce Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -193,3 +202,12 @@ basis = "Measured from the trail's main track against the Environment and Climat
|
||||
basis_url = "https://open.canada.ca/data/dataset/6c343726-1e92-451a-876a-76e17d398a1c"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: April to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -59,7 +59,11 @@ official_url = "https://www.coastal.ca.gov/coastal-trail/"
|
||||
terrain = ["coast"]
|
||||
travel = "trail-and-road"
|
||||
unfinished = "The state counts about 875 miles, about 70 percent, as built along a coastline of about 1,230 miles, and there is no official through route. A hiker reports having walked the whole coast from end to end, in eight section hikes, by connecting the built parts with their own choices."
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "April to October"
|
||||
months = [4, 5, 6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. The coast can be walked all year, but winter storms bring heavy rain in the north and leave some sections passable only at low tide, so a full walk suits the dry months. Confidence: low."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.coastal.ca.gov/coastal-trail/"
|
||||
@@ -71,6 +75,11 @@ url = "https://github.com/swaits/longhikes/issues/1"
|
||||
publisher = "A hiker, on the dataset's public issue tracker"
|
||||
facts = ["unfinished"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "California Coastal Trail (incomplete)"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -191,3 +200,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: April to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+24
-1
@@ -60,7 +60,11 @@ high_point_m = 1917
|
||||
days = [9, 14]
|
||||
terrain = ["forest", "alpine"]
|
||||
travel = "trail"
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "June to October"
|
||||
months = [6, 7, 8, 9, 10]
|
||||
season_basis = "sources"
|
||||
season_method = "The pages differ: The Trek gives May to October and Backpacking Routes gives June to November. It was set by judgement from both and from the climate, since snow and mud last into late May and cold sets in by late October. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.cohostrail.org/"
|
||||
@@ -77,6 +81,16 @@ url = "https://www.cohostrail.org/the-trail/"
|
||||
publisher = "Cohos Trail Association"
|
||||
facts = ["summary", "high_point", "terrain", "travel"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://thetrek.co/10-trails-can-find-long-distance-solitude-2020/"
|
||||
publisher = "The Trek"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://backpackingroutes.com/cohos-trail/"
|
||||
publisher = "Backpacking Routes"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Cohos Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -122,3 +136,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was set from pages that differ: June to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "The pages that state a season differ and none is the managing body, association or route author, so it was set by judgement from all of them and the climate estimate."
|
||||
basis_url = "https://thetrek.co/10-trails-can-find-long-distance-solitude-2020/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -56,13 +56,22 @@ official_url = "https://www.lancasterhikingclub.com/copy-of-conestoga-trail"
|
||||
shape = "point-to-point"
|
||||
terrain = ["forest", "farmland"]
|
||||
travel = "trail-and-road"
|
||||
checked = "2026-11-14"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and September to November"
|
||||
months = [3, 4, 5, 9, 10, 11]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. The low Lancaster County hills are hot, humid and tick-ridden in summer, so the cool months suit it best. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.lancasterhikingclub.com/copy-of-conestoga-trail"
|
||||
publisher = "Lancaster Hiking Club"
|
||||
facts = ["official_url", "summary", "shape", "terrain", "travel"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -82,3 +91,12 @@ basis = "The pages named in the logo note were searched, and none shows an emble
|
||||
basis_url = "https://www.lancasterhikingclub.com/copy-of-conestoga-trail"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: March to May and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -53,7 +53,11 @@ end = "Rainbow Bridge, Niagara Falls, New York"
|
||||
end_lonlat = [-79.067, 43.09]
|
||||
shape = "point-to-point"
|
||||
terrain = ["forest"]
|
||||
checked = "2026-11-14"
|
||||
checked = "2026-11-20"
|
||||
season = "April to October"
|
||||
months = [4, 5, 6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Low-elevation western New York is snowy in winter and muddy in March, and can be walked from April until late fall. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://sites.google.com/view/foothillstrailclub/about-the-trail"
|
||||
@@ -76,6 +80,11 @@ slug = "allegheny-plateau"
|
||||
basis = "stated"
|
||||
source = "https://sites.google.com/view/foothillstrailclub/about-the-trail"
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -113,3 +122,12 @@ basis = "The trail's own description says: \"The Conservation Trail runs north t
|
||||
basis_url = "https://sites.google.com/view/foothillstrailclub/about-the-trail"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: April to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -60,7 +60,11 @@ days = [3, 5]
|
||||
terrain = ["forest", "lakes"]
|
||||
travel = "trail"
|
||||
permit = "A free permit from the local forest ranger is needed for groups of ten or more, or to camp more than three days in one spot."
|
||||
checked = "2026-11-19"
|
||||
checked = "2026-11-20"
|
||||
season = "June to October"
|
||||
months = [6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Adirondack snow and mud in spring and black flies into June leave summer and fall as the usual window. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://cranberrylake50.org/"
|
||||
@@ -77,6 +81,11 @@ url = "https://cranberrylake50.org/plan-your-trip/"
|
||||
publisher = "Cranberry Lake 50 (Five Ponds Partners)"
|
||||
facts = ["permit"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Cranberry Lake 50"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -125,3 +134,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: June to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -60,7 +60,11 @@ end = "Lake Champlain, Vermont"
|
||||
shape = "point-to-point"
|
||||
travel = "trail-and-road"
|
||||
unfinished = "About half the route is still on busier roads, and the association is building more trail toward a complete off-road route across the state."
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "May to October"
|
||||
months = [5, 6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. A low-elevation route of mostly rail trail and quiet roads, where winter snow and mud season bracket a long snow-free stretch from May to October. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://crossvermont.org/our_trail/index.php"
|
||||
@@ -73,6 +77,11 @@ slug = "green-mountains"
|
||||
basis = "track"
|
||||
km = 29.1
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -101,3 +110,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: May to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -73,7 +73,11 @@ shape = "point-to-point"
|
||||
terrain = ["canyon", "alpine"]
|
||||
travel = "trail-and-road"
|
||||
caution = "The route is unmarked and not designated by any state or federal agency, and about 40 percent of it is dirt road."
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "May to October"
|
||||
months = [5, 6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. A route from southern Utah desert canyons to the Pioneer Mountains of Idaho needs the high ground clear of snow and the south not scorching. Confidence: low."
|
||||
|
||||
[[hike.source]]
|
||||
url = "http://www.lbhikes.com/p/a-complete-guide-to-deseret-hiking-route.html"
|
||||
@@ -103,6 +107,11 @@ slug = "wasatch-range"
|
||||
basis = "stated"
|
||||
source = "http://www.lbhikes.com/p/a-complete-guide-to-deseret-hiking-route.html"
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -149,3 +158,12 @@ basis = "The page says: \"Highlights: Paria Canyon Bryce Canyon National Park Wa
|
||||
basis_url = "http://www.lbhikes.com/p/a-complete-guide-to-deseret-hiking-route.html"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: May to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -72,7 +72,11 @@ shape = "point-to-point"
|
||||
terrain = ["desert"]
|
||||
travel = "mostly-cross-country"
|
||||
caution = "There is no trail on the ground and no signs: the route is found by map and experience, and water sources are few and far between."
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "April to June and September to October"
|
||||
months = [4, 5, 6, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Waterless desert is too hot in summer and snowy in winter, so a full walk runs through spring and early fall. Confidence: low."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://deserttrail.net"
|
||||
@@ -91,6 +95,11 @@ slug = "joshua-tree-national-park"
|
||||
basis = "stated"
|
||||
source = "https://deserttrail.net/segments/"
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -119,3 +128,12 @@ basis = "The page says: \"While the Desert Trail does pass through a few well-vi
|
||||
basis_url = "https://deserttrail.net"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: April to June and September to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -32,3 +32,12 @@ down the list in order and stop at the first step that fails.
|
||||
entry when a placement changes.
|
||||
8. **Build the site** with `python3 web/build.py --out _site` and read the places page, one park
|
||||
page, one range page and one wilderness page.
|
||||
|
||||
## Seasons
|
||||
|
||||
Every trail has a season. Where a page states one, the season is that page's. Where none does, the season is an estimate: set by a reviewer from the trail's climate and the seasons of similar trails, with its confidence on the record (`docs/season-judging.md`). The aim of this audit is that estimates shrink over time, and that none goes stale unnoticed.
|
||||
|
||||
1. Search afresh for a page that states the season of every trail still marked `estimate`. List them with `python3 tools/estimate_season.py estimates`. For each, follow `docs/season-research.md`: the trail's holder or a government page first, then an established hiking reference, a guidebook publisher's page or an association list. When a page states a season, replace the estimate through `tools/refresh.py` (propose, collect, apply): give the page's season and months, the basis (`primary`, `sources` or `source`), the page as a `[[hike.source]]` naming `season` and `months`, and remove the climate source and `season_method`. A change to the season gets a `[[history]]` entry like any other fact. Then run `python3 tools/season_judge.py inputs` so that the record of estimate inputs drops the trail. A trail with no page found stays an estimate, and nothing else about it changes.
|
||||
2. Re-run the machine estimate and flag any estimate whose inputs have changed: `python3 tools/estimate_season.py check`. It reruns the machine estimate for every estimate, compares it, the climate at the trail and the sourced trails it is compared with against what was recorded in `tools/season_inputs.json` when the season was set, and lists each trail whose inputs differ. The listing is a flag, not a rewrite. For each trail listed, build its packet (`python3 tools/season_judge.py packets`), look at what changed, and either keep the season or set it again by judgement. Then run `python3 tools/season_judge.py inputs` to record the inputs as they now are. The check also fails when the blind test of the method (`tools/season_blind_test.json`) is below its bar, or when the fit of the machine estimate against the sourced seasons has got worse.
|
||||
|
||||
The same check runs on its own on the first of each month (`.github/workflows/season-check.yml`), so a changed estimate is noticed even when the audit is late. The audit is still the step that acts on it.
|
||||
+3
-3
@@ -128,7 +128,7 @@ The field and file names keep the word "line" (`line.geojson`, `line_file`, `lin
|
||||
|
||||
## `[hike]`: what a hiker asks first
|
||||
|
||||
Optional: a record without `[hike]` is valid. The table holds the facts a hiker wants before anything else: where the trail goes, what the country is like, how long it takes, when to go, where its own site is. Every fact is read on a page, and that page is named in `[[hike.source]]`. The first choice is a page of the trail's holder (the agency, the association, or for a route its author) or a government page. Where those say nothing, a fact may be read on an established hiking reference that covers the trail, such as a guide site, a hiking association's list of trails or a guidebook publisher's page; the source entry names that site as the publisher, so a reader can see where the fact came from and weigh it. Apps and pages that anyone can edit (AllTrails, forums, social media, wikis) are not sources. A fact found on no acceptable page is left out, never guessed, except season, which may be estimated and must then say so. Typical time is estimated at page-build time and never stored, while an estimated season is stored on the record. Where sources disagree, the managing body's figure is used. Wording is ours: nothing is copied from a source.
|
||||
Optional: a record without `[hike]` is valid. The table holds the facts a hiker wants before anything else: where the trail goes, what the country is like, how long it takes, when to go, where its own site is. Every fact is read on a page, and that page is named in `[[hike.source]]`. The first choice is a page of the trail's holder (the agency, the association, or for a route its author) or a government page. Where those say nothing, a fact may be read on an established hiking reference that covers the trail, such as a guide site, a hiking association's list of trails or a guidebook publisher's page; the source entry names that site as the publisher, so a reader can see where the fact came from and weigh it. Apps and pages that anyone can edit (AllTrails, forums, social media, wikis) are not sources. A fact found on no acceptable page is left out, never guessed, except season, which may be estimated and must then say so. Typical time is estimated at page-build time and never stored, while an estimated season is stored on the record. Where sources disagree, the managing body's figure is used; where none of them manages the trail, is its association or is its route author, the season is set by judgement from all the pages and the climate estimate, and `season_method` says so. Wording is ours: nothing is copied from a source.
|
||||
|
||||
| Field | Type | Meaning | Example |
|
||||
| --- | --- | --- | --- |
|
||||
@@ -140,8 +140,8 @@ Optional: a record without `[hike]` is valid. The table holds the facts a hiker
|
||||
| `days` | array of two integers | The usual time to walk the whole trail in one go, `[fewest, most]`, in days, as a source states it. Weeks count 7 days, months 30. | `[150, 210]` |
|
||||
| `season` | string | The months in which the whole trail is usually walked, as a short phrase. Not the dates a park or hut is open, unless those set the walking season. `season` and `months` come together: one is never given without the other. For an estimated season (`season_basis = "estimate"`) the phrase is built from the months. | `"July to September"` |
|
||||
| `months` | array of integers | The same season as month numbers, 1 to 12, for filtering: every month in which the whole trail, or a usual start, is normally walked. A month counts when about half of it or more is in season. Given whenever `season` is, and never without it. | `[7, 8, 9]` |
|
||||
| `season_basis` | string | Required whenever `season` is present, and refused without it. Where the season came from, one of: `primary` (the page is published by the body that manages the trail, the trail's own association, or, for a route worked out by a hiker, that route's author); `sources` (no primary page, but two or more pages from different publishers agree on the season); `source` (one page that is not a primary one); `estimate` (no page states a season, so it is worked out from climate). A route author's stated season counts as `primary`. | `"primary"` |
|
||||
| `season_method` | string | Required with `season_basis = "estimate"`, where it is one sentence naming the method and its inputs: the dataset, the period, the points used and the rule version. Allowed with `sources`, where it says in one sentence how the season was settled when the pages differ. Refused with `primary` and `source`. | `"Estimated from 1991-2020 climate normals at 5 track points (rule version 1)."` |
|
||||
| `season_basis` | string | Required whenever `season` is present, and refused without it. Where the season came from, one of: `primary` (the page is published by the body that manages the trail, the trail's own association, or, for a route worked out by a hiker, that route's author); `sources` (no primary page, but two or more pages from different publishers agree on the season); `source` (one page that is not a primary one); `estimate` (no page states a season, so it is worked out from climate). A route author's stated season counts as `primary`. An `estimate` has no page that states a season: its one `[[hike.source]]` names both `season` and `months` and cites the climate data (CHELSA, with ETOPO), and any ordinary page naming the season makes the basis wrong. An estimate is worked out by a reviewer from the trail's location, elevation, monthly climate normals, a machine estimate and the most similar sourced trails (`tools/season_judge.py`); the method was tested blind against the seasons that pages state, and the result is in `tools/season_blind_test.json`. | `"primary"` |
|
||||
| `season_method` | string | Required with `season_basis = "estimate"`, where it is one or two plain sentences saying how the season was set and what sets it there, ending "Confidence: high.", "Confidence: medium." or "Confidence: low.". Allowed with `sources`, where it says how the season was settled when the pages differ; a season with a method was set by judgement and is shown as an estimate, not as a page's statement. Refused with `primary` and `source`. | `"Snow keeps the high passes closed until late June and returns in October. Confidence: high."` |
|
||||
| `high_point` | string | Name of the highest point on the trail. | `"Mount Mansfield"` |
|
||||
| `high_point_m` | integer | The elevation of the highest point in metres, rounded to the nearest metre (converted from feet where the source gives feet). May be given without `high_point` where a source states the elevation but not a name. | `1340` |
|
||||
| `terrain` | array of strings | One to three of `alpine`, `forest`, `desert`, `coast`, `prairie`, `canyon`, `tundra`, `lakes`, `farmland`: the main kinds of country only. | `["forest"]` |
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
# Setting a season by judgement
|
||||
|
||||
Where no page states a season, it is set by a reviewer from a packet, and the method was tested blind against the seasons that pages state. This page is the reviewer's instruction and the record of the test. The tools are `tools/season_judge.py` (packets, scoring, staging) and `tools/estimate_season.py` (the machine estimate that is one input, and the monthly check).
|
||||
|
||||
## The test
|
||||
|
||||
The reviewers also estimated every trail whose season a page states, from packets identical in form with the season hidden: the trail's own timing sentences were removed, and its comparable trails were never dealt to the same part as it. The three parts were reviewed separately, and the figures are added together. The result is in `tools/season_blind_test.json`, which the site reads; `python3 tools/season_judge.py score <answer files> --write tools/season_blind_test.json` produces it. A season "matches" when each end of the reviewer's months is within one month of the stated season's, on the circle of the year. The machine estimate on its own matches 67.6 percent on the same measure, under the 75 percent bar, so it is not written to a record; the judged method passes, and its confidence labels are honest: high matches most often, low least.
|
||||
|
||||
## What a packet lacks
|
||||
|
||||
The packets rebuilt by `tools/season_judge.py packets` carry the monthly high temperature at the high and low ground but give monthly precipitation only when a file of it is supplied (`--precip`); the packets the reviewers read in November 2026 carried it for every trail.
|
||||
|
||||
## The reviewer's instruction
|
||||
|
||||
|
||||
You will estimate the hiking season for each trail on a list you are given (one of `part-1.txt`, `part-2.txt` or `part-3.txt`). For each id there is one packet, `packets/<id>.md`. Work only on the ids in your list, and read only the packet for the id you are estimating.
|
||||
|
||||
## What to estimate
|
||||
|
||||
The months a typical hiker normally walks the whole trail, or thru-hikes it, in a normal year.
|
||||
|
||||
- A season may be two windows (spring and fall) or wrap the year end (October to April).
|
||||
- A month counts when about half of it or more is in season.
|
||||
- Think about what actually sets the season there: snow on the high ground, summer heat, monsoon, humidity and bugs, hunting season, short daylight, river levels, mud.
|
||||
- People do walk in cold and snow in places where that is normal. Do not assume summer everywhere.
|
||||
|
||||
## Rules
|
||||
|
||||
1. Use only the packet and your own general knowledge of the region and of the trail.
|
||||
2. Do not open any trail record, do not search the web, and do not read any file outside the packet and this README.
|
||||
3. Do not look at other trails' packets, answers or any scores.
|
||||
|
||||
## What a packet contains
|
||||
|
||||
- **The trail:** id, name, common name, country, states or provinces, length in miles, kind, shape, terrain, travel (on trail or cross-country), high point and typical days where on file.
|
||||
- **Summary, start and end:** from the trail's record, with every sentence that bears on timing removed.
|
||||
- **Where it is:** southernmost and northernmost latitude and westernmost and easternmost longitude of the sample points, and whether the location comes from a real track, from start and end points only, or from a region-centre fallback (the least precise).
|
||||
- **Elevation:** high ground and low ground in feet as the climate was read, and the track's highest and lowest points where there is a track.
|
||||
- **Climate normals (1981 to 2010):** for each month, the mean daily high in degrees F at the high ground (the upper quarter of the sample points) and the low ground (the lower half), and monthly precipitation in inches at both. Temperatures are modelled and lapse-corrected, so treat them as a guide.
|
||||
- **Machine estimate:** a climate model's estimated months, right about two times in three. Use it as one input, not an answer.
|
||||
- **Comparable trails:** ten trails with a season on record, chosen as most similar in climate and nearest in place, with state, high ground elevation, and each one's season and months. They are neighbours, not copies: yours may differ for good reason.
|
||||
- **What pages say:** present for a few trails only, where published pages disagree: each page's publisher and the months it gives.
|
||||
|
||||
## Answer format
|
||||
|
||||
One tab-separated file, `an answer file named by whoever runs the review (for example `answers/<yourname>.tsv`)`, one line per trail on your list, no header, five columns:
|
||||
|
||||
1. id
|
||||
2. months, as comma-separated numbers 1 to 12 (e.g. `7,8,9`, or `3,4,5,9,10,11`, or `10,11,12,1,2,3,4`)
|
||||
3. season phrase (e.g. `July to September`, `Spring and fall`)
|
||||
4. confidence: `high`, `medium` or `low`
|
||||
5. one sentence: what sets the season there
|
||||
|
||||
Rules for the file: every id on your list exactly once; never an empty month list; no tabs inside a column; no extra columns. Say low when you really do not know.
|
||||
@@ -1,6 +1,6 @@
|
||||
# A season on every trail
|
||||
|
||||
Design, 2026-11-20. Status: awaiting approval.
|
||||
Design, 2026-11-20. Status: built; the method changed after the climate model was tried (see "What changed in the method").
|
||||
|
||||
## Intent
|
||||
|
||||
@@ -194,6 +194,17 @@ What the tool does:
|
||||
- Tests: every record has season, months and basis; basis fits the sources;
|
||||
estimates have a method; no page says a season is missing.
|
||||
|
||||
## What changed in the method
|
||||
|
||||
The plan above chose a rule over climate normals for Step 3. It was built and tested (`tools/estimate_season.py`, `tools/season_model.py`; CHELSA V2.1 1981 to 2010 normals, CC0, with NOAA ETOPO 2022 elevation), and it matched only 67.6 percent of the sourced seasons within one month at each end, under the owner's bar of 75 percent. Its output is therefore not written to a record. What was decided instead:
|
||||
|
||||
- **A reviewer judges each estimate.** For each of the 75 trails with no season, a reviewer set the months from a packet: the trail's location, elevation, monthly climate normals, the machine estimate, and the ten most similar sourced trails (`tools/season_judge.py packets`; the reviewer's instruction is `docs/season-judging.md`). The machine estimate stays in the repository as an input to the packets and as the monthly check.
|
||||
- **The method is tested blind.** The same reviewers estimated the 148 trails whose season a page states, from identical packets with the season hidden, and a trail's comparable trails never came from its own part of the split. They matched 114 of 148 (77.0 percent), by the reviewer's confidence 48 of 52 (high), 55 of 76 (medium) and 11 of 20 (low). The figures are in `tools/season_blind_test.json`, written by `season_judge.py score`, and the site reads them.
|
||||
- **An estimate is stricter.** `season_basis = "estimate"` means no page states a season. `season` is built from `months`; `season_method` is one or two plain sentences saying how it was set and what sets the season there, ending "Confidence: high.", "medium." or "low."; and its one `[[hike.source]]` names `season` and `months` and cites the climate data. The validator refuses an estimate with any ordinary page naming the season, or with no method, and requires a season on every trail.
|
||||
- **Pages that disagree.** Six trails have pages that disagree where none is the managing body, association or route author. Their season is set by judgement from all the pages and the estimate: basis `sources`, the pages cited as sources naming the season, and a `season_method` saying the pages differ and how it was settled. A season with a method is shown as an estimate (it reads "About" with a note), left out of structured data, and not counted among the seasons a page states.
|
||||
- **The monthly check** (`estimate_season.py check`) reruns the machine estimate for every estimate and flags any whose inputs have changed since `tools/season_inputs.json` recorded them. It does not rewrite anything. The audit (`docs/audit.md`) also searches afresh for a page for every estimate.
|
||||
- **On the site**, a trail's page reads "About April to October" with a note (no page states a season; estimated from the climate at the trail's elevation and from similar trails; what sets it there; the confidence; that people walk it outside these months). Rows, tables and month lists mark estimates, the month filter can leave them out, and the reference page and glossary give the counts and the blind-test result.
|
||||
|
||||
## Open risks
|
||||
|
||||
- Climate normals are coarse in steep terrain. The fit against sourced
|
||||
|
||||
+19
-1
@@ -59,13 +59,22 @@ start = "Jericho, Pennsylvania"
|
||||
end = "Farrandsville, near Lock Haven, Pennsylvania"
|
||||
shape = "point-to-point"
|
||||
travel = "trail"
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "April to June and September to October"
|
||||
months = [4, 5, 6, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Unbridged streams run high in early spring, and the valleys are hot, humid and buggy in midsummer, so the shoulder months suit best. Confidence: low."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.kta-hike.org/donut-hole-trail.html"
|
||||
publisher = "Keystone Trails Association"
|
||||
facts = ["official_url", "summary", "start", "end", "shape", "travel"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Donut Hole Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -105,3 +114,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: April to June and September to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -74,7 +74,11 @@ end_lonlat = [-64.164, 48.752]
|
||||
shape = "point-to-point"
|
||||
days = [300, 300]
|
||||
travel = "trail-and-road"
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "January to October"
|
||||
months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. A thru-hike of about 300 days starts in the Florida winter and has to finish in the Gaspe before the November snows. Confidence: low."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://nimblewillnomad.com/books/"
|
||||
@@ -96,6 +100,11 @@ url = "https://geogratis.gc.ca/services/geoname/en/geonames/EGLSG"
|
||||
publisher = "Natural Resources Canada, Canadian Geographical Names Database"
|
||||
facts = ["end_lonlat"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Eastern Continental Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -186,3 +195,12 @@ basis = "The trail's own description says: \"(record route note) on the Internat
|
||||
basis_url = "https://nimblewillnomad.com/books/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: January to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -76,7 +76,11 @@ terrain = ["alpine"]
|
||||
travel = "mostly-cross-country"
|
||||
permit = "A wilderness permit is required year round for overnight trips from the Duck Pass trailhead, and from May 1 through November 1 overnight visitors there are limited to 30 people per day."
|
||||
caution = "The author says the route is consistently difficult, with steep and sometimes loose talus, scree and sand."
|
||||
checked = "2026-11-15"
|
||||
checked = "2026-11-20"
|
||||
season = "July to September"
|
||||
months = [7, 8, 9]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Cross-country passes above 10,500 feet need the snow to have melted, which is from mid-July through September. Confidence: high."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://danstenziano.com/products/eastern-sierra-high-route-guide"
|
||||
@@ -110,6 +114,11 @@ slug = "john-muir-wilderness"
|
||||
basis = "stated"
|
||||
source = "https://danstenziano.com/products/eastern-sierra-high-route-guide"
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -138,3 +147,12 @@ basis = "The page says: \"The Eastern Sierra High Route is the premiere advanced
|
||||
basis_url = "https://danstenziano.com/products/eastern-sierra-high-route-guide"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: July to September."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -60,13 +60,22 @@ start = "Allegany State Park, New York"
|
||||
end = "Slide Mountain, Catskills, New York"
|
||||
shape = "network"
|
||||
travel = "trail"
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "April to October"
|
||||
months = [4, 5, 6, 7, 8, 9, 10]
|
||||
season_basis = "sources"
|
||||
season_method = "The pages differ: one Trek page gives winter, spring, summer and fall, and a table on the same page gives spring, summer and fall. It was set by judgement from both and from the climate, since snow lies from December to March and early spring is muddy. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://fingerlakestrail.org/"
|
||||
publisher = "Finger Lakes Trail Conference"
|
||||
facts = ["official_url", "summary", "start", "end", "shape", "travel"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://thetrek.co/a-list-of-long-distance-trails-in-the-us/"
|
||||
publisher = "The Trek"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Finger Lakes Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -106,3 +115,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was set from pages that differ: April to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "The pages that state a season differ and none is the managing body, association or route author, so it was set by judgement from all of them and the climate estimate."
|
||||
basis_url = "https://thetrek.co/a-list-of-long-distance-trails-in-the-us/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -59,7 +59,11 @@ official_url = "https://www.ganaraska-hiking-trail.org/"
|
||||
start = "Port Hope, Ontario"
|
||||
end = "Bruce Trail, near Collingwood, Ontario"
|
||||
shape = "point-to-point"
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "April to October"
|
||||
months = [4, 5, 6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Southern Ontario is snowy in winter and muddy in March, and the trail can be walked from April until late fall. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.ganaraska-hiking-trail.org/"
|
||||
@@ -72,6 +76,11 @@ slug = "queen-elizabeth-ii-wildlands-provincial-park"
|
||||
basis = "track"
|
||||
km = 48.1
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -136,3 +145,12 @@ basis = "Measured from the trail's main track against the Environment and Climat
|
||||
basis_url = "https://open.canada.ca/data/dataset/6c343726-1e92-451a-876a-76e17d398a1c"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: April to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -58,7 +58,11 @@ official_url = "https://www.fs.usda.gov/r03/apache-sitgreaves/recreation/trails/
|
||||
shape = "point-to-point"
|
||||
travel = "trail"
|
||||
caution = "The Forest Service's National Recreation Trail record says the trail can be hard to find in some places."
|
||||
checked = "2026-11-14"
|
||||
checked = "2026-11-20"
|
||||
season = "April to June and September to October"
|
||||
months = [4, 5, 6, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Rim country is snowy in winter, and the July and August monsoon brings lightning and storms, leaving spring and fall. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.fs.usda.gov/r03/apache-sitgreaves/recreation/trails/general-crook-trail"
|
||||
@@ -76,6 +80,11 @@ slug = "mogollon-rim"
|
||||
basis = "track"
|
||||
km = 77.4
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -140,3 +149,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: April to June and September to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -77,7 +77,11 @@ shape = "loop"
|
||||
terrain = ["forest"]
|
||||
travel = "trail"
|
||||
caution = "The Association describes the loop as the toughest hike in Georgia."
|
||||
checked = "2026-11-16"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and September to November"
|
||||
months = [3, 4, 5, 9, 10, 11]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. The north Georgia mountains are hot, humid and stormy in summer and cold and icy on the ridges in winter. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://bmta.org/backpacking-hikes/"
|
||||
@@ -96,6 +100,11 @@ slug = "blood-mountain-wilderness"
|
||||
basis = "stated"
|
||||
source = "https://bmta.org/backpacking-hikes/"
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -134,3 +143,12 @@ basis = "The page says: \"This loop is the triangle formed by the Benton MacKaye
|
||||
basis_url = "https://bmta.org/backpacking-hikes/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: March to May and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -53,7 +53,11 @@ terrain = ["canyon"]
|
||||
travel = "trail"
|
||||
permit = "Individual hikers need no pass or permit; organised groups need a permit from the Forest Service."
|
||||
caution = "The Forest Service says the stretch of West Fork Trail 151 along Cooper Canyon to Turkeyfeather Pass is not passable, so check the loop map there. A local trail group reported in November 2024 that the Forest Service crew had cleared the last impassable part of the loop, and that walkers found rough tread in places, such as Trail 159 above Turkey Creek and Trail 101 near private land at Double Spring. The Forest Service says West Fork Trail 151 has many river crossings per mile, and that water in the Gila can be unreliable and must be treated."
|
||||
checked = "2026-11-19"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and September to November"
|
||||
months = [3, 4, 5, 9, 10, 11]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Gila canyons at 6,000 feet are hot from June to August, with monsoon storms and flash floods, and cold in winter. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.fs.usda.gov/r03/gila/recreation/gila-wilderness-area"
|
||||
@@ -75,6 +79,11 @@ url = "https://myemail.constantcontact.com/Gila-Trails-News.html?soid=1140320514
|
||||
publisher = "Gila Trails News (Gila Back Country Horsemen and Gila Trails Info), November 2024 update"
|
||||
facts = ["caution"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[guide]]
|
||||
title = "Gila Wilderness Centennial Loop Trail Map - 24K"
|
||||
author = "USDA Forest Service, Gila National Forest"
|
||||
@@ -111,3 +120,12 @@ basis = "The trail's own description says: \"The Gila Wilderness Centennial Loop
|
||||
basis_url = "https://www.fs.usda.gov/r03/gila/recreation/gila-wilderness-area"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: March to May and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+1
-1
@@ -116,7 +116,7 @@ see = ["/lists/weekend/", "/lists/one-to-two-weeks/", "/lists/a-month-or-more/",
|
||||
[[term]]
|
||||
id = "season"
|
||||
term = "Season"
|
||||
definition = "The months in which the whole trail is usually walked, as a source states them. It is not the dates a park or a hut is open. Only some records state one."
|
||||
definition = "The months in which the whole trail is usually walked. Where a page states them, that is shown. Otherwise they are estimated from the climate at the trail's elevation and from similar trails, and the page says so: an estimated season reads “About” with a note. It is not the dates a park or a hut is open."
|
||||
see = ["/lists/"]
|
||||
|
||||
[[term]]
|
||||
|
||||
@@ -56,13 +56,22 @@ official_url = "https://gvta.on.ca/Grand-Valley-Trails"
|
||||
start = "Belwood, Ontario"
|
||||
end = "Port Maitland, Ontario"
|
||||
shape = "point-to-point"
|
||||
checked = "2026-11-14"
|
||||
checked = "2026-11-20"
|
||||
season = "April to October"
|
||||
months = [4, 5, 6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. A low-elevation southern Ontario footpath that can be walked in all but deep winter and the muddy early spring. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://gvta.on.ca/Grand-Valley-Trails"
|
||||
publisher = "Grand Valley Trails Association"
|
||||
facts = ["summary", "official_url", "start", "end", "shape"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -82,3 +91,12 @@ basis = "The emblem is shown by its holder or by the managing agency on the page
|
||||
basis_url = "https://gvta.on.ca/resources/banner-option2D.jpg"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: April to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -62,7 +62,11 @@ shape = "point-to-point"
|
||||
travel = "trail"
|
||||
unfinished = "The trail is made of existing trails that are still being linked, and new trail is needed where gaps remain. Backpacker reported in 2022 that the association had completed over 70 percent since 2007, and that the first end-to-end thru-hike, by two hikers, was in 2013."
|
||||
days = [120, 180]
|
||||
checked = "2026-11-19"
|
||||
checked = "2026-11-20"
|
||||
season = "April to October"
|
||||
months = [4, 5, 6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. A very long Appalachian walk, started in spring in Alabama and carried through summer humidity and into fall to avoid winter in the north. Confidence: low."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.greateasterntrail.net/about-us/"
|
||||
@@ -104,6 +108,11 @@ slug = "ramseys-draft-wilderness"
|
||||
basis = "track"
|
||||
km = 3.8
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -186,3 +195,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: April to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -68,7 +68,11 @@ start = "Crescent Meadow, Sequoia National Park"
|
||||
start_lonlat = [-118.748, 36.559]
|
||||
shape = "loop"
|
||||
terrain = ["forest", "alpine"]
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "July to September"
|
||||
months = [7, 8, 9]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Kaweah Gap and the Great Western Divide hold deep snow into early July, and autumn storms return by October. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.nps.gov/seki/planyourvisit/high-sierra-trail.htm"
|
||||
@@ -102,6 +106,11 @@ slug = "sequoia-kings-canyon-wilderness"
|
||||
basis = "stated"
|
||||
source = "https://www.nps.gov/seki/planyourvisit/high-sierra-trail.htm"
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -148,3 +157,12 @@ basis = "The trail's own description says: \"The Sequoia Great Western Divide Lo
|
||||
basis_url = "https://www.nps.gov/seki/planyourvisit/high-sierra-trail.htm"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: July to September."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -60,7 +60,11 @@ days = [7, 7]
|
||||
terrain = ["forest"]
|
||||
travel = "trail"
|
||||
caution = "Mountain bikers use the pathway as well as hikers."
|
||||
checked = "2026-11-14"
|
||||
checked = "2026-11-20"
|
||||
season = "May to October"
|
||||
months = [5, 6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Northern Michigan forest is snowbound in winter and muddy in early spring, and walkable from May to October, with bugs the main summer complaint. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.michigan.org/property/high-country-pathway"
|
||||
@@ -72,6 +76,11 @@ url = "https://www.trailscouncil.org/high-country-pathway/"
|
||||
publisher = "Top of Michigan Trails Council"
|
||||
facts = ["summary", "start", "shape", "caution"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -91,3 +100,12 @@ basis = "The pages named in the logo note were searched, and none shows an emble
|
||||
basis_url = "https://www.michigan.gov/recsearch/trails/high-country-pathway"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: May to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -58,7 +58,11 @@ end = "Hudson River, New York"
|
||||
shape = "point-to-point"
|
||||
terrain = ["forest"]
|
||||
travel = "trail"
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and September to November"
|
||||
months = [3, 4, 5, 9, 10, 11]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. The low New Jersey and New York Highlands ridges are hot, humid and buggy in summer and icy in midwinter. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://nynjtc.org/highlands-trail"
|
||||
@@ -71,6 +75,11 @@ slug = "appalachian-mountains"
|
||||
basis = "track"
|
||||
km = 26.9
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -99,3 +108,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: March to May and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -70,7 +70,11 @@ shape = "point-to-point"
|
||||
travel = "trail-and-road"
|
||||
start_lonlat = [-85.863, 38.462]
|
||||
end_lonlat = [-86.477, 39.323]
|
||||
checked = "2026-11-16"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and September to November"
|
||||
months = [3, 4, 5, 9, 10, 11]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Indiana has hot, humid summers with ticks and thick vegetation, so spring and fall are the most comfortable months. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://hoosierheritagetrail.org/"
|
||||
@@ -92,6 +96,11 @@ url = "https://github.com/swaits/longhikes/issues/2#issuecomment-6927004842"
|
||||
publisher = "Hoosier Heritage Trail Association (said by its president on the dataset's issue tracker, 2026-11-16)"
|
||||
facts = ["summary", "start", "end", "shape", "travel"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Knobstone Hiking Trail"
|
||||
publisher = "Knobstone Hiking Trail Association"
|
||||
@@ -163,3 +172,12 @@ basis = "The association's Downloads page offers the 2026 mapset, the address an
|
||||
basis_url = "https://hoosierheritagetrail.org/downloads/"
|
||||
asked_by = "the trail association's president"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: March to May and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -59,13 +59,22 @@ start = "Valley Forge National Historical Park, Pennsylvania"
|
||||
end = "the Appalachian Trail, Dauphin County, Pennsylvania"
|
||||
shape = "point-to-point"
|
||||
travel = "trail"
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and September to November"
|
||||
months = [3, 4, 5, 9, 10, 11]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Southeast Pennsylvania has humid, buggy summers and icy winters, which leaves spring and fall. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://cart.hstrail.org/"
|
||||
publisher = "Horse-Shoe Trail Conservancy"
|
||||
facts = ["official_url", "summary", "start", "end", "shape", "travel"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Horse-Shoe Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -90,3 +99,12 @@ basis = "The pages named in the logo note were searched, and none offers usable
|
||||
basis_url = "https://cart.hstrail.org/wp-content/uploads/2019/10/horse-shoe_trail_header_1000_logo-1.jpg"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: March to May and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -76,7 +76,11 @@ shape = "point-to-point"
|
||||
days = [110, 110]
|
||||
terrain = ["alpine", "lakes"]
|
||||
travel = "some-cross-country"
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "April to September"
|
||||
months = [4, 5, 6, 7, 8, 9]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. A northbound route of about 110 days from coastal California to Idaho needs the Sierra and the northern mountains clear of snow, so it runs from spring to early fall. Confidence: low."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://outsideways.com/routes/us/hot-springs-trail/"
|
||||
@@ -88,6 +92,11 @@ url = "https://edits.nationalmap.gov/apps/gaz-domestic/public/summary/1661401"
|
||||
publisher = "U.S. Geological Survey, Geographic Names Information System"
|
||||
facts = ["start_lonlat"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Hot Springs Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -163,3 +172,12 @@ basis = "The route page says: \"These are undoubtedly some of the most striking
|
||||
basis_url = "https://outsideways.com/routes/us/hot-springs-trail/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: April to September."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -63,7 +63,11 @@ shape = "point-to-point"
|
||||
travel = "trail-and-road"
|
||||
unfinished = "The chapter's stated goal is a 750 km extension of the trail; as of 2023 it is made of T'Railway sections, gravel logging roads, backcountry trails and routes, and secondary highways."
|
||||
days = [35, 50]
|
||||
checked = "2026-11-19"
|
||||
checked = "2026-11-20"
|
||||
season = "June to September"
|
||||
months = [6, 7, 8, 9]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Western Newfoundland is cold, snowy and boggy until June, and storms and snow return in October. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://iatnl.org/thru-hikers/"
|
||||
@@ -85,6 +89,11 @@ url = "https://iatnl.org/services/thru-hiker-route-details-directions/"
|
||||
publisher = "International Appalachian Trail Newfoundland and Labrador"
|
||||
facts = ["days"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "International Appalachian Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -157,3 +166,12 @@ basis = "Measured from the trail's main track against the Environment and Climat
|
||||
basis_url = "https://open.canada.ca/data/dataset/6c343726-1e92-451a-876a-76e17d398a1c"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: June to September."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+24
-1
@@ -67,7 +67,11 @@ travel = "trail-and-road"
|
||||
unfinished = "The trail is about half complete: nearly 700 miles are yellow-blazed Ice Age Trail, and about 500 miles of unmarked connecting routes, mostly on quiet country roads, link the blazed segments."
|
||||
caution = "Primitive camping is not permitted on many segments, so overnight plans vary widely from night to night."
|
||||
permit = "No National Park Pass or fee is needed to use the trail."
|
||||
checked = "2026-11-19"
|
||||
checked = "2026-11-20"
|
||||
season = "May to October"
|
||||
months = [5, 6, 7, 8, 9, 10]
|
||||
season_basis = "sources"
|
||||
season_method = "The pages differ: one Trek page gives summer and fall and another gives summer only. It was set by judgement from both and from the climate, since snow and mud last through April and a hard freeze comes by November. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.iceagetrail.org/explore/explore-the-trail/ice-age-trail/"
|
||||
@@ -89,6 +93,16 @@ url = "https://www.nps.gov/iatr/planyourvisit/fees.htm"
|
||||
publisher = "National Park Service"
|
||||
facts = ["permit"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://thetrek.co/a-list-of-long-distance-trails-in-the-us/"
|
||||
publisher = "The Trek"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://thetrek.co/the-best-time-of-year-to-hike-these-23-popular-long-trails/"
|
||||
publisher = "The Trek"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Ice Age National Scenic Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -158,3 +172,12 @@ basis = "The page of National Park Service says: \"A National Park Pass is not r
|
||||
basis_url = "https://www.nps.gov/iatr/planyourvisit/fees.htm"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was set from pages that differ: May to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "The pages that state a season differ and none is the managing body, association or route author, so it was set by judgement from all of them and the climate estimate."
|
||||
basis_url = "https://thetrek.co/a-list-of-long-distance-trails-in-the-us/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -58,7 +58,11 @@ shape = "point-to-point"
|
||||
terrain = ["forest", "farmland"]
|
||||
travel = "trail-and-road"
|
||||
caution = "Much of the route is on roads, because the chapter has relied on landowners' permission to secure the route."
|
||||
checked = "2026-11-14"
|
||||
checked = "2026-11-20"
|
||||
season = "June to October"
|
||||
months = [6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Northern Maine is snowbound and muddy until late May and frozen from November, and fall is best once the bugs fade. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://maineiat.org/?p=412"
|
||||
@@ -85,6 +89,11 @@ url = "https://nominatim.openstreetmap.org/ui/details.html?osmtype=N&osmid=12949
|
||||
publisher = "OpenStreetMap contributors, via Nominatim (ODbL): Barnard Mountain Trailhead, OpenStreetMap node 12949585422"
|
||||
facts = ["start_lonlat"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "International Appalachian Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -139,3 +148,12 @@ basis = "The trail's own description says: \"The Maine section of the Internatio
|
||||
basis_url = "https://maineiat.org/?p=412"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: June to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -57,7 +57,11 @@ terrain = ["alpine", "tundra"]
|
||||
travel = "mostly-cross-country"
|
||||
permit = "Hikers must register before the trip with both Torngat Mountains National Park and Parc national Kuururjuaq, and de-register after leaving the parks."
|
||||
caution = "Stream crossings on the Koroc River and its tributaries can be fast and very cold, and they grow harder after heavy rain."
|
||||
checked = "2026-11-16"
|
||||
checked = "2026-11-20"
|
||||
season = "July to August"
|
||||
months = [7, 8]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. The Torngat Mountains in the Arctic are snowbound until late June and freeze again by September, leaving a short July and August window. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://parks.canada.ca/pn-np/nl/torngats/activ/randonee-hiking1/koroc"
|
||||
@@ -75,6 +79,11 @@ slug = "torngat-mountains-national-park"
|
||||
basis = "stated"
|
||||
source = "https://parks.canada.ca/pn-np/nl/torngats/activ/randonee-hiking1/koroc"
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -104,3 +113,12 @@ basis = "The page says: \"Hiking parties who are interested in tackling this hik
|
||||
basis_url = "https://parks.canada.ca/pn-np/nl/torngats/activ/randonee-hiking1/koroc"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: July to August."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -59,7 +59,11 @@ days = [7, 10]
|
||||
terrain = ["forest", "lakes"]
|
||||
travel = "trail"
|
||||
permit = "Backcountry campsites along the trail are reserved through Ontario Parks."
|
||||
checked = "2026-11-14"
|
||||
checked = "2026-11-20"
|
||||
season = "June to October"
|
||||
months = [6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Killarney is snowbound in winter and buggy in spring, so the warm months are the main window, with September and early October the best. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.ontarioparks.ca/park/killarney"
|
||||
@@ -77,6 +81,11 @@ slug = "killarney-provincial-park"
|
||||
basis = "track"
|
||||
km = 73.8
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -105,3 +114,12 @@ basis = "Measured from the trail's main track against the Environment and Climat
|
||||
basis_url = "https://open.canada.ca/data/dataset/6c343726-1e92-451a-876a-76e17d398a1c"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: June to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -60,7 +60,11 @@ terrain = ["coast"]
|
||||
travel = "trail"
|
||||
permit = "Overnight camping on the King Range sections needs a Backcountry Permit, booked through Recreation.gov; Sinkyone Wilderness State Park has its own rules for camping."
|
||||
caution = "On the northern section the BLM tells hikers to research the tides before booking a permit."
|
||||
checked = "2026-11-14"
|
||||
checked = "2026-11-20"
|
||||
season = "May to September"
|
||||
months = [5, 6, 7, 8, 9]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Heavy winter rain, slides and high tides make parts of the coast impassable, so the dry months with workable low tides are used. Confidence: high."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.blm.gov/visit/lost-coast-trail"
|
||||
@@ -84,6 +88,11 @@ slug = "king-range-wilderness"
|
||||
basis = "track"
|
||||
km = 42.4
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -112,3 +121,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: May to September."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -63,7 +63,11 @@ terrain = ["forest"]
|
||||
travel = "trail"
|
||||
caution = "Fires are banned along parts of the trail and during the spring fire season, and the club advises hikers to stay off the trail during bear and deer season, which runs about three weeks from the Monday before Thanksgiving."
|
||||
permit = "No permit is needed to camp one night at a site; a free Loyalsock State Forest camping permit is needed to stay more than one night at one location."
|
||||
checked = "2026-11-19"
|
||||
checked = "2026-11-20"
|
||||
season = "April to June and September to October"
|
||||
months = [4, 5, 6, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Rocky, wet terrain in northern Pennsylvania is best in the cool shoulder seasons, before the humid, buggy summer. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://alpineclubofwilliamsport.com/loyalsock-trail-information/"
|
||||
@@ -80,6 +84,11 @@ url = "https://alpineclubofwilliamsport.com/faqs/"
|
||||
publisher = "Alpine Club of Williamsport"
|
||||
facts = ["permit"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Loyalsock Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -128,3 +137,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: April to June and September to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -60,13 +60,22 @@ end = "Chadds Ford, Pennsylvania, on the Brandywine River"
|
||||
shape = "point-to-point"
|
||||
terrain = ["forest"]
|
||||
travel = "trail"
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and September to November"
|
||||
months = [3, 4, 5, 9, 10, 11]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. The low Susquehanna valley is hot and humid in summer, so the cool spring and fall months suit best. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://masondixontrail.wixsite.com/mdts"
|
||||
publisher = "Mason-Dixon Trail System"
|
||||
facts = ["official_url", "summary", "start", "end", "shape", "terrain", "travel"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Mason-Dixon Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -100,3 +109,12 @@ basis = "OpenStreetMap relation 1820324 names one way of each pair Mason-Dixon T
|
||||
basis_url = "https://www.openstreetmap.org/relation/1820324"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: March to May and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -56,7 +56,11 @@ terrain = ["forest"]
|
||||
travel = "trail"
|
||||
caution = "The 2018 guide states there is no GPS track for the trail and that its maps are bound to be wrong in places."
|
||||
permit = "Camping along the trail on public land is free, but camping on state land needs a Michigan DNR permit."
|
||||
checked = "2026-11-19"
|
||||
checked = "2026-11-20"
|
||||
season = "June to October"
|
||||
months = [6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Snow and mud last into April in northern Michigan, and the walk is comfortable from June through early fall. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.fs.usda.gov/r09/huron-manistee/recreation/trails/midland-mackinaw-trail"
|
||||
@@ -78,6 +82,11 @@ url = "https://nominatim.openstreetmap.org/ui/details.html?osmtype=R&osmid=13498
|
||||
publisher = "OpenStreetMap contributors, via Nominatim (ODbL): Mackinaw City, OpenStreetMap relation 134987"
|
||||
facts = ["end_lonlat"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -125,3 +134,12 @@ basis = "The record's own sources: the 2018 guide states there is no GPS track f
|
||||
basis_url = "https://www.fs.usda.gov/r09/huron-manistee/recreation/trails/midland-mackinaw-trail"
|
||||
asked_by = "a reviewer"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: June to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -61,7 +61,11 @@ shape = "point-to-point"
|
||||
high_point = "Mount Wachusett"
|
||||
high_point_m = 611
|
||||
travel = "trail"
|
||||
checked = "2026-11-14"
|
||||
checked = "2026-11-20"
|
||||
season = "April to June and September to November"
|
||||
months = [4, 5, 6, 9, 10, 11]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. The gentle central Massachusetts hills are pleasant in spring and fall, with humid, buggy summers and cold, icy winters. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.midstatetrail.org/"
|
||||
@@ -73,6 +77,11 @@ url = "https://www.midstatetrail.org/about-the-midstate-trail/old-growth-forest/
|
||||
publisher = "Midstate Trail Committee"
|
||||
facts = ["high_point"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -92,3 +101,12 @@ basis = "The emblem is shown by its holder or by the managing agency on the page
|
||||
basis_url = "https://www.midstatetrail.org/wp-content/uploads/2017/06/follow_triangle.png"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: April to June and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -59,7 +59,11 @@ shape = "point-to-point"
|
||||
terrain = ["forest", "lakes"]
|
||||
travel = "trail"
|
||||
permit = "Each person aged 18 or older needs a Land Between the Lakes Backcountry Camping Permit."
|
||||
checked = "2026-11-19"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and September to November"
|
||||
months = [3, 4, 5, 9, 10, 11]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. The forests of western Kentucky and Tennessee are hot, humid and tick-ridden in summer, so spring and fall are favoured. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.landbetweenthelakes.us/outdoors-recreation/trails-3/"
|
||||
@@ -76,6 +80,11 @@ url = "https://www.landbetweenthelakes.us/help-center/rules-and-regulations/"
|
||||
publisher = "USDA Forest Service, Land Between the Lakes NRA"
|
||||
facts = ["permit"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -105,3 +114,12 @@ basis = "The page of USDA Forest Service, Land Between the Lakes NRA says: \"Eac
|
||||
basis_url = "https://www.landbetweenthelakes.us/help-center/rules-and-regulations/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: March to May and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -56,7 +56,11 @@ official_url = "https://www.rigis.org/datasets/north-south-trail"
|
||||
shape = "point-to-point"
|
||||
terrain = ["forest"]
|
||||
travel = "trail"
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and September to November"
|
||||
months = [3, 4, 5, 9, 10, 11]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Rhode Island woods are humid and buggy in summer and cold in winter. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.rigis.org/datasets/north-south-trail"
|
||||
@@ -68,6 +72,11 @@ url = "https://dem.ri.gov/sites/g/files/xkgbur861/files/programs/bnatres/fishwil
|
||||
publisher = "Rhode Island Department of Environmental Management"
|
||||
facts = ["summary", "terrain"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "North-South Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -92,3 +101,12 @@ basis = "The pages named in the logo note were searched, and none shows an emble
|
||||
basis_url = "https://www.rigis.org/datasets/north-south-trail"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: March to May and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -57,7 +57,11 @@ official_url = "https://www.fs.usda.gov/r06/umpqua/recreation/groups/north-umpqu
|
||||
shape = "point-to-point"
|
||||
terrain = ["forest"]
|
||||
travel = "trail"
|
||||
checked = "2026-11-14"
|
||||
checked = "2026-11-20"
|
||||
season = "June to October"
|
||||
months = [6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. The upper Cascade sections near 6,000 feet hold snow into June and see heavy rain and snow from late October, though the river canyon can be walked earlier. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.fs.usda.gov/r06/umpqua/recreation/groups/north-umpqua-trail-1414"
|
||||
@@ -74,6 +78,11 @@ url = "https://www.blm.gov/visit/north-umpqua-wild-and-scenic-river"
|
||||
publisher = "Bureau of Land Management"
|
||||
facts = ["summary", "terrain", "travel"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "North Umpqua Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -128,3 +137,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: June to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -59,7 +59,11 @@ shape = "point-to-point"
|
||||
terrain = ["forest", "farmland"]
|
||||
travel = "trail-and-road"
|
||||
caution = "There are no overnight accommodations on the trail and camping is not permitted."
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "April to October"
|
||||
months = [4, 5, 6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. The southern Ontario moraine is snowy and muddy over winter and can be walked from April until late fall. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.oakridgestrail.org/end-to-end-hike/"
|
||||
@@ -71,6 +75,11 @@ url = "https://www.oakridgestrail.org/chapters/"
|
||||
publisher = "Oak Ridges Trail Association"
|
||||
facts = ["summary", "start", "end", "terrain"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -90,3 +99,12 @@ basis = "The emblem is shown by its holder or by the managing agency on the page
|
||||
basis_url = "https://www.oakridgestrail.org/wp-content/uploads/2024/07/favicon.jpg"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: April to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -58,7 +58,11 @@ shape = "point-to-point"
|
||||
terrain = ["forest", "lakes"]
|
||||
travel = "trail"
|
||||
caution = "The trail planner calls it a rugged wilderness trail."
|
||||
checked = "2026-11-14"
|
||||
checked = "2026-11-20"
|
||||
season = "June to October"
|
||||
months = [6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Northeastern Ontario forest is snowbound and muddy until May, with black flies in early summer, and cold by November. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://nastawgantrails.org/our-trails"
|
||||
@@ -85,6 +89,11 @@ url = "https://geogratis.gc.ca/services/geoname/en/geonames/FDNSB"
|
||||
publisher = "Natural Resources Canada (Canadian Geographical Names)"
|
||||
facts = ["end_lonlat"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -104,3 +113,12 @@ basis = "The pages named in the logo note were searched, and none offers usable
|
||||
basis_url = "https://nastawgantrails.org/our-trails"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: June to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+29
-1
@@ -64,7 +64,11 @@ terrain = ["forest"]
|
||||
travel = "trail"
|
||||
days = [14, 21]
|
||||
permit = "No permits are required for the trail."
|
||||
checked = "2026-11-19"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and October to November"
|
||||
months = [3, 4, 5, 10, 11]
|
||||
season_basis = "sources"
|
||||
season_method = "The pages differ: one gives April to November, one gives late October to late March, and one gives all year. It was set by judgement from all three and from the climate, since summers are hot and humid with ticks and winters are cold but walkable. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.friendsoftheouachita.org/about-the-ot"
|
||||
@@ -81,6 +85,21 @@ url = "https://www.treelinereview.com/where-to-go/ouachita-trail"
|
||||
publisher = "Treeline Review"
|
||||
facts = ["days", "permit"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://thehikinglife.com/2014/07/ouachita-trail/"
|
||||
publisher = "The Hiking Life"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://backpackingroutes.com/ouachita-trail/"
|
||||
publisher = "Backpacking Routes"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://thetrek.co/10-trails-can-find-long-distance-solitude-2020/"
|
||||
publisher = "The Trek"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Ouachita Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -150,3 +169,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was set from pages that differ: March to May and October to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "The pages that state a season differ and none is the managing body, association or route author, so it was set by judgement from all of them and the climate estimate."
|
||||
basis_url = "https://thehikinglife.com/2014/07/ouachita-trail/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+24
-1
@@ -61,7 +61,11 @@ end = "Western edge of the Mark Twain National Forest, Missouri"
|
||||
shape = "point-to-point"
|
||||
travel = "trail"
|
||||
unfinished = "The St. Louis to Arkansas border route is not complete; about 230 miles form the contiguous thru-hike backbone."
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and September to November"
|
||||
months = [3, 4, 5, 9, 10, 11]
|
||||
season_basis = "sources"
|
||||
season_method = "The pages differ: one Trek page gives spring or fall and another adds winter. It was set by judgement from both and from the climate, since the heat, humidity and ticks of July and August make summer a poor choice. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://ozarktrail.com/thru-hiking/"
|
||||
@@ -78,6 +82,16 @@ url = "https://www.fs.usda.gov/r09/marktwain/recreation/ozark-trail"
|
||||
publisher = "USDA Forest Service, Mark Twain National Forest"
|
||||
facts = ["start", "end"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://thetrek.co/the-best-time-of-year-to-hike-these-23-popular-long-trails/"
|
||||
publisher = "The Trek"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://thetrek.co/a-list-of-long-distance-trails-in-the-us/"
|
||||
publisher = "The Trek"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Ozark Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -120,3 +134,12 @@ basis = "OpenStreetMap relation 16710911 names the two ways Eleven Point Low Rou
|
||||
basis_url = "https://www.openstreetmap.org/relation/16710911"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was set from pages that differ: March to May and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "The pages that state a season differ and none is the managing body, association or route author, so it was set by judgement from all of them and the climate estimate."
|
||||
basis_url = "https://thetrek.co/the-best-time-of-year-to-hike-these-23-popular-long-trails/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -57,7 +57,11 @@ start = "Rocky Point, New York"
|
||||
end = "Montauk Point, New York"
|
||||
shape = "point-to-point"
|
||||
terrain = ["forest", "coast"]
|
||||
checked = "2026-11-14"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and September to November"
|
||||
months = [3, 4, 5, 9, 10, 11]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Long Island is humid and tick-heavy in summer, and the pine barrens are pleasant in the cool shoulder seasons. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://southamptontrails.org/history/"
|
||||
@@ -69,6 +73,11 @@ url = "https://www.ligreenbelt.org/about-greenbelt-trails"
|
||||
publisher = "Long Island Greenbelt Trail Conference"
|
||||
facts = ["summary", "terrain"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -88,3 +97,12 @@ basis = "The pages named in the logo note were searched, and none shows an emble
|
||||
basis_url = "https://southamptontrails.org/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: March to May and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -76,7 +76,11 @@ days = [6, 10]
|
||||
terrain = ["alpine", "forest", "lakes"]
|
||||
travel = "some-cross-country"
|
||||
permit = "The Rocky Mountain National Park portion requires use of designated backcountry campsites, arranged through the park permit system described in the guide."
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "July to September"
|
||||
months = [7, 8, 9]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. A Continental Divide crest route above 11,000 feet with off-trail passes needs the snow gone, which is from July until the first big September storms. Confidence: high."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://andrewskurka.com/adventures/pfiffner-traverse-colorado-rockies/"
|
||||
@@ -127,6 +131,11 @@ slug = "james-peak-wilderness"
|
||||
basis = "stated"
|
||||
source = "https://andrewskurka.com/adventures/pfiffner-traverse-colorado-rockies/"
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -173,3 +182,12 @@ basis = "The page says: \"The Pfiffner Traverse is a 77-mile backpacking high ro
|
||||
basis_url = "https://andrewskurka.com/adventures/pfiffner-traverse-colorado-rockies/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: July to September."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
+19
-1
@@ -58,7 +58,11 @@ end = "Ottawa, Ontario"
|
||||
shape = "point-to-point"
|
||||
caution = "Many parts of the trail network close during the Ontario fall hunting season, and overnight accommodation is sparse along much of the trail."
|
||||
days = [9, 16]
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "April to October"
|
||||
months = [4, 5, 6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Eastern Ontario is snowy and muddy over winter, and the trail can be walked from April until late fall. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.rideautrail.org/discover-the-trail/"
|
||||
@@ -75,6 +79,11 @@ url = "https://www.rideautrail.org/discover-the-trail/faq/"
|
||||
publisher = "Rideau Trail Association"
|
||||
facts = ["days"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Rideau Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -120,3 +129,12 @@ basis = "Measured from the trail's main track against the Environment and Climat
|
||||
basis_url = "https://open.canada.ca/data/dataset/6c343726-1e92-451a-876a-76e17d398a1c"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: April to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -53,7 +53,11 @@ high_point_m = 3444
|
||||
travel = "trail-and-road"
|
||||
unfinished = "About 80 percent of the route is complete, and evaluation and planning continue for the remaining 20 percent."
|
||||
caution = "Many of the trails are covered by snow in winter."
|
||||
checked = "2026-11-14"
|
||||
checked = "2026-11-20"
|
||||
season = "June to October"
|
||||
months = [6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. A loop around Pikes Peak that mixes stretches near 11,000 feet with lower trails, and is snow-free from about June to October. Confidence: low."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://friendsofthepeak.org/ring-the-peak-2/"
|
||||
@@ -66,6 +70,11 @@ slug = "front-range"
|
||||
basis = "stated"
|
||||
source = "https://friendsofthepeak.org/ring-the-peak-2/"
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -94,3 +103,12 @@ basis = "The page says: \"Ring the Peak is a collection of trails and backcountr
|
||||
basis_url = "https://friendsofthepeak.org/ring-the-peak-2/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: June to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -71,7 +71,11 @@ terrain = ["alpine", "lakes"]
|
||||
travel = "mostly-cross-country"
|
||||
permit = "A free wilderness permit is obtained by self-registration at the trailhead, and there is no fee to access the Sawtooth Wilderness."
|
||||
caution = "The planned route was about 89 miles with over 50 miles off-trail; the hike its author recorded covered 67 miles."
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "July to September"
|
||||
months = [7, 8, 9]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Mostly cross-country passes near 9,000 feet and above need the snow gone, which is from mid-July through September. Confidence: high."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://seekinglost.com/sawtooth-wilderness-high-route-8-day-solo-hike-aug-2017/"
|
||||
@@ -95,6 +99,11 @@ slug = "sawtooth-wilderness"
|
||||
basis = "stated"
|
||||
source = "https://seekinglost.com/sawtooth-wilderness-high-route-8-day-solo-hike-aug-2017/"
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -132,3 +141,12 @@ basis = "The trail's own description says: \"This Sawtooth Wilderness high route
|
||||
basis_url = "https://seekinglost.com/sawtooth-wilderness-high-route-8-day-solo-hike-aug-2017/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: July to September."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -76,7 +76,11 @@ summary = "The Sea-to-Sea Route is a network of existing long-distance hiking tr
|
||||
official_url = "https://andrewskurka.com/adventures/sea-to-sea-route/overview/"
|
||||
shape = "network"
|
||||
unfinished = "An 800-mile gap in North Dakota and Montana along the Missouri River and a 30-mile gap in Vermont interrupt the network."
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "April to October"
|
||||
months = [4, 5, 6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. A 7,775-mile coast-to-coast network across the northern prairie, the Rockies and the Cascades can only be walked from spring thaw to autumn snow. Confidence: low."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://andrewskurka.com/adventures/sea-to-sea-route/overview/"
|
||||
@@ -131,6 +135,11 @@ slug = "stephen-mather-wilderness"
|
||||
basis = "stated"
|
||||
source = "https://www.nps.gov/noca/planyourvisit/pacific-northwest-trail.htm"
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -177,3 +186,12 @@ basis = "The page says: \"The Pacific Northwest Trail (PNT) travels 1,200 miles
|
||||
basis_url = "https://www.nps.gov/noca/planyourvisit/pacific-northwest-trail.htm"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: April to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -61,7 +61,11 @@ shape = "point-to-point"
|
||||
terrain = ["forest"]
|
||||
travel = "trail"
|
||||
unfinished = "The Trail Conference calls the trail a work in progress: it is blazed to Mountain Rest Road near Mohonk Mountain House, and local roads lead on from there."
|
||||
checked = "2026-11-14"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and September to November"
|
||||
months = [3, 4, 5, 9, 10, 11]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. A Hudson Valley ridge with humid, buggy summers and icy winters, so spring and fall are the most comfortable months. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://secure.nynjtc.org/node/874"
|
||||
@@ -74,6 +78,11 @@ slug = "appalachian-mountains"
|
||||
basis = "track"
|
||||
km = 49.0
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -102,3 +111,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: March to May and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -58,13 +58,22 @@ end = "West Stafford, Connecticut"
|
||||
shape = "point-to-point"
|
||||
terrain = ["forest"]
|
||||
travel = "trail"
|
||||
checked = "2026-11-16"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and September to November"
|
||||
months = [3, 4, 5, 9, 10, 11]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Central Connecticut has humid, buggy summers and cold, icy winters, so spring and fall are best. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://ctwoodlands.org/trails/shenipsit-trail/"
|
||||
publisher = "Connecticut Forest and Park Association"
|
||||
facts = ["official_url", "summary", "start", "end", "shape", "terrain", "travel"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -85,3 +94,12 @@ basis = "The pages named in the logo note were searched, and none shows an emble
|
||||
basis_url = "https://ctwoodlands.org/trails/shenipsit-trail/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: March to May and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -90,7 +90,11 @@ terrain = ["alpine", "lakes"]
|
||||
travel = "mostly-cross-country"
|
||||
days = [14, 21]
|
||||
permit = "A permit is needed from the agency that manages the trailhead where you start."
|
||||
checked = "2026-11-19"
|
||||
checked = "2026-11-20"
|
||||
season = "July to September"
|
||||
months = [7, 8, 9]
|
||||
season_basis = "sources"
|
||||
season_method = "The pages differ: Backpacking Routes gives late July to mid-September, and Skurka warns the route is off-limits to all but expert mountaineers from November through May. It was set by judgement from both and from the climate at the passes, which are near 12,000 feet. Confidence: high."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.mountaineers.org/books/books/sierra-high-route-2nd-edition-traversing-timberline-country"
|
||||
@@ -115,7 +119,12 @@ facts = ["end_lonlat"]
|
||||
[[hike.source]]
|
||||
url = "https://andrewskurka.com/adventures/sierra-high-route/logistical-considerations/"
|
||||
publisher = "Andrew Skurka (the route's author)"
|
||||
facts = ["permit"]
|
||||
facts = ["permit", "season", "months"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://backpackingroutes.com/sierra-high-route/"
|
||||
publisher = "Backpacking Routes"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Sierra High Route"
|
||||
@@ -219,3 +228,12 @@ basis = "The trail's own description says: \"The Sierra High Route is Steve Rope
|
||||
basis_url = "https://www.mountaineers.org/books/books/sierra-high-route-2nd-edition-traversing-timberline-country"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was set from pages that differ: July to September."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "The pages that state a season differ and none is the managing body, association or route author, so it was set by judgement from all of them and the climate estimate."
|
||||
basis_url = "https://andrewskurka.com/adventures/sierra-high-route/logistical-considerations/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -80,7 +80,11 @@ terrain = ["alpine", "lakes"]
|
||||
travel = "some-cross-country"
|
||||
permit = "The Forest Service requires a free wilderness permit to enter the Mount Shasta Wilderness, and a Summit Pass above 10,000 feet on the mountain."
|
||||
caution = "The route's last summit is Mt Shasta, a glaciated volcano that the Forest Service says has no trail to its top. Booksellers' copies of the guidebook's description disagree (read 2026-11-19): one says no advanced mountaineering equipment or specialty training is required in summer, though basic rock scrambling and navigation skills are, and another says advanced mountaineering equipment and specialty training may be required."
|
||||
checked = "2026-11-19"
|
||||
checked = "2026-11-20"
|
||||
season = "July to September"
|
||||
months = [7, 8, 9]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. The summits and cirque lakes are snowbound until late June, and Shasta is climbed in summer. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://outsideways.com/routes/us/siskiyou-peaks-trail/"
|
||||
@@ -149,6 +153,11 @@ slug = "trinity-alps-wilderness"
|
||||
basis = "stated"
|
||||
source = "https://www.booktopia.com.au/the-siskiyou-peaks-trail-aria-zoner/book/9781983447525.html"
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -178,3 +187,12 @@ basis = "The page says: \"Wilderness areas high-pointed on this trail include: -
|
||||
basis_url = "https://www.booktopia.com.au/the-siskiyou-peaks-trail-aria-zoner/book/9781983447525.html"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: July to September."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -73,7 +73,11 @@ shape = "point-to-point"
|
||||
terrain = ["desert", "forest", "canyon"]
|
||||
travel = "some-cross-country"
|
||||
caution = "Since 2023 its author has withdrawn the detailed route information and does not encourage hiking the exact layout, saying fires and floods have reclaimed many miles of trail."
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and September to November"
|
||||
months = [3, 4, 5, 9, 10, 11]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Summer heat and the July and August monsoon storms in southeastern Arizona push the walk into spring and fall. Confidence: low."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://simblissity.net/skit.shtml"
|
||||
@@ -85,6 +89,11 @@ url = "https://edits.nationalmap.gov/apps/gaz-domestic/public/summary/11334"
|
||||
publisher = "U.S. Geological Survey, Geographic Names Information System"
|
||||
facts = ["end_lonlat"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Sky Islands Traverse"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -139,3 +148,12 @@ basis = "The page says: \"Farther along the SKIT reaches Fort Bowie National His
|
||||
basis_url = "https://simblissity.net/skit.shtml"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: March to May and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -59,7 +59,11 @@ terrain = ["alpine", "forest", "lakes"]
|
||||
travel = "trail"
|
||||
caution = "Part of the trail lies in a special regulation area where visitors must pack out all human waste, and uses allowed vary from segment to segment."
|
||||
permit = "A free self-issued Forest Service registration, signed and dated for each visit, is needed to enter Cloud Peak Wilderness, which the loop circles."
|
||||
checked = "2026-11-19"
|
||||
checked = "2026-11-20"
|
||||
season = "July to September"
|
||||
months = [7, 8, 9]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Cloud Peak Wilderness at 9,000 to 11,000 feet holds snow into early July, and winter storms return in late September. Confidence: high."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.fs.usda.gov/r02/bighorn/recreation/trails/solitude-loop-trail-038"
|
||||
@@ -83,6 +87,11 @@ slug = "cloud-peak-wilderness"
|
||||
basis = "track"
|
||||
km = 67.9
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -130,3 +139,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: July to September."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -62,7 +62,11 @@ terrain = ["forest"]
|
||||
travel = "trail"
|
||||
high_point = "Greenwood fire tower"
|
||||
high_point_m = 725
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "April to June and September to October"
|
||||
months = [4, 5, 6, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Humid, buggy summers and icy winters on the Pennsylvania ridges leave spring and fall as the usual window. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.standingstonetrail.org/"
|
||||
@@ -74,6 +78,11 @@ url = "https://www.standingstonetrail.org/about"
|
||||
publisher = "Standing Stone Trail Club"
|
||||
facts = ["high_point"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Standing Stone Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -113,3 +122,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: April to June and September to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -60,7 +60,11 @@ terrain = ["forest", "alpine", "lakes"]
|
||||
travel = "some-cross-country"
|
||||
permit = "BC Parks' park brochure says there is no hiker registration in the Stein Valley."
|
||||
caution = "BC Parks says solid route finding skills are a necessity, because sections of trail may be wet, steep or difficult to see, and the upper valley above treeline is a route marked in places with cairns."
|
||||
checked = "2026-11-16"
|
||||
checked = "2026-11-20"
|
||||
season = "July to September"
|
||||
months = [7, 8, 9]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. The traverse tops out around 7,000 feet, where snow lingers into July, and heavy rain starts in October. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://bcparks.ca/stein-valley-nlakapamux-heritage-park/"
|
||||
@@ -89,6 +93,11 @@ slug = "coast-mountains"
|
||||
basis = "track"
|
||||
km = 89.0
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -118,3 +127,12 @@ basis = "Measured from the trail's main track against the Environment and Climat
|
||||
basis_url = "https://open.canada.ca/data/dataset/6c343726-1e92-451a-876a-76e17d398a1c"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: July to September."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -58,7 +58,11 @@ official_url = "https://www.srkg.org/"
|
||||
shape = "loop"
|
||||
terrain = ["forest", "lakes"]
|
||||
travel = "trail"
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "June to October"
|
||||
months = [6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. New Hampshire snow and mud last into spring and black flies into early June, with foliage-season walking into early October. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.srkg.org/"
|
||||
@@ -71,6 +75,11 @@ slug = "appalachian-mountains"
|
||||
basis = "track"
|
||||
km = 44.1
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -99,3 +108,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: June to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -72,7 +72,11 @@ shape = "point-to-point"
|
||||
terrain = ["alpine", "forest", "lakes"]
|
||||
travel = "some-cross-country"
|
||||
caution = "The route is unofficial; the Forest Service describes even its northernmost part at Meeks Bay as the unofficial Tahoe-Yosemite Trail."
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "July to September"
|
||||
months = [7, 8, 9]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. High Sierra passes up to about 10,000 feet hold snow until early July, and fall storms arrive in October. Confidence: high."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://shop.adventurewithkeen.com/wilderness-press/"
|
||||
@@ -94,6 +98,11 @@ url = "https://edits.nationalmap.gov/apps/gaz-domestic/public/summary/255168"
|
||||
publisher = "U.S. Geological Survey, Geographic Names Information System"
|
||||
facts = ["end_lonlat"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Tahoe-Yosemite Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -178,3 +187,12 @@ basis = "The trail's own description says: \"The Tahoe-Yosemite Trail is Thomas
|
||||
basis_url = "https://shop.adventurewithkeen.com/wilderness-press/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: July to September."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -0,0 +1,919 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Estimate a hiking season from climate, for trails no page gives one.
|
||||
|
||||
Python 3 standard library only. The estimator itself is a pure function
|
||||
over monthly climate normals (tools/season_model.py: thresholds on the
|
||||
track's high and low ground, blended with the seasons of the most
|
||||
similar sourced trails); this file finds a trail's sample points, reads
|
||||
their normals (tools/season_climate.py does the downloading, cached
|
||||
outside the repository) and runs the model, so its tests run with no
|
||||
network. See docs/superpowers/specs/2026-11-20-season-on-every-trail-design.md.
|
||||
|
||||
The model cannot know that some trails are walked in snow by choice, or
|
||||
that a page names only a thru-hike start window; the leave-one-out fit
|
||||
against sourced seasons says how often that matters.
|
||||
|
||||
Commands: fit (fit the model and record the leave-one-out figure), trial
|
||||
(compare the climate sources), warm (read every point's climate into the
|
||||
cache), propose (the review list), estimates (the trails whose season is an
|
||||
estimate) and check (rerun the machine estimate for every estimate and
|
||||
flag any whose inputs changed, and the fit). The seasons themselves are
|
||||
set by judgement from the packets of tools/season_judge.py, which also
|
||||
stages them for the refresh pipeline; the machine estimate is one input
|
||||
to that judgement and is not written to a record on its own.
|
||||
"""
|
||||
import sys
|
||||
|
||||
sys.dont_write_bytecode = True
|
||||
|
||||
import argparse
|
||||
import bisect
|
||||
import csv
|
||||
import datetime
|
||||
import hashlib
|
||||
import json
|
||||
import math
|
||||
import os
|
||||
import statistics
|
||||
import tomllib
|
||||
from dataclasses import dataclass, replace
|
||||
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.insert(0, HERE)
|
||||
|
||||
import refresh # noqa: E402
|
||||
import season # noqa: E402
|
||||
import season_batches # noqa: E402
|
||||
import season_climate # noqa: E402
|
||||
import season_model # noqa: E402
|
||||
|
||||
ROOT = os.path.dirname(HERE)
|
||||
|
||||
RULE_VERSION = 2
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SamplePoint:
|
||||
lat: float
|
||||
lon: float
|
||||
elev_m: float = None
|
||||
km: float = None
|
||||
|
||||
|
||||
Params = season_model.Params
|
||||
Reference = season_model.Reference
|
||||
months_in_season = season_model.months_in_season
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Sample points from a record. Track pieces are joined and oriented with
|
||||
# the same rule tools/elevation.py uses to build elevation.json (ends
|
||||
# within 100 m join, the whole track runs south to north or west to
|
||||
# east, parts in order along that axis, gaps between parts not counted
|
||||
# in the distance), reimplemented here with the standard library only,
|
||||
# so a sample point's kilometre matches the profile's kilometre and its
|
||||
# elevation can be read from the profile.
|
||||
|
||||
EARTH_R_M = 6371008.8
|
||||
JOIN_GAP_M = 100.0
|
||||
LOOP_FRACTION = 0.1
|
||||
SAMPLE_KM = 50.0
|
||||
MIN_POINTS = 3
|
||||
MAX_POINTS = 12
|
||||
|
||||
|
||||
def _track_parts(data):
|
||||
if data.get("type") == "FeatureCollection":
|
||||
geoms = [(f.get("geometry") or {}) for f in data.get("features", [])]
|
||||
elif data.get("type") == "Feature":
|
||||
geoms = [data.get("geometry") or {}]
|
||||
else:
|
||||
geoms = [data]
|
||||
parts = []
|
||||
for geom in geoms:
|
||||
if geom.get("type") == "LineString":
|
||||
parts.append(geom["coordinates"])
|
||||
elif geom.get("type") == "MultiLineString":
|
||||
parts.extend(geom["coordinates"])
|
||||
return [[(float(c[0]), float(c[1])) for c in p] for p in parts if len(p) >= 2]
|
||||
|
||||
|
||||
def _gap_m(a, b):
|
||||
dx = (a[0] - b[0]) * math.cos(math.radians((a[1] + b[1]) / 2))
|
||||
return math.hypot(dx, a[1] - b[1]) * math.pi / 180.0 * EARTH_R_M
|
||||
|
||||
|
||||
def _seg_km(a, b):
|
||||
return season_climate.haversine_km(a[1], a[0], b[1], b[0])
|
||||
|
||||
|
||||
def _join_parts(parts, gap_m=JOIN_GAP_M):
|
||||
if not parts:
|
||||
return []
|
||||
cell = max(gap_m, 1.0)
|
||||
k = math.pi / 180.0 * EARTH_R_M
|
||||
max_lat = max(abs(c[1]) for p in parts for c in (p[0], p[-1]))
|
||||
scale = max(math.cos(math.radians(max_lat)), 1e-9) * k
|
||||
|
||||
def cell_of(c):
|
||||
return (math.floor(c[0] * scale / cell), math.floor(c[1] * k / cell))
|
||||
|
||||
grid = {}
|
||||
for i, p in enumerate(parts):
|
||||
for end in (0, 1):
|
||||
grid.setdefault(cell_of(p[0] if end == 0 else p[-1]), []).append((i, end))
|
||||
used = [False] * len(parts)
|
||||
|
||||
def nearest(point):
|
||||
gx, gy = cell_of(point)
|
||||
best = None
|
||||
for x in (gx - 1, gx, gx + 1):
|
||||
for y in (gy - 1, gy, gy + 1):
|
||||
for i, end in grid.get((x, y), ()):
|
||||
if used[i]:
|
||||
continue
|
||||
d = _gap_m(point, parts[i][0] if end == 0 else parts[i][-1])
|
||||
if d <= gap_m and (best is None or d < best[0]):
|
||||
best = (d, i, end)
|
||||
return best
|
||||
|
||||
out = []
|
||||
for i0, first in enumerate(parts):
|
||||
if used[i0]:
|
||||
continue
|
||||
used[i0] = True
|
||||
chain = list(first)
|
||||
while True:
|
||||
hit = nearest(chain[-1])
|
||||
if hit is None:
|
||||
break
|
||||
_, i, end = hit
|
||||
used[i] = True
|
||||
chain.extend(parts[i] if end == 0 else parts[i][::-1])
|
||||
while True:
|
||||
hit = nearest(chain[0])
|
||||
if hit is None:
|
||||
break
|
||||
_, i, end = hit
|
||||
used[i] = True
|
||||
chain[:0] = parts[i][::-1] if end == 0 else parts[i]
|
||||
out.append(chain)
|
||||
return out
|
||||
|
||||
|
||||
def _orient(chains):
|
||||
"""Chains turned to run south to north or west to east and put in
|
||||
order along that axis, as tools/elevation.py does."""
|
||||
if not chains:
|
||||
return []
|
||||
lons = [c[0] for ch in chains for c in ch]
|
||||
lats = [c[1] for ch in chains for c in ch]
|
||||
mid_lat = (min(lats) + max(lats)) / 2.0
|
||||
width = (max(lons) - min(lons)) * math.cos(math.radians(mid_lat))
|
||||
axis = 1 if (max(lats) - min(lats)) > width else 0
|
||||
out = []
|
||||
for ch in chains:
|
||||
length_km = sum(_seg_km(a, b) for a, b in zip(ch, ch[1:]))
|
||||
if (_gap_m(ch[0], ch[-1]) > LOOP_FRACTION * length_km * 1000.0
|
||||
and ch[-1][axis] < ch[0][axis]):
|
||||
ch = ch[::-1]
|
||||
out.append(ch)
|
||||
out.sort(key=lambda ch: sum(c[axis] for c in ch) / len(ch))
|
||||
return out
|
||||
|
||||
|
||||
def _ordered_track(path):
|
||||
"""(vertices, cumulative km) along the joined, oriented track.
|
||||
The first vertex of each part sits at the same distance as the last
|
||||
vertex of the part before it: gaps are not counted."""
|
||||
with open(path, encoding="utf-8") as f:
|
||||
data = json.load(f)
|
||||
chains = _orient(_join_parts(_track_parts(data)))
|
||||
verts, cum = [], []
|
||||
total = 0.0
|
||||
for chain in chains:
|
||||
for j, vertex in enumerate(chain):
|
||||
if j:
|
||||
total += _seg_km(chain[j - 1], vertex)
|
||||
verts.append(vertex)
|
||||
cum.append(total)
|
||||
return verts, cum
|
||||
|
||||
|
||||
def _point_at(verts, cum, target_km):
|
||||
i = bisect.bisect_right(cum, target_km) - 1
|
||||
i = max(0, min(i, len(verts) - 2))
|
||||
span = cum[i + 1] - cum[i]
|
||||
frac = 0.0 if span <= 0 else (target_km - cum[i]) / span
|
||||
frac = max(0.0, min(1.0, frac))
|
||||
lon = verts[i][0] + frac * (verts[i + 1][0] - verts[i][0])
|
||||
lat = verts[i][1] + frac * (verts[i + 1][1] - verts[i][1])
|
||||
if target_km >= cum[-1]:
|
||||
lon, lat = verts[-1]
|
||||
return lat, lon
|
||||
|
||||
|
||||
def _profile_elev(profile, km):
|
||||
"""Elevation in metres from an elevation.json profile at km."""
|
||||
if not profile:
|
||||
return None
|
||||
kms = [float(p[0]) for p in profile]
|
||||
i = bisect.bisect_right(kms, km) - 1
|
||||
if i < 0:
|
||||
return float(profile[0][1])
|
||||
if i >= len(profile) - 1:
|
||||
return float(profile[-1][1])
|
||||
km0, el0 = float(profile[i][0]), float(profile[i][1])
|
||||
km1, el1 = float(profile[i + 1][0]), float(profile[i + 1][1])
|
||||
if km1 <= km0:
|
||||
return el1
|
||||
return el0 + (km - km0) / (km1 - km0) * (el1 - el0)
|
||||
|
||||
|
||||
def _load_profile(root, tid):
|
||||
path = os.path.join(root, tid, "elevation.json")
|
||||
if not os.path.exists(path):
|
||||
return None, None
|
||||
with open(path, encoding="utf-8") as f:
|
||||
doc = json.load(f)
|
||||
return doc.get("profile") or None, (doc.get("highest") or None)
|
||||
|
||||
|
||||
def _give_high_point(points, hike, highest):
|
||||
"""With no profile, one point carries high_point_m so the high
|
||||
ground is represented at all: the point nearest the profile's
|
||||
highest place when that is known, else the first point."""
|
||||
high_m = hike.get("high_point_m")
|
||||
if high_m is None or not points:
|
||||
return points
|
||||
idx = 0
|
||||
if highest and highest.get("lat") is not None:
|
||||
idx = min(range(len(points)),
|
||||
key=lambda i: season_climate.haversine_km(
|
||||
points[i].lat, points[i].lon,
|
||||
float(highest["lat"]), float(highest["lon"])))
|
||||
return [replace(p, elev_m=float(high_m)) if i == idx else p
|
||||
for i, p in enumerate(points)]
|
||||
|
||||
|
||||
def sample_points(root, rec):
|
||||
"""Sample points for a record and how they were got: "track" (one
|
||||
per 50 km of track, at least 3, at most 12, evenly spaced, with
|
||||
elevations from the profile), "ends" (hike.start_lonlat and
|
||||
hike.end_lonlat), or "place" (the centre of the first region's box
|
||||
in web/place-bounds.toml). An elevation of None lets the climate
|
||||
source supply its own cell elevation. With no profile, one point
|
||||
carries hike.high_point_m when the record has one."""
|
||||
tid = rec.get("id") or ""
|
||||
hike = rec.get("hike") or {}
|
||||
line_file = (rec.get("source") or {}).get("line_file") or "line.geojson"
|
||||
line_path = os.path.join(root, tid, line_file)
|
||||
if tid and os.path.exists(line_path):
|
||||
try:
|
||||
verts, cum = _ordered_track(line_path)
|
||||
except (OSError, ValueError, KeyError, TypeError, IndexError):
|
||||
verts, cum = [], []
|
||||
if len(verts) >= 2 and cum and cum[-1] > 0:
|
||||
total = cum[-1]
|
||||
n = min(MAX_POINTS, max(MIN_POINTS, int(round(total / SAMPLE_KM)) + 1))
|
||||
profile, highest = _load_profile(root, tid)
|
||||
points = []
|
||||
for i in range(n):
|
||||
target = total * i / (n - 1)
|
||||
lat, lon = _point_at(verts, cum, target)
|
||||
elev = _profile_elev(profile, target)
|
||||
points.append(SamplePoint(lat=lat, lon=lon, elev_m=elev,
|
||||
km=round(target, 2)))
|
||||
if not profile:
|
||||
points = _give_high_point(points, hike, highest)
|
||||
return points, "track"
|
||||
|
||||
ends = []
|
||||
for key in ("start_lonlat", "end_lonlat"):
|
||||
value = hike.get(key)
|
||||
if value and len(value) == 2:
|
||||
ends.append(SamplePoint(lat=float(value[1]), lon=float(value[0]),
|
||||
elev_m=None, km=None))
|
||||
if ends:
|
||||
if hike.get("high_point_m") is not None:
|
||||
ends[0] = replace(ends[0], elev_m=float(hike["high_point_m"]))
|
||||
return ends, "ends"
|
||||
|
||||
regions = rec.get("regions") or []
|
||||
country = rec.get("country") or ""
|
||||
bounds_path = os.path.join(root, "web", "place-bounds.toml")
|
||||
if regions and os.path.exists(bounds_path):
|
||||
with open(bounds_path, "rb") as f:
|
||||
boxes = (tomllib.load(f) or {}).get("box") or {}
|
||||
box = boxes.get(f"{country}-{regions[0]}")
|
||||
if box is None:
|
||||
for key, value in boxes.items():
|
||||
if key.endswith("-" + str(regions[0])):
|
||||
box = value
|
||||
break
|
||||
if box and len(box) == 4:
|
||||
elev = hike.get("high_point_m")
|
||||
return [SamplePoint(lat=(float(box[1]) + float(box[3])) / 2,
|
||||
lon=(float(box[0]) + float(box[2])) / 2,
|
||||
elev_m=None if elev is None else float(elev),
|
||||
km=None)], "place"
|
||||
return [], "place"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Fitting the model against the sourced seasons, scored leave-one-out
|
||||
# (tools/season_model.py). Estimates may ship only over the owner's bar,
|
||||
# held here in one place.
|
||||
|
||||
BAR = {"within1_min": 0.75, "coverage_min": 0.90}
|
||||
|
||||
|
||||
def season_kind(months):
|
||||
"""The kind of trail a sourced season describes, from the season
|
||||
alone: "year-round" (eleven or twelve months), "cool-season" (hiked
|
||||
in the cool months, none of June to August), "alpine" (a summer
|
||||
season that leaves out December to February and covers July or
|
||||
August, at most six months) or "other" (the shoulder seasons and
|
||||
the rest)."""
|
||||
months = set(months)
|
||||
if len(months) >= 11:
|
||||
return "year-round"
|
||||
if not months & {6, 7, 8}:
|
||||
return "cool-season"
|
||||
if not months & {12, 1, 2} and months & {7, 8} and len(months) <= 6:
|
||||
return "alpine"
|
||||
return "other"
|
||||
|
||||
|
||||
KINDS = ("alpine", "cool-season", "year-round", "other")
|
||||
|
||||
|
||||
def report(sourced, loo):
|
||||
"""How the model did leave-one-out on sourced trails. sourced is
|
||||
(id, medians or None, months, region group); loo maps id to
|
||||
(estimated mask, score) from season_model.fit_model. n counts every
|
||||
sourced trail; no_data those whose points lack climate data;
|
||||
within1 those that match under the owner's measure (a match is
|
||||
within one month at each end, window by window for two windows,
|
||||
ten or more months for a year-round season). classified and
|
||||
jaccard are means over the estimable trails, by kind and by region
|
||||
group too."""
|
||||
def empty():
|
||||
return {"n": 0, "within1": 0, "no_data": 0, "worse": 0,
|
||||
"classified": 0.0, "jaccard": 0.0}
|
||||
total, by_group = empty(), {}
|
||||
by_kind = {k: empty() for k in KINDS}
|
||||
for tid, med, months, group in sourced:
|
||||
buckets = (total, by_group.setdefault(group, empty()),
|
||||
by_kind[season_kind(months)])
|
||||
for b in buckets:
|
||||
b["n"] += 1
|
||||
if med is None or tid not in loo:
|
||||
for b in buckets:
|
||||
b["no_data"] += 1
|
||||
continue
|
||||
a, c_share, jac = loo[tid][1]
|
||||
for b in buckets:
|
||||
if a:
|
||||
b["within1"] += 1
|
||||
else:
|
||||
b["worse"] += 1
|
||||
b["classified"] += c_share
|
||||
b["jaccard"] += jac
|
||||
for b in (total, *by_group.values(), *by_kind.values()):
|
||||
est = b["n"] - b["no_data"]
|
||||
b["classified"] = round(b["classified"] / est, 4) if est else 0.0
|
||||
b["jaccard"] = round(b["jaccard"] / est, 4) if est else 0.0
|
||||
total["by_group"] = by_group
|
||||
total["by_kind"] = by_kind
|
||||
return total
|
||||
|
||||
|
||||
def passes_bar(rep, bar=BAR):
|
||||
"""The owner's bar: at least 75 percent of sourced trails matched
|
||||
leave-one-out, and at least 90 percent estimable."""
|
||||
n = rep.get("n") or 0
|
||||
if not n:
|
||||
return False
|
||||
return (rep["within1"] / n >= bar["within1_min"]
|
||||
and 1 - rep["no_data"] / n >= bar["coverage_min"])
|
||||
|
||||
|
||||
def _records(root):
|
||||
for tid in refresh.trail_ids(root):
|
||||
yield tid, refresh.load_toml(os.path.join(root, tid, "trail.toml"))
|
||||
|
||||
|
||||
def normals_at(points, fetch):
|
||||
return [fetch(p.lat, p.lon, p.elev_m) for p in points]
|
||||
|
||||
|
||||
def sourced_trails(root, fetch, log=None):
|
||||
"""(id, medians or None, sourced months, region group) for every
|
||||
record whose season comes from a page. Fetching goes through the
|
||||
climate cache; a network failure aborts the run and a rerun
|
||||
resumes from the cache, so no point is ever downloaded twice."""
|
||||
out = []
|
||||
for tid, rec in _records(root):
|
||||
hike = rec.get("hike") or {}
|
||||
if not season.read_from_a_page(hike):
|
||||
continue
|
||||
points, kind = sample_points(root, rec)
|
||||
med = season_model.medians(normals_at(points, fetch))
|
||||
if log:
|
||||
log(f"{tid}: {kind}, {len(points)} points")
|
||||
out.append((tid, med, list(hike.get("months") or []),
|
||||
season_batches.group_of(rec)))
|
||||
return out
|
||||
|
||||
|
||||
def _fetch_with_cache(cache_dir):
|
||||
if cache_dir is None:
|
||||
return season_climate.fetch_normals
|
||||
return lambda lat, lon, elev: season_climate.fetch_normals(
|
||||
lat, lon, elev, cache=cache_dir)
|
||||
|
||||
|
||||
def fit_sourced(sourced):
|
||||
"""(params fitted on all, leave-one-out report) for sourced trails;
|
||||
the estimable ones are fitted and the rest counted as no data."""
|
||||
usable = [(t[0], t[1], t[2]) for t in sourced if t[1] is not None]
|
||||
params, loo = season_model.fit_model(usable)
|
||||
return params, report(sourced, loo), loo
|
||||
|
||||
|
||||
def confidence_cut(sourced, loo, params):
|
||||
"""The (close, decisive) limits of season_model.confidence that
|
||||
make a "high" estimate the most reliable group of at least a
|
||||
quarter of the sourced trails, by a leave-one-out look: for each
|
||||
trail, its neighbours leave it out. Returns the pair and the
|
||||
share of high and low estimates that matched."""
|
||||
refs = [Reference(t[0], t[1], t[2]) for t in sourced if t[1] is not None]
|
||||
rows = []
|
||||
for tid, med, months, _g in sourced:
|
||||
if med is None or tid not in loo:
|
||||
continue
|
||||
near = season_model.nearest(med, refs, params.k, exclude=tid)
|
||||
_mask, scores, fell = season_model.blend(med, near, params)
|
||||
rows.append((near, scores, fell, med, loo[tid][1][0]))
|
||||
best = None
|
||||
for close in (0.08, 0.1, 0.12, 0.15, 0.2, 0.3):
|
||||
for decisive in (0.5, 0.6, 0.7, 0.8, 0.9):
|
||||
hi = [r[4] for r in rows
|
||||
if season_model.confidence(r[3], r[0], r[1], r[2], close, decisive)[0] == "high"]
|
||||
lo = [r[4] for r in rows
|
||||
if season_model.confidence(r[3], r[0], r[1], r[2], close, decisive)[0] == "low"]
|
||||
if len(hi) < len(rows) / 4 or not lo:
|
||||
continue
|
||||
gap = sum(hi) / len(hi) - sum(lo) / len(lo)
|
||||
if best is None or gap > best[0]:
|
||||
best = (gap, close, decisive, sum(hi) / len(hi), sum(lo) / len(lo), len(hi))
|
||||
return best
|
||||
|
||||
|
||||
def _params_doc(params):
|
||||
return params.as_dict()
|
||||
|
||||
|
||||
def cmd_fit(args):
|
||||
fetch = _fetch_with_cache(args.cache)
|
||||
sourced = sourced_trails(ROOT, fetch, log=lambda line: print(line, flush=True))
|
||||
params, rep, loo = fit_sourced(sourced)
|
||||
doc = {
|
||||
"computed": datetime.date.today().isoformat(),
|
||||
"rule_version": RULE_VERSION,
|
||||
"dataset": season_climate.SOURCE["name"],
|
||||
"period": season_climate.SOURCE["period"],
|
||||
"params": _params_doc(params),
|
||||
"loo": rep,
|
||||
"bar": BAR,
|
||||
"passes": passes_bar(rep),
|
||||
"confidence": None,
|
||||
}
|
||||
best = confidence_cut(sourced, loo, params)
|
||||
if best:
|
||||
doc["confidence"] = {"close": best[1], "decisive": best[2],
|
||||
"high_matched": round(best[3], 3),
|
||||
"low_matched": round(best[4], 3), "high_n": best[5]}
|
||||
path = os.path.join(ROOT, "tools", "season_fit.json")
|
||||
with open(path, "w", encoding="utf-8") as f:
|
||||
json.dump(doc, f, indent=1, sort_keys=True)
|
||||
f.write("\n")
|
||||
print(f"sourced {rep['n']}: leave-one-out matched {rep['within1']}/{rep['n']}, "
|
||||
f"classified {rep['classified']}, jaccard {rep['jaccard']}, "
|
||||
f"no data {rep['no_data']}, passes {doc['passes']}")
|
||||
print(f"params {_params_doc(params)}; confidence {doc['confidence']}")
|
||||
print(f"wrote {path}")
|
||||
return 0
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Estimates for trails with no sourced season, the review list a person
|
||||
# reads, the staged proposals that write accepted estimates through the
|
||||
# refresh pipeline, and the check that reruns both.
|
||||
|
||||
COARSE_PARAMS = Params(cold_c_min=5.0, heat_c_max=32.0)
|
||||
|
||||
# The trial's twelve, by rule: akshayuk-pass is the far north trail;
|
||||
# great-divide-trail and west-coast-trail are in Canada; john-muir,
|
||||
# colorado-trail and uinta-highline are alpine; desert-winter-thru-hike
|
||||
# and arizona are desert; west-coast-trail and washington-coast-trail
|
||||
# are coastal; maah-daah-hey is prairie; florida is the southeast;
|
||||
# superior-hiking fills the dozen from the midwest.
|
||||
TRIAL_TRAILS = ["akshayuk-pass", "great-divide-trail", "west-coast-trail",
|
||||
"john-muir", "colorado-trail", "uinta-highline",
|
||||
"desert-winter-thru-hike", "arizona", "florida",
|
||||
"washington-coast-trail", "maah-daah-hey", "superior-hiking"]
|
||||
|
||||
FLAG_ORDER = ("no-track", "place-centre", "no-data", "no-month",
|
||||
"desert", "coast", "far-north", "few-points")
|
||||
|
||||
def _flags(points, kind, normals, med, params, fell_back=False):
|
||||
found = set()
|
||||
if kind != "track":
|
||||
found.add("no-track")
|
||||
if kind == "place":
|
||||
found.add("place-centre")
|
||||
if len(points) < 3:
|
||||
found.add("few-points")
|
||||
if points and max(p.lat for p in points) > 60:
|
||||
found.add("far-north")
|
||||
if med is None:
|
||||
found.add("no-data")
|
||||
else:
|
||||
elevs = [n.elev_m for n in normals if n is not None]
|
||||
if elevs and max(elevs) <= 200:
|
||||
found.add("coast")
|
||||
high, low = med
|
||||
for m in range(12):
|
||||
if high[m] >= params.cold_c_min and low[m] > params.heat_c_max:
|
||||
found.add("desert")
|
||||
break
|
||||
if fell_back:
|
||||
found.add("no-month")
|
||||
return [name for name in FLAG_ORDER if name in found]
|
||||
|
||||
|
||||
_REFS = {}
|
||||
|
||||
|
||||
def references(root, fetch):
|
||||
"""The sourced trails as comparable-trail references, read once per
|
||||
root per run (sampling and reading every sourced trail again for
|
||||
each estimate would take minutes)."""
|
||||
if root not in _REFS:
|
||||
_REFS[root] = [Reference(t[0], t[1], t[2])
|
||||
for t in sourced_trails(root, fetch) if t[1] is not None]
|
||||
return _REFS[root]
|
||||
|
||||
|
||||
def estimate(root, rec, params, fetch=season_climate.fetch_normals, refs=None):
|
||||
"""One trail's estimated season and how much to trust it: months
|
||||
(None when unestimable, with the reason), the phrase and method
|
||||
sentence an accepted estimate would carry, how its points were got,
|
||||
flags for hand review, the comparable trails the estimate drew on
|
||||
(nearest first, as (id, distance, sourced phrase)) and a confidence
|
||||
("high" or "low") with its reason. A trail's own sourced season is
|
||||
never one of its comparable trails. refs defaults to the sourced
|
||||
trails read through fetch. Fetch errors propagate; nothing here
|
||||
touches the network except through fetch."""
|
||||
points, kind = sample_points(root, rec)
|
||||
normals = normals_at(points, fetch)
|
||||
med = season_model.medians(normals)
|
||||
if refs is None:
|
||||
refs = references(root, fetch)
|
||||
months, near, fell_back, conf, why = None, [], False, "low", ""
|
||||
if med is not None:
|
||||
near = season_model.nearest(med, refs, params.k, exclude=rec.get("id"))
|
||||
mask, scores, fell_back = season_model.blend(med, near, params)
|
||||
months = season_model.to_months(mask)
|
||||
limits = {"close": 0.12, "decisive": 0.7}
|
||||
try:
|
||||
limits = (load_fit(root).get("confidence") or limits)
|
||||
except OSError:
|
||||
pass
|
||||
conf, why = season_model.confidence(
|
||||
med, near, scores, fell_back, limits["close"], limits["decisive"])
|
||||
if kind != "track" or len(points) < 3:
|
||||
conf, why = "low", "the location is a fallback (" + (
|
||||
"the trail's ends" if kind == "ends" else "the region's centre") + ")"
|
||||
else:
|
||||
why = "no data for one of the sample points"
|
||||
phrases = _phrases(root)
|
||||
comparable = [(r.id, round(d, 3), phrases.get(r.id, ""), season_model.to_months(r.mask))
|
||||
for d, r in near]
|
||||
return {
|
||||
"months": months,
|
||||
"phrase": season.phrase_for(months) if months else "",
|
||||
"method": season.method_sentence(
|
||||
season_climate.SOURCE["name"], season_climate.SOURCE["period"],
|
||||
len(points), kind, RULE_VERSION),
|
||||
"kind": kind,
|
||||
"flags": _flags(points, kind, normals, med, params, fell_back),
|
||||
"comparable": comparable[0][0] if comparable else "",
|
||||
"comparable_phrase": comparable[0][2] if comparable else "",
|
||||
"neighbours": comparable,
|
||||
"confidence": conf,
|
||||
"confidence_reason": why,
|
||||
"reason": "" if months else why,
|
||||
"points": points,
|
||||
"normals": normals,
|
||||
}
|
||||
|
||||
|
||||
def _phrases(root):
|
||||
if root not in _PHRASES:
|
||||
out = {}
|
||||
for tid, rec in _records(root):
|
||||
hike = rec.get("hike") or {}
|
||||
if season.read_from_a_page(hike):
|
||||
out[tid] = str(hike.get("season"))
|
||||
_PHRASES[root] = out
|
||||
return _PHRASES[root]
|
||||
|
||||
|
||||
_PHRASES = {}
|
||||
|
||||
|
||||
def load_fit(root):
|
||||
with open(os.path.join(root, "tools", "season_fit.json"), encoding="utf-8") as f:
|
||||
return json.load(f)
|
||||
|
||||
|
||||
def load_params(root):
|
||||
return Params.from_dict(load_fit(root)["params"])
|
||||
|
||||
|
||||
def _with_cache(fetch_fn, cache_dir):
|
||||
if cache_dir is None:
|
||||
return fetch_fn
|
||||
return lambda lat, lon, elev: fetch_fn(lat, lon, elev, cache=cache_dir)
|
||||
|
||||
|
||||
def propose(root, params, fetch, given_dir=None):
|
||||
"""Write the review list, one row per trail with no season, to
|
||||
<staging>/season/estimates.csv and list every unestimable trail
|
||||
with its reason. Returns the row count."""
|
||||
staging = refresh.staging_dir(root, given_dir, create=True)
|
||||
out_dir = os.path.join(staging, "season")
|
||||
os.makedirs(out_dir, exist_ok=True)
|
||||
rows, unestimable = [], []
|
||||
for tid, rec in _records(root):
|
||||
if (rec.get("hike") or {}).get("season"):
|
||||
continue
|
||||
est = estimate(root, dict(rec, id=tid), params, fetch)
|
||||
rows.append([tid, " ".join(str(m) for m in est["months"] or []),
|
||||
est["phrase"], est["kind"], ";".join(est["flags"]),
|
||||
est["comparable"], est["comparable_phrase"]])
|
||||
if not est["months"]:
|
||||
unestimable.append((tid, est["reason"]))
|
||||
path = os.path.join(out_dir, "estimates.csv")
|
||||
with open(path, "w", newline="", encoding="utf-8") as f:
|
||||
writer = csv.writer(f)
|
||||
writer.writerow(["id", "proposed_months", "phrase", "kind", "flags",
|
||||
"comparable", "comparable_phrase"])
|
||||
writer.writerows(rows)
|
||||
for tid, reason in unestimable:
|
||||
print(f"{tid}: not estimable: {reason}")
|
||||
print(f"{len(rows)} rows written to {path} "
|
||||
f"({len(unestimable)} not estimable)")
|
||||
return len(rows)
|
||||
|
||||
|
||||
def _toml_str(text):
|
||||
return '"' + str(text).replace("\\", "\\\\").replace('"', '\\"') + '"'
|
||||
|
||||
|
||||
def inputs_signature(est):
|
||||
"""What an estimate rests on, as a small comparable record: the machine
|
||||
estimate's months and a digest of the climate at the high and low
|
||||
ground and of the sourced trails it was compared with."""
|
||||
normals = est["normals"]
|
||||
med = season_model.medians(normals) if all(n is not None for n in normals) else None
|
||||
material = json.dumps({"med": med, "near": [n[0] for n in est["neighbours"]]},
|
||||
sort_keys=True)
|
||||
return {"machine": sorted(est["months"] or []),
|
||||
"digest": hashlib.sha256(material.encode()).hexdigest()[:16]}
|
||||
|
||||
|
||||
def load_inputs(root):
|
||||
path = os.path.join(root, "tools", "season_inputs.json")
|
||||
try:
|
||||
with open(path, encoding="utf-8") as f:
|
||||
return json.load(f)
|
||||
except OSError:
|
||||
return {}
|
||||
|
||||
|
||||
def estimates(root):
|
||||
"""The ids of the records whose season is an estimate, in order."""
|
||||
return [tid for tid, rec in _records(root)
|
||||
if (rec.get("hike") or {}).get("season_basis") == "estimate"]
|
||||
|
||||
|
||||
def check(root, fetch):
|
||||
"""Rerun the machine estimate for every estimated season and the
|
||||
leave-one-out fit. Returns (ok, lines): not ok when an estimate's
|
||||
inputs have changed since they were recorded in
|
||||
tools/season_inputs.json (the machine estimate, the climate at the
|
||||
trail, or the sourced trails it is compared with), when the
|
||||
leave-one-out match share has fallen by more than 0.02 from
|
||||
tools/season_fit.json, or when the blind test of the judged method
|
||||
(tools/season_blind_test.json) is missing or below the bar. A changed
|
||||
estimate is a flag for a person to look at, not a rewrite."""
|
||||
import season_judge
|
||||
try:
|
||||
fit = load_fit(root)
|
||||
except OSError:
|
||||
return False, ["tools/season_fit.json is missing: run "
|
||||
"python3 tools/estimate_season.py fit"]
|
||||
params = load_params(root)
|
||||
ok, lines, checked = True, [], 0
|
||||
refs = references(root, fetch)
|
||||
recorded = load_inputs(root)
|
||||
for tid, rec in _records(root):
|
||||
hike = rec.get("hike") or {}
|
||||
if hike.get("season_basis") != "estimate":
|
||||
continue
|
||||
checked += 1
|
||||
sig = inputs_signature(estimate(root, dict(rec, id=tid), params, fetch, refs))
|
||||
then = recorded.get(tid)
|
||||
if then is None:
|
||||
ok = False
|
||||
lines.append(f"{tid}: no inputs are recorded for this estimate: run "
|
||||
"python3 tools/season_judge.py inputs")
|
||||
elif sig["machine"] != then["machine"]:
|
||||
ok = False
|
||||
lines.append(f"{tid}: inputs changed: the machine estimate was {then['machine']}, "
|
||||
f"now {sig['machine']}; the season is {sorted(hike.get('months') or [])}")
|
||||
elif sig["digest"] != then["digest"]:
|
||||
ok = False
|
||||
lines.append(f"{tid}: inputs changed: the climate or the similar sourced trails differ "
|
||||
f"(machine estimate still {sig['machine']}); the season is "
|
||||
f"{sorted(hike.get('months') or [])}")
|
||||
for tid in sorted(set(recorded) - set(estimates(root))):
|
||||
ok = False
|
||||
lines.append(f"{tid}: has recorded inputs but is no longer an estimate: remove it "
|
||||
"from tools/season_inputs.json")
|
||||
sourced = sourced_trails(root, fetch)
|
||||
if any(s[1] is not None for s in sourced):
|
||||
_p, now, _loo = fit_sourced(sourced)
|
||||
stored = fit.get("loo") or {}
|
||||
if stored.get("n"):
|
||||
was_share = stored["within1"] / stored["n"]
|
||||
now_share = now["within1"] / now["n"] if now["n"] else 0.0
|
||||
if was_share - now_share > 0.02:
|
||||
ok = False
|
||||
lines.append(
|
||||
f"fit got worse: leave-one-out matches "
|
||||
f"{now['within1']}/{now['n']} ({now_share:.2f}), "
|
||||
f"was {stored['within1']}/{stored['n']} ({was_share:.2f})")
|
||||
try:
|
||||
blind = season_judge.load_blind_test(os.path.join(root, "tools", "season_blind_test.json"))
|
||||
problems = season_judge.check_blind_test(blind)
|
||||
if problems:
|
||||
ok = False
|
||||
lines += [f"tools/season_blind_test.json: {p}" for p in problems]
|
||||
elif blind["share"] < BAR["within1_min"]:
|
||||
ok = False
|
||||
lines.append(f"the blind test matched {blind['share']:.2f}, under the bar of "
|
||||
f"{BAR['within1_min']:.2f}; estimates must not ship")
|
||||
except (OSError, ValueError, KeyError):
|
||||
ok = False
|
||||
lines.append("tools/season_blind_test.json is missing or unreadable")
|
||||
if ok:
|
||||
lines.append(f"check passed: {checked} estimated seasons rest on the same inputs")
|
||||
return ok, lines
|
||||
|
||||
|
||||
def cmd_trial(args):
|
||||
for name, fetch_fn in season_climate.CANDIDATES.items():
|
||||
fetch = _with_cache(fetch_fn, args.cache)
|
||||
print(f"{name}: trail (sourced months) gives estimated months, grade")
|
||||
data = within = 0
|
||||
for tid in TRIAL_TRAILS:
|
||||
rec = refresh.load_toml(os.path.join(ROOT, tid, "trail.toml"))
|
||||
sourced = list((rec.get("hike") or {}).get("months") or [])
|
||||
points, _kind = sample_points(ROOT, rec)
|
||||
try:
|
||||
normals = normals_at(points, fetch)
|
||||
except Exception as exc:
|
||||
print(f" {tid} ({sourced}): error {type(exc).__name__}: {exc}")
|
||||
continue
|
||||
months = months_in_season(normals, COARSE_PARAMS) if points else None
|
||||
if normals and all(n is not None for n in normals):
|
||||
data += 1
|
||||
grade = season.grade(months, sourced) if months else "no-month"
|
||||
within += grade in ("exact", "within1")
|
||||
print(f" {tid} ({sourced}): {months}, {grade}")
|
||||
else:
|
||||
print(f" {tid} ({sourced}): no data")
|
||||
print(f" data for {data} of {len(TRIAL_TRAILS)}, "
|
||||
f"exact or within one month for {within}")
|
||||
return 0
|
||||
|
||||
|
||||
def all_sample_points(root):
|
||||
"""Every sample point for every record, as (id, kind, points)."""
|
||||
out = []
|
||||
for tid, rec in _records(root):
|
||||
points, kind = sample_points(root, rec)
|
||||
out.append((tid, kind, points))
|
||||
return out
|
||||
|
||||
|
||||
def cmd_warm(args):
|
||||
"""Read the climate for every sample point of every trail into the
|
||||
cache, several points at a time. Safe to stop and rerun."""
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
fetch = _fetch_with_cache(args.cache)
|
||||
jobs = []
|
||||
seen = set()
|
||||
for _tid, _kind, points in all_sample_points(ROOT):
|
||||
for p in points:
|
||||
key = (round(p.lat, 3), round(p.lon, 3),
|
||||
None if p.elev_m is None else int(round(p.elev_m)))
|
||||
if key not in seen:
|
||||
seen.add(key)
|
||||
jobs.append(p)
|
||||
print(f"{len(jobs)} distinct points", flush=True)
|
||||
done = [0]
|
||||
nodata = [0]
|
||||
|
||||
def one(p):
|
||||
n = fetch(p.lat, p.lon, p.elev_m)
|
||||
done[0] += 1
|
||||
if n is None:
|
||||
nodata[0] += 1
|
||||
if done[0] % 25 == 0 or done[0] == len(jobs):
|
||||
print(f"{done[0]}/{len(jobs)} done, {nodata[0]} without data",
|
||||
flush=True)
|
||||
|
||||
with ThreadPoolExecutor(max_workers=args.workers) as pool:
|
||||
list(pool.map(one, jobs))
|
||||
print("warm finished", flush=True)
|
||||
return 0
|
||||
|
||||
|
||||
def cmd_propose(args):
|
||||
fetch = _fetch_with_cache(args.cache)
|
||||
propose(ROOT, load_params(ROOT), fetch, args.dir)
|
||||
return 0
|
||||
|
||||
|
||||
def cmd_estimates(args):
|
||||
for tid in estimates(ROOT):
|
||||
print(tid)
|
||||
return 0
|
||||
|
||||
|
||||
def cmd_check(args):
|
||||
fetch = _fetch_with_cache(args.cache)
|
||||
ok, lines = check(ROOT, fetch)
|
||||
for line in lines:
|
||||
print(line)
|
||||
return 0 if ok else 1
|
||||
|
||||
|
||||
def main(argv=None):
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
sub = parser.add_subparsers(dest="command", required=True)
|
||||
fit_parser = sub.add_parser(
|
||||
"fit", help="fit the rule against the sourced seasons")
|
||||
fit_parser.add_argument("--cache", default=None,
|
||||
help="climate cache directory")
|
||||
fit_parser.set_defaults(func=cmd_fit)
|
||||
trial_parser = sub.add_parser(
|
||||
"trial", help="compare the climate candidates on twelve trails")
|
||||
trial_parser.add_argument("--cache", default=None,
|
||||
help="climate cache directory")
|
||||
trial_parser.set_defaults(func=cmd_trial)
|
||||
warm_parser = sub.add_parser(
|
||||
"warm", help="read the climate for every sample point into the cache")
|
||||
warm_parser.add_argument("--cache", default=None,
|
||||
help="climate cache directory")
|
||||
warm_parser.add_argument("--workers", type=int, default=6)
|
||||
warm_parser.set_defaults(func=cmd_warm)
|
||||
propose_parser = sub.add_parser(
|
||||
"propose", help="write the estimate review list")
|
||||
propose_parser.add_argument("--dir", default=None,
|
||||
help="staging directory")
|
||||
propose_parser.add_argument("--cache", default=None,
|
||||
help="climate cache directory")
|
||||
propose_parser.set_defaults(func=cmd_propose)
|
||||
estimates_parser = sub.add_parser(
|
||||
"estimates", help="list the trails whose season is an estimate")
|
||||
estimates_parser.set_defaults(func=cmd_estimates)
|
||||
check_parser = sub.add_parser(
|
||||
"check", help="rerun every estimate and the fit")
|
||||
check_parser.add_argument("--cache", default=None,
|
||||
help="climate cache directory")
|
||||
check_parser.set_defaults(func=cmd_check)
|
||||
argv = ["check" if a == "--check" else a
|
||||
for a in (sys.argv[1:] if argv is None else argv)]
|
||||
args = parser.parse_args(argv)
|
||||
return args.func(args)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
+176
-4
@@ -4,9 +4,41 @@ Python 3 standard library only. tools/validate.py imports this module; it
|
||||
must not import validate.py. The fields are documented in docs/schema.md.
|
||||
"""
|
||||
|
||||
import re
|
||||
import urllib.parse
|
||||
|
||||
BASES = ("primary", "sources", "source", "estimate")
|
||||
PROVENANCE_KEYS = frozenset({"season_basis", "season_method"})
|
||||
SEASON_REQUIRED = False
|
||||
SEASON_REQUIRED = True
|
||||
# The host of the climate data an estimate cites (tools/season_climate.SOURCE).
|
||||
CLIMATE_HOSTS = frozenset({"www.chelsa-climate.org"})
|
||||
CONFIDENCES = ("high", "medium", "low")
|
||||
_CONFIDENCE_END = re.compile(r"Confidence: (high|medium|low)\.\s*$")
|
||||
|
||||
|
||||
def _is_climate(source):
|
||||
host = urllib.parse.urlparse(str(source.get("url", ""))).hostname
|
||||
return host in CLIMATE_HOSTS
|
||||
|
||||
|
||||
def confidence_of(method):
|
||||
""""high", "medium" or "low" from the end of a season_method, else ""."""
|
||||
found = _CONFIDENCE_END.search(str(method or ""))
|
||||
return found.group(1) if found else ""
|
||||
|
||||
|
||||
def read_from_a_page(hike):
|
||||
"""True when a page states the season: one is present, its basis is not
|
||||
"estimate", and no method records that it was worked out by judgement
|
||||
(the seasons set from pages that disagree carry one)."""
|
||||
return bool(hike.get("season")) and hike.get("season_basis") in (
|
||||
"primary", "sources", "source") and not hike.get("season_method")
|
||||
|
||||
|
||||
def check_present(tid, rec, errors):
|
||||
"""Every record has a hike table (check_season then requires its season)."""
|
||||
if not isinstance(rec.get("hike"), dict):
|
||||
errors.append(f"{tid}: hike.season is required")
|
||||
|
||||
|
||||
def _naming(sources, fact):
|
||||
@@ -51,10 +83,26 @@ def check_season(tid, hike, errors):
|
||||
errors.append(f"{tid}: hike.season_method must not be empty")
|
||||
elif len(method) >= 400:
|
||||
errors.append(f"{tid}: hike.season_method must be under 400 characters")
|
||||
elif basis == "estimate" and not _CONFIDENCE_END.search(method):
|
||||
errors.append(
|
||||
f"{tid}: hike.season_method of an estimate must end with "
|
||||
"\"Confidence: high.\", \"Confidence: medium.\" or \"Confidence: low.\"")
|
||||
elif basis == "estimate":
|
||||
errors.append(f"{tid}: hike.season_method is required with season_basis \"estimate\"")
|
||||
|
||||
if basis == "estimate" and has_months and isinstance(hike.get("months"), list):
|
||||
try:
|
||||
if hike.get("season") != phrase_for(hike["months"]):
|
||||
errors.append(f"{tid}: the season phrase of an estimate must be built from its "
|
||||
f"months: {phrase_for(hike['months'])!r}")
|
||||
except (ValueError, TypeError):
|
||||
errors.append(f"{tid}: hike.months must be month numbers 1 to 12")
|
||||
|
||||
naming_season = _naming(sources, "season")
|
||||
if basis != "estimate" and any(_is_climate(x) for x in naming_season):
|
||||
errors.append(
|
||||
f"{tid}: a source naming season may not cite climate data unless "
|
||||
"hike.season_basis is \"estimate\"")
|
||||
if basis in ("primary", "source"):
|
||||
if not naming_season:
|
||||
errors.append(
|
||||
@@ -69,13 +117,137 @@ def check_season(tid, hike, errors):
|
||||
elif basis == "sources":
|
||||
publishers = {str(s.get("publisher", "")).strip().casefold()
|
||||
for s in naming_season if str(s.get("publisher", "")).strip()}
|
||||
if len(publishers) < 2:
|
||||
if not naming_season:
|
||||
errors.append(
|
||||
f"{tid}: hike.season_basis \"sources\" needs a [[hike.source]] naming season")
|
||||
elif has_method:
|
||||
pass # set by judgement from pages that differ; they may share a publisher
|
||||
elif len(publishers) < 2:
|
||||
errors.append(
|
||||
f"{tid}: hike.season_basis \"sources\" needs two sources from different "
|
||||
"publishers naming season")
|
||||
elif basis == "estimate":
|
||||
naming = {id(s) for s in _naming(sources, "season") + _naming(sources, "months")}
|
||||
naming = {id(x): x for x in _naming(sources, "season") + _naming(sources, "months")}
|
||||
if len(naming) != 1:
|
||||
errors.append(
|
||||
f"{tid}: hike.season_basis \"estimate\" needs exactly one source naming "
|
||||
"season or months")
|
||||
"season or months, and it must cite the climate data (no page states a season)")
|
||||
else:
|
||||
only = next(iter(naming.values()))
|
||||
facts = only.get("facts") or []
|
||||
if not _is_climate(only):
|
||||
errors.append(
|
||||
f"{tid}: hike.season_basis \"estimate\" needs its source to cite the "
|
||||
"climate data (CHELSA, with ETOPO); an ordinary page naming the season "
|
||||
"makes the basis wrong")
|
||||
if "season" not in facts or "months" not in facts:
|
||||
errors.append(
|
||||
f"{tid}: the climate source of an estimate must name both season and months")
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Shared helpers for the checker and the estimator. Months are a set on a
|
||||
# circle: a season may wrap the year end (November to March), so spans,
|
||||
# grades and phrases are all circular.
|
||||
|
||||
MONTH_NAMES = ("January", "February", "March", "April", "May", "June",
|
||||
"July", "August", "September", "October", "November", "December")
|
||||
|
||||
|
||||
def _months(months):
|
||||
got = sorted({int(m) for m in months})
|
||||
if not got or got[0] < 1 or got[-1] > 12:
|
||||
raise ValueError(f"not a set of months: {months!r}")
|
||||
return got
|
||||
|
||||
|
||||
def span(months):
|
||||
"""The smallest circular arc covering the months, as (first, last).
|
||||
|
||||
December to February is one arc, (12, 2). Two separate windows give the
|
||||
arc covering both. All twelve months give (1, 12).
|
||||
"""
|
||||
got = _months(months)
|
||||
if len(got) == 1:
|
||||
return (got[0], got[0])
|
||||
best_gap, first = -1, got[0]
|
||||
for i, month in enumerate(got):
|
||||
nxt = got[(i + 1) % len(got)]
|
||||
gap = (nxt - month) % 12
|
||||
if gap == 0:
|
||||
gap = 12
|
||||
# The arc starts after the largest gap. Ties go to the gap whose
|
||||
# following month is smallest, so all twelve months give (1, 12).
|
||||
if gap > best_gap or (gap == best_gap and nxt < first):
|
||||
best_gap, first = gap, nxt
|
||||
i = got.index(first)
|
||||
return (first, got[i - 1])
|
||||
|
||||
|
||||
def _circ_distance(a, b):
|
||||
d = abs(a - b)
|
||||
return min(d, 12 - d)
|
||||
|
||||
|
||||
def grade(estimated, sourced):
|
||||
"""How well an estimated season matches a sourced one.
|
||||
|
||||
"exact" when the arcs have the same first and last month, "within1"
|
||||
when each end is within one month (counted on the circle), else "worse".
|
||||
"""
|
||||
if not estimated or not sourced:
|
||||
return "worse"
|
||||
est_first, est_last = span(estimated)
|
||||
src_first, src_last = span(sourced)
|
||||
if (est_first, est_last) == (src_first, src_last):
|
||||
return "exact"
|
||||
if (_circ_distance(est_first, src_first) <= 1
|
||||
and _circ_distance(est_last, src_last) <= 1):
|
||||
return "within1"
|
||||
return "worse"
|
||||
|
||||
|
||||
def phrase_for(months):
|
||||
"""The plain season phrase built from months, for an estimate.
|
||||
|
||||
One run reads "June to September", a run over the year end reads
|
||||
"November to March", separate runs are joined with "and", one month
|
||||
reads "July" and twelve read "All year". Separate runs come in calendar
|
||||
order, so spring and fall read "March to May and October to November".
|
||||
"""
|
||||
got = _months(months)
|
||||
if len(got) == 12:
|
||||
return "All year"
|
||||
runs = []
|
||||
start = prev = got[0]
|
||||
for month in got[1:]:
|
||||
if month == prev + 1:
|
||||
prev = month
|
||||
else:
|
||||
runs.append((start, prev))
|
||||
start = prev = month
|
||||
runs.append((start, prev))
|
||||
if len(runs) > 1 and runs[0][0] == 1 and runs[-1][1] == 12:
|
||||
runs = [(runs[-1][0], runs[0][1])] + runs[1:-1]
|
||||
# calendar order, except that a run over the year end comes first
|
||||
runs.sort(key=lambda run: (run[0] <= run[1], run[0]))
|
||||
|
||||
def words(run):
|
||||
a, b = run
|
||||
if a == b:
|
||||
return MONTH_NAMES[a - 1]
|
||||
return f"{MONTH_NAMES[a - 1]} to {MONTH_NAMES[b - 1]}"
|
||||
|
||||
return " and ".join(words(run) for run in runs)
|
||||
|
||||
|
||||
def method_sentence(dataset, period, n_points, kind, rule_version):
|
||||
"""The one fixed sentence an estimated season carries as its method."""
|
||||
where = {
|
||||
"track": "along the track",
|
||||
"ends": "at the trail ends",
|
||||
"place": "at the place centre",
|
||||
}.get(kind, kind)
|
||||
noun = "point" if n_points == 1 else "points"
|
||||
return (f"Estimated from {dataset} monthly climate ({period}) at "
|
||||
f"{n_points} {noun} {where}; rule version {rule_version}.")
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"date": "2026-11-20",
|
||||
"measure": "within one month at each end of the season a page states",
|
||||
"tested": 148,
|
||||
"matched": 114,
|
||||
"share": 0.77,
|
||||
"by_confidence": {
|
||||
"high": {
|
||||
"tested": 52,
|
||||
"matched": 48,
|
||||
"share": 0.92
|
||||
},
|
||||
"medium": {
|
||||
"tested": 76,
|
||||
"matched": 55,
|
||||
"share": 0.72
|
||||
},
|
||||
"low": {
|
||||
"tested": 20,
|
||||
"matched": 11,
|
||||
"share": 0.55
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,455 @@
|
||||
"""Monthly climate normals for a point, read from bulk gridded files.
|
||||
|
||||
Python 3 standard library only. The estimator (tools/estimate_season.py)
|
||||
asks this module for the normals at a trail's sample points. The grids
|
||||
are large public files read in place: only the 512 pixel tiles that
|
||||
cover a point are fetched (HTTP range requests), each tile is cached
|
||||
outside the repository once, and the values for a point are cached as
|
||||
one small file. There is no rate limit to wait out; a tile is never
|
||||
fetched twice, and an interrupted run resumes from the cache.
|
||||
|
||||
Source chosen
|
||||
=============
|
||||
CHELSA V2.1 climatologies (monthly mean daily maximum near-surface air
|
||||
temperature, 1981-2010, about 1 km, global land), from WSL, with the
|
||||
elevation of the grid cell taken from NOAA's ETOPO 2022 relief model
|
||||
(60 arc second, unrestricted version). The temperature at a trail's own
|
||||
elevation is the cell's value plus a lapse rate of 6.5 C per km times
|
||||
the cell's elevation minus the trail's. The source carries no snow
|
||||
variable, so snow-free months are derived from the temperature at the
|
||||
trail's high ground (the rule's cold limit stands in for snow) and the
|
||||
estimate says so.
|
||||
|
||||
Why the first choice was dropped. The previous choice was ERA5-Land
|
||||
served by the Open-Meteo Historical Weather API. Its free tier
|
||||
allows 5000 weighted units an hour, and one point-year of daily data
|
||||
for two variables costs about 5 units, so a thirty year normal for the
|
||||
roughly 900 sample points needs about 139000 units (some 28 hours) and
|
||||
ten years about 9 hours; only three years fit in about three hours, and
|
||||
three years is too short to call a normal. Its terms also limit the
|
||||
free tier to non-commercial use. A bulk grid read locally has no such
|
||||
limit.
|
||||
|
||||
Why not the other bulk grids. WorldClim 2.1 (monthly 1970-2000, free
|
||||
download) states at https://www.worldclim.org/about.html: "The data are
|
||||
freely available for academic use and other non-commercial use.
|
||||
Redistribution or commercial use is not allowed without prior
|
||||
permission." That fails the public domain or open licence test. NOAA
|
||||
and Environment Canada station normals lack the coverage of both
|
||||
countries and a value at a trail's elevation (see the earlier trial in
|
||||
the repository history).
|
||||
|
||||
Licences, read on each publisher's own page (2026-11-20):
|
||||
|
||||
- CHELSA, https://www.chelsa-climate.org/datasets/chelsa_climatologies,
|
||||
field License: "Creative Commons Zero - No Rights Reserved (CC0 1.0)".
|
||||
The same page asks for the citation: Karger, D. N., Conrad, O.,
|
||||
Boehner, J., Kawohl, T., Kreft, H., Soria-Auza, R. W., Zimmermann,
|
||||
N. E., Linder, H. P., Kessler, M. (2017). Climatologies at high
|
||||
resolution for the earth's land surface areas. Scientific Data 4,
|
||||
170122. https://doi.org/10.1038/sdata.2017.122. It is credited in
|
||||
NOTICE.md although CC0 does not require it.
|
||||
- ETOPO 2022, https://www.ncei.noaa.gov/products/etopo-global-relief-model:
|
||||
the Unrestricted version is described as "Full global coverage, no
|
||||
copyright or security distribution restrictions". NOAA NCEI, DOI
|
||||
10.25921/fd45-gt74.
|
||||
|
||||
Reading the files. Both are tiled GeoTIFFs. CHELSA's tiles are LZW with a
|
||||
horizontal predictor, 16 bit unsigned, value times 0.1 in kelvin; ETOPO's
|
||||
are deflate with the floating point predictor. The small readers below
|
||||
handle exactly those two layouts and refuse anything else, so no library
|
||||
is needed in CI or in `web/`.
|
||||
"""
|
||||
import sys
|
||||
|
||||
sys.dont_write_bytecode = True
|
||||
|
||||
import array
|
||||
import hashlib
|
||||
import json
|
||||
import math
|
||||
import os
|
||||
import re
|
||||
import struct
|
||||
import tempfile
|
||||
import threading
|
||||
import time
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
import zlib
|
||||
from dataclasses import dataclass
|
||||
|
||||
CACHE_DIR = os.environ.get("LONGHIKES_CLIMATE_CACHE") or os.path.join(
|
||||
os.path.expanduser("~"), ".cache", "longhikes-climate")
|
||||
|
||||
SOURCE = {
|
||||
"name": "CHELSA V2.1 climatologies, with ETOPO 2022 elevation",
|
||||
"publisher": "WSL (CHELSA) and NOAA NCEI (ETOPO)",
|
||||
"url": "https://www.chelsa-climate.org/datasets/chelsa_climatologies",
|
||||
"licence": "CC0 1.0 (CHELSA); NOAA ETOPO 2022 unrestricted",
|
||||
"period": "1981-2010",
|
||||
}
|
||||
|
||||
CHELSA_URL = ("https://os.unil.cloud.switch.ch/chelsa02/chelsa/global/"
|
||||
"climatologies/tasmax/1981-2010/"
|
||||
"CHELSA_tasmax_{month:02d}_1981-2010_V.2.1.tif")
|
||||
ETOPO_URL = ("https://www.ngdc.noaa.gov/mgg/global/relief/ETOPO2022/data/"
|
||||
"60s/60s_surface_elev_gtif/"
|
||||
"ETOPO_2022_v1_60s_N90W180_surface.tif")
|
||||
|
||||
USER_AGENT = "Mozilla/5.0"
|
||||
LAPSE_C_PER_KM = 6.5
|
||||
HEADER_BYTES = 65536
|
||||
SEARCH_RADIUS = 3 # cells to look for land when the nearest cell is sea
|
||||
|
||||
_LOCK = threading.RLock()
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class PointNormals:
|
||||
"""Monthly normals at one point: twelve mean daily highs in degrees
|
||||
C and, when the source has one, twelve mean snow depths in cm."""
|
||||
|
||||
lat: float
|
||||
lon: float
|
||||
elev_m: float
|
||||
tmax_c: tuple
|
||||
snow_cm: tuple = None
|
||||
|
||||
|
||||
def haversine_km(lat1, lon1, lat2, lon2):
|
||||
radius = 6371.0088
|
||||
p1, p2 = math.radians(lat1), math.radians(lat2)
|
||||
dphi = math.radians(lat2 - lat1)
|
||||
dlmb = math.radians(lon2 - lon1)
|
||||
h = math.sin(dphi / 2) ** 2 + math.cos(p1) * math.cos(p2) * math.sin(dlmb / 2) ** 2
|
||||
return 2 * radius * math.asin(math.sqrt(h))
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Range reads, cached on disk.
|
||||
|
||||
def default_getter(url, start, end):
|
||||
req = urllib.request.Request(url, headers={
|
||||
"User-Agent": USER_AGENT, "Range": f"bytes={start}-{end}"})
|
||||
last = None
|
||||
for attempt in range(6):
|
||||
try:
|
||||
with urllib.request.urlopen(req, timeout=120) as resp:
|
||||
return resp.read()
|
||||
except (urllib.error.URLError, OSError) as exc:
|
||||
last = exc
|
||||
if isinstance(exc, urllib.error.HTTPError) and exc.code in (403, 404):
|
||||
raise
|
||||
time.sleep(2 * (attempt + 1))
|
||||
raise last
|
||||
|
||||
|
||||
class Source:
|
||||
"""One tiled GeoTIFF read by range requests."""
|
||||
|
||||
def __init__(self, url, cache=CACHE_DIR, getter=default_getter):
|
||||
self.url = url
|
||||
self.cache = os.path.join(cache, "tiles")
|
||||
self.getter = getter
|
||||
self._tiles = {}
|
||||
self._ready = False
|
||||
|
||||
# -- cached ranges
|
||||
def _range(self, start, end):
|
||||
key = hashlib.sha256(f"{self.url}|{start}|{end}".encode()).hexdigest()[:40]
|
||||
path = os.path.join(self.cache, key[:2], key + ".bin")
|
||||
if os.path.exists(path):
|
||||
with open(path, "rb") as f:
|
||||
return f.read()
|
||||
raw = self.getter(self.url, start, end)
|
||||
if len(raw) != end - start + 1 and start != 0:
|
||||
raise OSError(f"short read {len(raw)} of {end - start + 1} at {start}")
|
||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||
fd, tmp = tempfile.mkstemp(dir=os.path.dirname(path))
|
||||
with os.fdopen(fd, "wb") as f:
|
||||
f.write(raw)
|
||||
os.replace(tmp, path)
|
||||
return raw
|
||||
|
||||
# -- header
|
||||
def _load(self):
|
||||
with _LOCK:
|
||||
if self._ready:
|
||||
return
|
||||
head = self._range(0, HEADER_BYTES - 1)
|
||||
if head[:4] != b"II*\x00":
|
||||
raise ValueError("not a little-endian classic TIFF: " + self.url)
|
||||
off = struct.unpack("<I", head[4:8])[0]
|
||||
n = struct.unpack("<H", head[off:off + 2])[0]
|
||||
sizes = {1: 1, 2: 1, 3: 2, 4: 4, 5: 8, 12: 8}
|
||||
fmts = {1: "B", 3: "H", 4: "I", 12: "d"}
|
||||
tags = {}
|
||||
for i in range(n):
|
||||
e = head[off + 2 + i * 12: off + 14 + i * 12]
|
||||
tag, typ, cnt = struct.unpack("<HHI", e[:8])
|
||||
if typ not in sizes or typ == 5:
|
||||
continue
|
||||
size = sizes[typ] * cnt
|
||||
if size <= 4:
|
||||
data = e[8:8 + size]
|
||||
else:
|
||||
vo = struct.unpack("<I", e[8:12])[0]
|
||||
data = head[vo:vo + size] if vo + size <= len(head) else \
|
||||
self._range(vo, vo + size - 1)
|
||||
if typ == 2:
|
||||
tags[tag] = data.rstrip(b"\x00").decode("latin-1")
|
||||
else:
|
||||
tags[tag] = struct.unpack("<%d%s" % (cnt, fmts[typ]), data)
|
||||
self.width = tags[256][0]
|
||||
self.height = tags[257][0]
|
||||
self.bits = tags[258][0]
|
||||
self.compression = tags[259][0]
|
||||
self.predictor = tags.get(317, (1,))[0]
|
||||
self.sampleformat = tags.get(339, (1,))[0]
|
||||
self.tw = tags[322][0]
|
||||
self.th = tags[323][0]
|
||||
self.offsets = tags[324]
|
||||
self.counts = tags[325]
|
||||
self.xres, self.yres = tags[33550][0], tags[33550][1]
|
||||
self.x0, self.y0 = tags[33922][3], tags[33922][4]
|
||||
meta = tags.get(42112, "")
|
||||
m = re.search(r'name="SCALE"[^>]*>([^<]+)<', meta)
|
||||
self.scale = float(m.group(1)) if m else 1.0
|
||||
m = re.search(r'name="OFFSET"[^>]*>([^<]+)<', meta)
|
||||
self.offset = float(m.group(1)) if m else 0.0
|
||||
nd = tags.get(42113)
|
||||
self.nodata = float(nd) if nd not in (None, "") else None
|
||||
self.tiles_across = (self.width + self.tw - 1) // self.tw
|
||||
if self.compression not in (5, 8):
|
||||
raise ValueError("unsupported compression %d" % self.compression)
|
||||
self._ready = True
|
||||
|
||||
# -- tile decoding
|
||||
def _decode(self, idx):
|
||||
with _LOCK:
|
||||
got = self._tiles.get(idx)
|
||||
if got is not None:
|
||||
return got
|
||||
raw = self._range(self.offsets[idx], self.offsets[idx] + self.counts[idx] - 1)
|
||||
data = lzw_decode(raw) if self.compression == 5 else zlib.decompress(raw)
|
||||
tile = self._to_values(data)
|
||||
with _LOCK:
|
||||
if len(self._tiles) > 24:
|
||||
self._tiles.clear()
|
||||
self._tiles[idx] = tile
|
||||
return tile
|
||||
|
||||
def _to_values(self, data):
|
||||
w, h = self.tw, self.th
|
||||
if self.sampleformat == 3 and self.bits == 32 and self.predictor == 3:
|
||||
out = array.array("f")
|
||||
for r in range(h):
|
||||
row = bytearray(data[r * w * 4:(r + 1) * w * 4])
|
||||
acc = 0
|
||||
for i in range(len(row)):
|
||||
acc = (acc + row[i]) & 255
|
||||
row[i] = acc
|
||||
be = bytearray(w * 4)
|
||||
for k in range(4):
|
||||
be[k::4] = row[k * w:(k + 1) * w]
|
||||
out.extend(struct.unpack(">%df" % w, bytes(be)))
|
||||
return out
|
||||
if self.bits == 16 and self.sampleformat in (1, 2):
|
||||
code = "H" if self.sampleformat == 1 else "h"
|
||||
out = array.array(code)
|
||||
out.frombytes(data[: w * h * 2])
|
||||
if sys.byteorder != "little":
|
||||
out.byteswap()
|
||||
if self.predictor == 2:
|
||||
for r in range(h):
|
||||
acc = 0
|
||||
base = r * w
|
||||
for i in range(w):
|
||||
acc = (acc + out[base + i]) & 0xFFFF
|
||||
out[base + i] = acc
|
||||
elif self.predictor != 1:
|
||||
raise ValueError("unsupported predictor")
|
||||
return out
|
||||
raise ValueError("unsupported sample layout")
|
||||
|
||||
# -- pixels
|
||||
def pixel(self, col, row):
|
||||
"""Raw value at an integer cell, or None for outside or nodata."""
|
||||
self._load()
|
||||
if row < 0 or row >= self.height:
|
||||
return None
|
||||
col %= self.width
|
||||
idx = (row // self.th) * self.tiles_across + col // self.tw
|
||||
tile = self._decode(idx)
|
||||
v = tile[(row % self.th) * self.tw + (col % self.tw)]
|
||||
if self.nodata is not None and v == self.nodata:
|
||||
return None
|
||||
return v
|
||||
|
||||
def value_nearest(self, lon, lat):
|
||||
"""Scaled value of the nearest cell that has data, searching a
|
||||
few cells outward when the nearest is sea; None if none."""
|
||||
self._load()
|
||||
col = int(math.floor((lon - self.x0) / self.xres + 0.5))
|
||||
row = int(math.floor((self.y0 - lat) / self.yres + 0.5))
|
||||
for radius in range(SEARCH_RADIUS + 1):
|
||||
best = None
|
||||
for dr in range(-radius, radius + 1):
|
||||
for dc in range(-radius, radius + 1):
|
||||
if max(abs(dr), abs(dc)) != radius:
|
||||
continue
|
||||
v = self.pixel(col + dc, row + dr)
|
||||
if v is None:
|
||||
continue
|
||||
d = dr * dr + dc * dc
|
||||
if best is None or d < best[0]:
|
||||
best = (d, v)
|
||||
if best is not None:
|
||||
return best[1] * self.scale + self.offset
|
||||
return None
|
||||
|
||||
def value_bilinear(self, lon, lat):
|
||||
self._load()
|
||||
fx = (lon - self.x0) / self.xres
|
||||
fy = (self.y0 - lat) / self.yres
|
||||
c0, r0 = int(math.floor(fx)), int(math.floor(fy))
|
||||
tx, ty = fx - c0, fy - r0
|
||||
total = weight = 0.0
|
||||
for dr, wy in ((0, 1 - ty), (1, ty)):
|
||||
for dc, wx in ((0, 1 - tx), (1, tx)):
|
||||
v = self.pixel(c0 + dc, r0 + dr)
|
||||
if v is None:
|
||||
continue
|
||||
total += v * wx * wy
|
||||
weight += wx * wy
|
||||
if weight <= 0:
|
||||
return None
|
||||
return (total / weight) * self.scale + self.offset
|
||||
|
||||
|
||||
def lzw_decode(data):
|
||||
"""TIFF LZW (MSB first, early change)."""
|
||||
out = []
|
||||
base = [bytes([i]) for i in range(256)] + [b"", b""]
|
||||
table = list(base)
|
||||
bits = 9
|
||||
buf = nb = pos = 0
|
||||
n = len(data)
|
||||
prev = None
|
||||
while True:
|
||||
while nb < bits:
|
||||
if pos >= n:
|
||||
return b"".join(out)
|
||||
buf = (buf << 8) | data[pos]
|
||||
pos += 1
|
||||
nb += 8
|
||||
code = (buf >> (nb - bits)) & ((1 << bits) - 1)
|
||||
nb -= bits
|
||||
buf &= (1 << nb) - 1
|
||||
if code == 257:
|
||||
break
|
||||
if code == 256:
|
||||
table = list(base)
|
||||
bits = 9
|
||||
prev = None
|
||||
continue
|
||||
if prev is None:
|
||||
entry = table[code]
|
||||
elif code < len(table):
|
||||
entry = table[code]
|
||||
table.append(prev + entry[:1])
|
||||
else:
|
||||
entry = prev + prev[:1]
|
||||
table.append(entry)
|
||||
out.append(entry)
|
||||
prev = entry
|
||||
ln = len(table)
|
||||
bits = 12 if ln >= 2047 else 11 if ln >= 1023 else 10 if ln >= 511 else 9
|
||||
return b"".join(out)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Normals for a point.
|
||||
|
||||
_SOURCES = {}
|
||||
|
||||
|
||||
def _sources(cache, getter):
|
||||
key = (cache, id(getter))
|
||||
with _LOCK:
|
||||
if key not in _SOURCES:
|
||||
_SOURCES[key] = (
|
||||
[Source(CHELSA_URL.format(month=m), cache, getter) for m in range(1, 13)],
|
||||
Source(ETOPO_URL, cache, getter))
|
||||
return _SOURCES[key]
|
||||
|
||||
|
||||
def _cache_path(cache, lat, lon, elev_m):
|
||||
elev_key = "cell" if elev_m is None else str(int(round(elev_m)))
|
||||
return os.path.join(cache, "points", f"chelsa_{lat:.3f}_{lon:.3f}_{elev_key}.json")
|
||||
|
||||
|
||||
def _read_cache(path):
|
||||
"""(True, normals or None) when cached, else (False, None). A cached
|
||||
None means the source had no data for the point."""
|
||||
if not os.path.exists(path):
|
||||
return False, None
|
||||
with open(path, encoding="utf-8") as f:
|
||||
doc = json.load(f)
|
||||
if doc.get("no_data"):
|
||||
return True, None
|
||||
snow = doc.get("snow_cm")
|
||||
return True, PointNormals(
|
||||
lat=float(doc["lat"]), lon=float(doc["lon"]), elev_m=float(doc["elev_m"]),
|
||||
tmax_c=tuple(float(v) for v in doc["tmax_c"]),
|
||||
snow_cm=None if snow is None else tuple(float(v) for v in snow))
|
||||
|
||||
|
||||
def _write_cache(path, normals):
|
||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||
if normals is None:
|
||||
doc = {"no_data": True}
|
||||
else:
|
||||
doc = {"lat": normals.lat, "lon": normals.lon, "elev_m": normals.elev_m,
|
||||
"tmax_c": list(normals.tmax_c),
|
||||
"snow_cm": None if normals.snow_cm is None else list(normals.snow_cm)}
|
||||
fd, tmp = tempfile.mkstemp(dir=os.path.dirname(path))
|
||||
with os.fdopen(fd, "w", encoding="utf-8") as f:
|
||||
json.dump(doc, f, sort_keys=True)
|
||||
f.write("\n")
|
||||
os.replace(tmp, path)
|
||||
|
||||
|
||||
def fetch_normals(lat, lon, elev_m, cache=CACHE_DIR, opener=None, getter=None):
|
||||
"""Normals at the point, at elev_m (the grid cell's own elevation
|
||||
when None), or None when the grid has no land value there. Never
|
||||
returns invented zeros. `getter(url, start, end)` replaces the
|
||||
network for tests; `opener` is accepted and ignored."""
|
||||
lat, lon = round(float(lat), 3), round(float(lon), 3)
|
||||
path = _cache_path(cache, lat, lon, elev_m)
|
||||
found, normals = _read_cache(path)
|
||||
if found:
|
||||
return normals
|
||||
months, dem = _sources(cache, getter or default_getter)
|
||||
cell_elev = dem.value_bilinear(lon, lat)
|
||||
values = []
|
||||
for src in months:
|
||||
v = src.value_nearest(lon, lat)
|
||||
if v is None:
|
||||
values = None
|
||||
break
|
||||
values.append(v - 273.15)
|
||||
if values is None or cell_elev is None:
|
||||
normals = None
|
||||
else:
|
||||
use = cell_elev if elev_m is None else float(elev_m)
|
||||
shift = LAPSE_C_PER_KM * (cell_elev - use) / 1000.0
|
||||
normals = PointNormals(
|
||||
lat=lat, lon=lon, elev_m=use,
|
||||
tmax_c=tuple(round(v + shift, 1) for v in values), snow_cm=None)
|
||||
_write_cache(path, normals)
|
||||
return normals
|
||||
|
||||
|
||||
CANDIDATES = {"chelsa": fetch_normals}
|
||||
@@ -0,0 +1,142 @@
|
||||
{
|
||||
"bar": {
|
||||
"coverage_min": 0.9,
|
||||
"within1_min": 0.75
|
||||
},
|
||||
"computed": "2026-11-20",
|
||||
"confidence": {
|
||||
"close": 0.3,
|
||||
"decisive": 0.6,
|
||||
"high_matched": 0.868,
|
||||
"high_n": 38,
|
||||
"low_matched": 0.609
|
||||
},
|
||||
"dataset": "CHELSA V2.1 climatologies, with ETOPO 2022 elevation",
|
||||
"loo": {
|
||||
"by_group": {
|
||||
"Canada east and north": {
|
||||
"classified": 0.7685,
|
||||
"jaccard": 0.5546,
|
||||
"n": 9,
|
||||
"no_data": 0,
|
||||
"within1": 5,
|
||||
"worse": 4
|
||||
},
|
||||
"Canada west": {
|
||||
"classified": 0.8512,
|
||||
"jaccard": 0.6607,
|
||||
"n": 14,
|
||||
"no_data": 0,
|
||||
"within1": 12,
|
||||
"worse": 2
|
||||
},
|
||||
"Rockies": {
|
||||
"classified": 0.8913,
|
||||
"jaccard": 0.6832,
|
||||
"n": 23,
|
||||
"no_data": 0,
|
||||
"within1": 20,
|
||||
"worse": 3
|
||||
},
|
||||
"interior west": {
|
||||
"classified": 0.7153,
|
||||
"jaccard": 0.3855,
|
||||
"n": 12,
|
||||
"no_data": 0,
|
||||
"within1": 6,
|
||||
"worse": 6
|
||||
},
|
||||
"northeast": {
|
||||
"classified": 0.7556,
|
||||
"jaccard": 0.6198,
|
||||
"n": 15,
|
||||
"no_data": 0,
|
||||
"within1": 12,
|
||||
"worse": 3
|
||||
},
|
||||
"plains and midwest": {
|
||||
"classified": 0.6458,
|
||||
"jaccard": 0.4722,
|
||||
"n": 8,
|
||||
"no_data": 0,
|
||||
"within1": 3,
|
||||
"worse": 5
|
||||
},
|
||||
"southeast": {
|
||||
"classified": 0.6667,
|
||||
"jaccard": 0.4973,
|
||||
"n": 13,
|
||||
"no_data": 0,
|
||||
"within1": 8,
|
||||
"worse": 5
|
||||
},
|
||||
"southwest": {
|
||||
"classified": 0.6932,
|
||||
"jaccard": 0.4759,
|
||||
"n": 22,
|
||||
"no_data": 0,
|
||||
"within1": 11,
|
||||
"worse": 11
|
||||
},
|
||||
"west coast": {
|
||||
"classified": 0.7995,
|
||||
"jaccard": 0.5687,
|
||||
"n": 32,
|
||||
"no_data": 0,
|
||||
"within1": 23,
|
||||
"worse": 9
|
||||
}
|
||||
},
|
||||
"by_kind": {
|
||||
"alpine": {
|
||||
"classified": 0.8689,
|
||||
"jaccard": 0.6547,
|
||||
"n": 82,
|
||||
"no_data": 0,
|
||||
"within1": 67,
|
||||
"worse": 15
|
||||
},
|
||||
"cool-season": {
|
||||
"classified": 0.7292,
|
||||
"jaccard": 0.4613,
|
||||
"n": 40,
|
||||
"no_data": 0,
|
||||
"within1": 22,
|
||||
"worse": 18
|
||||
},
|
||||
"other": {
|
||||
"classified": 0.5926,
|
||||
"jaccard": 0.4345,
|
||||
"n": 18,
|
||||
"no_data": 0,
|
||||
"within1": 11,
|
||||
"worse": 7
|
||||
},
|
||||
"year-round": {
|
||||
"classified": 0.3542,
|
||||
"jaccard": 0.3542,
|
||||
"n": 8,
|
||||
"no_data": 0,
|
||||
"within1": 0,
|
||||
"worse": 8
|
||||
}
|
||||
},
|
||||
"classified": 0.7697,
|
||||
"jaccard": 0.5594,
|
||||
"n": 148,
|
||||
"no_data": 0,
|
||||
"within1": 100,
|
||||
"worse": 48
|
||||
},
|
||||
"params": {
|
||||
"cold_c_min": 12.0,
|
||||
"cut": 0.65,
|
||||
"heat_c_max": 25.0,
|
||||
"k": 20,
|
||||
"mix": 0.7,
|
||||
"power": 1
|
||||
},
|
||||
"passes": false,
|
||||
"period": "1981-2010",
|
||||
"rule_version": 2
|
||||
}
|
||||
@@ -0,0 +1,621 @@
|
||||
{
|
||||
"across-utah-route": {
|
||||
"digest": "1582bd31f8f00ced",
|
||||
"machine": [
|
||||
5,
|
||||
6,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"alpine-trail-7": {
|
||||
"digest": "efd5e277fbf3b6c1",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"avon": {
|
||||
"digest": "a9120a59a9a1907d",
|
||||
"machine": [
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
8,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"batona": {
|
||||
"digest": "3dbdb3e8b17d2b98",
|
||||
"machine": [
|
||||
4,
|
||||
5,
|
||||
9,
|
||||
10,
|
||||
11
|
||||
]
|
||||
},
|
||||
"bay-circuit": {
|
||||
"digest": "bdb128943b1900ae",
|
||||
"machine": [
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
8,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"bayou-state-trail": {
|
||||
"digest": "c7c4147060628fa7",
|
||||
"machine": [
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
11,
|
||||
12
|
||||
]
|
||||
},
|
||||
"boundary-trail-mount-st-helens": {
|
||||
"digest": "01312d045fd17c20",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"boundary-trail-pasayten": {
|
||||
"digest": "e97c07b0f68a15a9",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"bristol-hills-trail": {
|
||||
"digest": "a5fa7af7ebab8d67",
|
||||
"machine": [
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"brooks-range-traverse": {
|
||||
"digest": "8a3c5ef0f30bc7f8",
|
||||
"machine": [
|
||||
8
|
||||
]
|
||||
},
|
||||
"bruce-trail": {
|
||||
"digest": "ed62c99709c54267",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"california-coastal": {
|
||||
"digest": "5c7fa4913f78b36c",
|
||||
"machine": [
|
||||
5,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"conestoga-trail": {
|
||||
"digest": "31f1d48bf322e3a7",
|
||||
"machine": [
|
||||
4,
|
||||
5,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"conservation-trail": {
|
||||
"digest": "21bfcf5403bcbfdf",
|
||||
"machine": [
|
||||
5,
|
||||
6,
|
||||
8,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"cranberry-lake-50": {
|
||||
"digest": "87772fc46ebb73ca",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"cross-vermont": {
|
||||
"digest": "de8f9f0acea8bd21",
|
||||
"machine": [
|
||||
5,
|
||||
6,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"deseret-hiking-route": {
|
||||
"digest": "191f5e4f5cc698cb",
|
||||
"machine": [
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
10,
|
||||
11
|
||||
]
|
||||
},
|
||||
"desert-trail": {
|
||||
"digest": "132108d83a002b0d",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"donut-hole": {
|
||||
"digest": "dcc41463939e95a7",
|
||||
"machine": [
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"eastern-continental-trail": {
|
||||
"digest": "d40390952a719154",
|
||||
"machine": [
|
||||
5,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"eastern-sierra-high-route": {
|
||||
"digest": "34c0558ddeedd3f2",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"ganaraska": {
|
||||
"digest": "b414a50c65a31b82",
|
||||
"machine": [
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"general-george-crook": {
|
||||
"digest": "f2896d5fe13e417f",
|
||||
"machine": [
|
||||
4,
|
||||
5,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"georgia-loop": {
|
||||
"digest": "35f1d5133569d0c0",
|
||||
"machine": [
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
10,
|
||||
11,
|
||||
12
|
||||
]
|
||||
},
|
||||
"gila-centennial-loop": {
|
||||
"digest": "08f4ed745b5d2560",
|
||||
"machine": [
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
9,
|
||||
10,
|
||||
11
|
||||
]
|
||||
},
|
||||
"grand-valley-trail": {
|
||||
"digest": "5f4505a160f8f245",
|
||||
"machine": [
|
||||
5,
|
||||
6,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"great-eastern": {
|
||||
"digest": "b77ec5d870bbcc88",
|
||||
"machine": [
|
||||
4,
|
||||
5,
|
||||
10
|
||||
]
|
||||
},
|
||||
"great-western-divide-loop": {
|
||||
"digest": "dd7b6f503f72081b",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"high-country-pathway": {
|
||||
"digest": "b59fdbbf3b1ac6f8",
|
||||
"machine": [
|
||||
5,
|
||||
6,
|
||||
8,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"highlands": {
|
||||
"digest": "8212eeadd24218c3",
|
||||
"machine": [
|
||||
4,
|
||||
5,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"hoosier-heritage-trail": {
|
||||
"digest": "f550667eab910362",
|
||||
"machine": [
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
10,
|
||||
11
|
||||
]
|
||||
},
|
||||
"horse-shoe": {
|
||||
"digest": "aeff26cf6c7e0143",
|
||||
"machine": [
|
||||
4,
|
||||
5,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"hot-springs-trail": {
|
||||
"digest": "fc73ad4cf711d615",
|
||||
"machine": [
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
10,
|
||||
11
|
||||
]
|
||||
},
|
||||
"iat-newfoundland-labrador": {
|
||||
"digest": "91eadce2b4ef4c7f",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"international-appalachian-trail-maine": {
|
||||
"digest": "8f488d4dc2b03636",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"koroc-palmer-loop": {
|
||||
"digest": "e18e82c08b6dfd5d",
|
||||
"machine": [
|
||||
8
|
||||
]
|
||||
},
|
||||
"la-cloche": {
|
||||
"digest": "61ce29ac5892d1b8",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"lost-coast": {
|
||||
"digest": "971c47b8714b706f",
|
||||
"machine": [
|
||||
5,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"loyalsock": {
|
||||
"digest": "7e8067a31ec5da6c",
|
||||
"machine": [
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"mason-dixon": {
|
||||
"digest": "54cad0c500a1e861",
|
||||
"machine": [
|
||||
4,
|
||||
5,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"midland-to-mackinac-trail": {
|
||||
"digest": "c5ed1765cac4534f",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"midstate-ma": {
|
||||
"digest": "edc133c6ae5007c7",
|
||||
"machine": [
|
||||
5,
|
||||
6,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"north-south": {
|
||||
"digest": "86641545fa67fd0c",
|
||||
"machine": [
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"north-south-lbl": {
|
||||
"digest": "25b3d5d788753ae6",
|
||||
"machine": [
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
10,
|
||||
11
|
||||
]
|
||||
},
|
||||
"north-umpqua": {
|
||||
"digest": "14231792880f7042",
|
||||
"machine": [
|
||||
5,
|
||||
10
|
||||
]
|
||||
},
|
||||
"oak-ridges": {
|
||||
"digest": "0646d355131c000c",
|
||||
"machine": [
|
||||
5,
|
||||
6,
|
||||
8,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"ottawa-temiskaming-highland-trail": {
|
||||
"digest": "77fbbe8137415f41",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"paumanok-path": {
|
||||
"digest": "588eea3017f04c4c",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"pfiffner-traverse": {
|
||||
"digest": "61965112f0b75445",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"rideau-trail": {
|
||||
"digest": "55d2219b607959d1",
|
||||
"machine": [
|
||||
5,
|
||||
6,
|
||||
8,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"ring-the-peak": {
|
||||
"digest": "858d219cc4ecd8f6",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"sawtooth-wilderness-high-route": {
|
||||
"digest": "0f4f2e2bf5e9bc6e",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"sea-to-sea-route": {
|
||||
"digest": "eb6dbcb347f7a83d",
|
||||
"machine": [
|
||||
6,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"shawangunk-ridge-trail": {
|
||||
"digest": "d3b38e00538fd900",
|
||||
"machine": [
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"shenipsit-trail": {
|
||||
"digest": "a713c4e4a679b6fa",
|
||||
"machine": [
|
||||
4,
|
||||
5,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"siskiyou-peaks-trail": {
|
||||
"digest": "2b4dff26c8e71b80",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"sky-islands-traverse": {
|
||||
"digest": "eed4f15ecdf6114d",
|
||||
"machine": [
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
9,
|
||||
10,
|
||||
11
|
||||
]
|
||||
},
|
||||
"solitude-loop": {
|
||||
"digest": "c091a7bb7336deb5",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"standing-stone": {
|
||||
"digest": "cdc4f7ed39a2c205",
|
||||
"machine": [
|
||||
4,
|
||||
5,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"stein-valley-traverse": {
|
||||
"digest": "59cd7e9a35c5c732",
|
||||
"machine": [
|
||||
6,
|
||||
9
|
||||
]
|
||||
},
|
||||
"sunapee-ragged-kearsarge": {
|
||||
"digest": "f5d7131d547be861",
|
||||
"machine": [
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"tahoe-yosemite-trail": {
|
||||
"digest": "23aa94cfbefd3f86",
|
||||
"machine": [
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"tuscarora": {
|
||||
"digest": "606d9fe137a8347d",
|
||||
"machine": [
|
||||
4,
|
||||
5,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"vagabond-loop": {
|
||||
"digest": "33378ec42f73f8d5",
|
||||
"machine": [
|
||||
4,
|
||||
10
|
||||
]
|
||||
},
|
||||
"warrior-trail": {
|
||||
"digest": "cecd19f5c7ba6ae4",
|
||||
"machine": [
|
||||
4,
|
||||
5,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"wasatch-traverse": {
|
||||
"digest": "1582bd31f8f00ced",
|
||||
"machine": [
|
||||
5,
|
||||
6,
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"waskahegan": {
|
||||
"digest": "d7993fbe810051fd",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"western-uplands": {
|
||||
"digest": "464d6cd6bfe3257c",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9
|
||||
]
|
||||
},
|
||||
"yosemite-high-route": {
|
||||
"digest": "eee24b0c39473ab0",
|
||||
"machine": [
|
||||
7,
|
||||
8,
|
||||
9
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,626 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Packets, blind scoring and proposals for seasons set by judgement.
|
||||
|
||||
Python 3 standard library only. Where no page states a season, a reviewer
|
||||
sets it from a packet: the trail's location, elevation, monthly climate
|
||||
normals (tools/season_climate.py), the machine estimate of
|
||||
tools/estimate_season.py and the most similar sourced trails. The method
|
||||
was tested blind: the same reviewers estimated the trails whose season a
|
||||
page states, from identical packets with the season hidden, and the share
|
||||
they matched is in tools/season_blind_test.json, which the site reads.
|
||||
docs/season-judging.md says how a reviewer works.
|
||||
|
||||
Commands:
|
||||
packets write one packet per trail, and the three part lists
|
||||
score score reviewers' answer files against the sourced seasons
|
||||
(--write records the figures in tools/season_blind_test.json)
|
||||
proposals stage the judged seasons for the trails with no season, for
|
||||
python3 tools/refresh.py collect and apply
|
||||
inputs record the machine estimate and the inputs of every estimate,
|
||||
so the monthly check can see when they change
|
||||
|
||||
An answer file is tab separated, one trail a line, no header: id, months
|
||||
(comma separated, 1 to 12), season phrase, confidence (high, medium or
|
||||
low) and one sentence saying what sets the season there.
|
||||
"""
|
||||
import sys
|
||||
|
||||
sys.dont_write_bytecode = True
|
||||
|
||||
import argparse
|
||||
import datetime
|
||||
import json
|
||||
import os
|
||||
import random
|
||||
import re
|
||||
import statistics
|
||||
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.insert(0, HERE)
|
||||
|
||||
import estimate_season as E # noqa: E402
|
||||
import refresh # noqa: E402
|
||||
import season # noqa: E402
|
||||
import season_climate as C # noqa: E402
|
||||
import season_model as M # noqa: E402
|
||||
|
||||
ROOT = os.path.dirname(HERE)
|
||||
BLIND_TEST = os.path.join(ROOT, "tools", "season_blind_test.json")
|
||||
JUDGED = os.path.join(ROOT, "tools", "season_judged.tsv")
|
||||
PAGES = os.path.join(ROOT, "tools", "season_judged_pages.json")
|
||||
INPUTS = os.path.join(ROOT, "tools", "season_inputs.json")
|
||||
|
||||
SEED = 20261120
|
||||
PARTS = 3
|
||||
NCOMP = 10
|
||||
PLACE_WEIGHT = 0.1 # climate-distance units per 1000 km between sample-point centres
|
||||
KM_PER_MILE = 1.609344
|
||||
CONFIDENCES = ("high", "medium", "low")
|
||||
LEAD = "Judged from the climate at the trail's elevation and from similar trails."
|
||||
MONTHS = ["January", "February", "March", "April", "May", "June", "July",
|
||||
"August", "September", "October", "November", "December"]
|
||||
ABB = [m[:3] for m in MONTHS]
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Hiding the season: a packet never carries a sentence that bears on timing.
|
||||
|
||||
_MONTH_RE = re.compile(
|
||||
r"\b(?:January|February|March|April|May|June|July|August|September|October|November|"
|
||||
r"December|Jan|Feb|Mar|Apr|Jun|Jul|Aug|Sept?|Oct|Nov|Dec)\b(?!\s+[A-Z])\.?")
|
||||
_SEASON_RE = re.compile(
|
||||
r"\b(?:summer|winter|spring|fall|autumn|seasons?|seasonal|year[- ]?round|all[- ]year|"
|
||||
r"snow[- ]?free|snowmelt|snow[- ]melt|snowpack|monsoons?|best time|time of year|when to go|"
|
||||
r"(?:warm|warmer|cold|colder|cool|cooler|hot|wet|dry|snowy|shoulder) months?)\b", re.I)
|
||||
_LEAD_SEASON_RE = re.compile(r"^(?:Summer|Winter|Spring|Fall|Autumn|Seasons?|Seasonal)\b")
|
||||
_SPLIT = re.compile(r"(?<=[.!?])\s+(?=[A-Z0-9\"'(])")
|
||||
|
||||
|
||||
def mentions_season(sentence):
|
||||
"""True when a sentence names a month or a season. A capitalised month
|
||||
counts unless it starts a name ("May Lake"); a season word counts in
|
||||
lower case or opening the sentence, so "Summer Lake" does not."""
|
||||
sentence = re.sub(r"\bhot springs?\b", "", sentence, flags=re.I)
|
||||
if _MONTH_RE.search(sentence):
|
||||
return True
|
||||
for found in _SEASON_RE.finditer(sentence):
|
||||
word = found.group(0)
|
||||
if word[0].islower() or word.lower().startswith(("year", "all", "snow")):
|
||||
return True
|
||||
return bool(_LEAD_SEASON_RE.match(sentence))
|
||||
|
||||
|
||||
def clean(text):
|
||||
"""(text without the sentences that bear on timing, those sentences)."""
|
||||
kept, removed = [], []
|
||||
for sentence in _SPLIT.split(str(text or "").strip()):
|
||||
if not sentence:
|
||||
continue
|
||||
(removed if mentions_season(sentence) else kept).append(sentence)
|
||||
return " ".join(kept), removed
|
||||
|
||||
|
||||
def shown(kept, original):
|
||||
if not original:
|
||||
return "(not on file)"
|
||||
return kept or "(none left after removing sentences that mention a season)"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# The blind protocol: trails are split into parts, and a trail's comparable
|
||||
# trails never come from its own part.
|
||||
|
||||
def split_parts(sourced, others, n=PARTS, seed=SEED):
|
||||
"""Deal the sourced and the other trails separately into n parts, in a
|
||||
seeded shuffle, so every part holds a share of each."""
|
||||
rng = random.Random(seed)
|
||||
parts = [[] for _ in range(n)]
|
||||
for group in (sourced, others):
|
||||
group = list(group)
|
||||
rng.shuffle(group)
|
||||
for k, tid in enumerate(group):
|
||||
parts[k % n].append(tid)
|
||||
return [sorted(p) for p in parts]
|
||||
|
||||
|
||||
def comparables(tid, part_of, sourced_ids, meds, centres, k=NCOMP, place_weight=PLACE_WEIGHT):
|
||||
"""The k sourced trails closest to tid in climate and place, never itself
|
||||
and never one dealt to its own part."""
|
||||
if tid not in meds:
|
||||
return []
|
||||
rows = []
|
||||
for other in sourced_ids:
|
||||
if other == tid or part_of.get(other) == part_of.get(tid) or other not in meds:
|
||||
continue
|
||||
d = M.distance(meds[tid], meds[other])
|
||||
km = C.haversine_km(*centres[tid], *centres[other])
|
||||
rows.append((d + place_weight * km / 1000.0, other))
|
||||
rows.sort()
|
||||
return [other for _score, other in rows[:k]]
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# The packet.
|
||||
|
||||
def _ft(metres):
|
||||
return int(round(metres * 3.28084))
|
||||
|
||||
|
||||
def _f(celsius):
|
||||
return celsius * 9 / 5 + 32
|
||||
|
||||
|
||||
def _ll(lat, lon):
|
||||
return (f"{abs(lat):.1f}{'N' if lat >= 0 else 'S'}",
|
||||
f"{abs(lon):.1f}{'W' if lon <= 0 else 'E'}")
|
||||
|
||||
|
||||
def packet_text(rec, info, machine, comparables, pages=None, precip=None):
|
||||
"""The packet for one trail, as text.
|
||||
|
||||
info: {"points": [PointNormals or None], "kind": "track"|"ends"|"place",
|
||||
"profile": (highest_m, lowest_m) or None}. machine: the machine
|
||||
estimate's months. comparables: rows of (name, regions, high ground
|
||||
feet, season phrase, months). pages: what disagreeing pages say, or
|
||||
None. precip: millimetres a month at each point, or None. The trail's
|
||||
own season is never used."""
|
||||
hike = rec.get("hike") or {}
|
||||
tid = rec["id"]
|
||||
out = [f"# Trail packet: {tid}", "", "## The trail", ""]
|
||||
out += [f"- id: {tid}", f"- name: {rec['name']}",
|
||||
f"- common name: {rec.get('common_name') or '(none on file)'}",
|
||||
f"- country: {rec['country']}",
|
||||
f"- states or provinces: {', '.join(rec.get('regions') or []) or '(none on file)'}",
|
||||
f"- length: {rec['length_km'] / KM_PER_MILE:.0f} miles",
|
||||
f"- kind: {rec.get('kind') or '(not on file)'}",
|
||||
f"- shape: {hike.get('shape') or '(not on file)'}",
|
||||
f"- terrain: {', '.join(hike.get('terrain') or []) or '(not on file)'}",
|
||||
f"- travel: {hike.get('travel') or '(not on file)'}"]
|
||||
hp, name = hike.get("high_point_m"), hike.get("high_point")
|
||||
out.append("- high point: " + (f"{_ft(hp)} ft" + (f" ({name})" if name else "")
|
||||
if hp is not None else "(not on file)"))
|
||||
days = hike.get("days")
|
||||
out.append("- typical days: " + (f"{days[0]} to {days[1]}" if days and len(days) == 2
|
||||
and days[0] != days[1] else (str(days[0]) if days else "(not on file)")))
|
||||
out += ["", "## Summary, start and end", "",
|
||||
"(Sentences that bear on timing have been removed.)", ""]
|
||||
for label, key in (("Summary", "summary"), ("Start", "start"), ("End", "end")):
|
||||
kept, _removed = clean(hike.get(key))
|
||||
out.append(f"{label}: {shown(kept, hike.get(key))}")
|
||||
points = M.usable(info["points"])
|
||||
out += ["", "## Where it is", ""]
|
||||
if points:
|
||||
lats, lons = [p.lat for p in points], [p.lon for p in points]
|
||||
south, _ = _ll(min(lats), 0)
|
||||
north, _ = _ll(max(lats), 0)
|
||||
_, west = _ll(0, min(lons))
|
||||
_, east = _ll(0, max(lons))
|
||||
out += [f"- sample points: {len(points)}",
|
||||
f"- southernmost: {south}; northernmost: {north}",
|
||||
f"- westernmost: {west}; easternmost: {east}",
|
||||
f"- rough extent: {south} to {north}, {west} to {east}" if len(points) > 1
|
||||
else f"- rough extent: a single point at {south}, {west}"]
|
||||
out.append("- location is: " + {
|
||||
"track": "a real track (points spaced along it)",
|
||||
"ends": "start and end points only (no track)",
|
||||
"place": "a region-centre fallback (no track and no end points; the centre of "
|
||||
"the first region's box)"}[info["kind"]])
|
||||
out += ["", "## Elevation", ""]
|
||||
if points:
|
||||
high, low = M.high_low(points)
|
||||
out.append(f"- high ground (the upper quarter of the sample points): "
|
||||
f"{_ft(statistics.median(p.elev_m for p in high))} ft")
|
||||
out.append(f"- low ground (the lower half of the sample points): "
|
||||
f"{_ft(statistics.median(p.elev_m for p in low))} ft")
|
||||
prof = info.get("profile")
|
||||
out.append("- track's highest and lowest points: " + (
|
||||
f"{_ft(prof[0])} ft and {_ft(prof[1])} ft" if prof else "(no track elevation on file)"))
|
||||
out += ["", "## Climate normals (1981 to 2010)", ""]
|
||||
if points:
|
||||
pr_of = {}
|
||||
if precip and len(precip) == len(points) and all(precip):
|
||||
pr_of = {id(p): pr for p, pr in zip(points, precip)}
|
||||
|
||||
def by_month(group, get):
|
||||
return [statistics.median(get(p)[m] for p in group) for m in range(12)]
|
||||
hh = by_month(high, lambda p: p.tmax_c)
|
||||
ll = by_month(low, lambda p: p.tmax_c)
|
||||
out.append("Mean daily high in degrees F, " + ("and monthly precipitation in inches, "
|
||||
if pr_of else "")
|
||||
+ "at the high ground and at the low ground.")
|
||||
out.append("")
|
||||
if pr_of:
|
||||
ph = by_month(high, lambda p: pr_of[id(p)])
|
||||
pl = by_month(low, lambda p: pr_of[id(p)])
|
||||
out += ["| month | high ground F | low ground F | high ground precip in | low ground precip in |",
|
||||
"|---|---|---|---|---|"]
|
||||
out += [f"| {ABB[m]} | {_f(hh[m]):.0f} | {_f(ll[m]):.0f} | {ph[m] / 25.4:.1f} | {pl[m] / 25.4:.1f} |"
|
||||
for m in range(12)]
|
||||
else:
|
||||
out += ["| month | high ground F | low ground F |", "|---|---|---|"]
|
||||
out += [f"| {ABB[m]} | {_f(hh[m]):.0f} | {_f(ll[m]):.0f} |" for m in range(12)]
|
||||
out += ["", "(Precipitation is not available for this trail.)"]
|
||||
else:
|
||||
out.append("No climate data is available for this trail's location.")
|
||||
out += ["", "## Machine estimate", "",
|
||||
"Labelled: machine estimate, right about two times in three.", "",
|
||||
"Months: " + (", ".join(map(str, machine)) + " (" + ", ".join(MONTHS[m - 1] for m in machine) + ")"
|
||||
if machine else "none"),
|
||||
"", "## Comparable trails", "",
|
||||
"The ten trails with a season on record that are most similar in climate and "
|
||||
"nearest in place (this trail is never listed).", ""]
|
||||
if comparables:
|
||||
out += ["| trail | state | high ground elevation | season | months |", "|---|---|---|---|---|"]
|
||||
out += [f"| {n} | {', '.join(regions)} | {feet} ft | {phrase} | {', '.join(map(str, months))} |"
|
||||
for n, regions, feet, phrase, months in comparables]
|
||||
else:
|
||||
out.append("(none)")
|
||||
if pages:
|
||||
out += ["", "## What pages say", "", "Published pages disagree about this trail's season.", "", pages]
|
||||
return "\n".join(out) + "\n"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Answers and the blind score.
|
||||
|
||||
def read_answers(path, known):
|
||||
"""({id: (months, phrase, confidence, why)}, [(line number, problem)])."""
|
||||
answers, problems, known = {}, [], set(known)
|
||||
with open(path, encoding="utf-8") as f:
|
||||
for n, raw in enumerate(f, 1):
|
||||
line = raw.rstrip("\n")
|
||||
if not line.strip() or line.startswith("#") or line.lower().startswith("id\t"):
|
||||
continue
|
||||
c = line.split("\t")
|
||||
if len(c) < 4:
|
||||
problems.append((n, f"expected at least 4 tab-separated columns, got {len(c)}"))
|
||||
continue
|
||||
tid, text, phrase, conf = c[0].strip(), c[1].strip(), c[2].strip(), c[3].strip().lower()
|
||||
why = c[4].strip() if len(c) > 4 else ""
|
||||
if tid not in known:
|
||||
problems.append((n, f"unknown id {tid!r}"))
|
||||
elif tid in answers:
|
||||
problems.append((n, f"duplicate id {tid}"))
|
||||
elif conf not in CONFIDENCES:
|
||||
problems.append((n, f"{tid}: confidence must be high, medium or low: {conf!r}"))
|
||||
else:
|
||||
try:
|
||||
months = sorted({int(x) for x in re.split(r"[,\s]+", text) if x})
|
||||
except ValueError:
|
||||
problems.append((n, f"{tid}: months are not numbers: {text!r}"))
|
||||
continue
|
||||
if not months or months[0] < 1 or months[-1] > 12:
|
||||
problems.append((n, f"{tid}: months empty or outside 1 to 12: {text!r}"))
|
||||
continue
|
||||
answers[tid] = (months, phrase, conf, why)
|
||||
return answers, problems
|
||||
|
||||
|
||||
def score(answers, truth):
|
||||
"""The blind result: for every trail whose season a page states (truth,
|
||||
{id: months}) whether the reviewer's months match within a month at each
|
||||
end, in all and by the reviewer's confidence. A trail with no answer is
|
||||
tested and counts as missed; an answer for a trail not in truth is not
|
||||
scored."""
|
||||
by = {c: {"tested": 0, "matched": 0} for c in CONFIDENCES}
|
||||
tested = matched = unanswered = 0
|
||||
for tid, months in sorted(truth.items()):
|
||||
tested += 1
|
||||
if tid not in answers:
|
||||
unanswered += 1
|
||||
continue
|
||||
got, _phrase, conf, _why = answers[tid]
|
||||
hit = bool(M.score(got, months)[0])
|
||||
matched += hit
|
||||
by[conf]["tested"] += 1
|
||||
by[conf]["matched"] += hit
|
||||
return {"tested": tested, "matched": matched, "unanswered": unanswered, "by_confidence": by}
|
||||
|
||||
|
||||
def _share(matched, tested):
|
||||
return round(matched / tested, 2) if tested else 0.0
|
||||
|
||||
|
||||
def write_blind_test(path, figures, date):
|
||||
doc = {
|
||||
"date": date,
|
||||
"measure": "within one month at each end of the season a page states",
|
||||
"tested": figures["tested"],
|
||||
"matched": figures["matched"],
|
||||
"share": _share(figures["matched"], figures["tested"]),
|
||||
"by_confidence": {
|
||||
c: {"tested": v["tested"], "matched": v["matched"],
|
||||
"share": _share(v["matched"], v["tested"])}
|
||||
for c, v in figures["by_confidence"].items()},
|
||||
}
|
||||
with open(path, "w", encoding="utf-8") as f:
|
||||
json.dump(doc, f, indent=1, sort_keys=False)
|
||||
f.write("\n")
|
||||
|
||||
|
||||
def load_blind_test(path=BLIND_TEST):
|
||||
with open(path, encoding="utf-8") as f:
|
||||
return json.load(f)
|
||||
|
||||
|
||||
def check_blind_test(doc):
|
||||
"""Problems with the figure file: the parts must add up to the whole and
|
||||
each share must be the matched count over the tested count."""
|
||||
problems = []
|
||||
by = doc.get("by_confidence") or {}
|
||||
if sorted(by) != sorted(CONFIDENCES):
|
||||
problems.append("by_confidence must hold high, medium and low")
|
||||
return problems
|
||||
if sum(v["tested"] for v in by.values()) != doc["tested"]:
|
||||
problems.append("the confidence groups do not add up to the trails tested")
|
||||
if sum(v["matched"] for v in by.values()) != doc["matched"]:
|
||||
problems.append("the confidence groups do not add up to the trails matched")
|
||||
for name, v in [("all", doc)] + list(by.items()):
|
||||
if v["matched"] > v["tested"]:
|
||||
problems.append(f"{name}: more matched than tested")
|
||||
elif v["share"] != _share(v["matched"], v["tested"]):
|
||||
problems.append(f"{name}: the share is not matched over tested")
|
||||
return problems
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Writing the judged seasons: proposals for refresh.py collect and apply.
|
||||
|
||||
def method_text(why, confidence, lead=LEAD):
|
||||
"""The season_method an estimate carries: how it was set, what sets the
|
||||
season there, and the confidence."""
|
||||
return f"{lead} {why.strip()} Confidence: {confidence}."
|
||||
|
||||
|
||||
def proposals(root, answers_path, pages_path, given_dir=None):
|
||||
"""Stage one proposal for every trail with no season that has an answer.
|
||||
A trail named in the pages file was set by judgement from pages that
|
||||
differ: its season is `sources`, citing those pages, with the sentences
|
||||
the file gives as its method. Every other is an `estimate` citing the
|
||||
climate data. Returns how many were staged."""
|
||||
ids = refresh.trail_ids(root)
|
||||
answers, problems = read_answers(answers_path, ids)
|
||||
if problems:
|
||||
raise ValueError("; ".join(f"line {n}: {t}" for n, t in problems))
|
||||
pages = {}
|
||||
if pages_path and os.path.exists(pages_path):
|
||||
with open(pages_path, encoding="utf-8") as f:
|
||||
pages = json.load(f)
|
||||
staging = refresh.staging_dir(root, given_dir, create=True)
|
||||
out = os.path.join(staging, "staged", "season-judged")
|
||||
today = datetime.date.today().isoformat()
|
||||
source = C.SOURCE
|
||||
report = []
|
||||
for tid in ids:
|
||||
rec = refresh.load_toml(os.path.join(root, tid, "trail.toml"))
|
||||
hike = rec.get("hike") or {}
|
||||
if hike.get("season") or tid not in answers:
|
||||
continue
|
||||
months, _phrase, conf, why = answers[tid]
|
||||
phrase = season.phrase_for(months)
|
||||
judged_pages = pages.get(tid)
|
||||
if judged_pages:
|
||||
basis = "sources"
|
||||
method = f"{judged_pages['why'].strip()} Confidence: {conf}."
|
||||
cites = [(s["url"], s["publisher"], s["quote"]) for s in judged_pages["sources"]]
|
||||
note = "the pages differ; set by judgement"
|
||||
else:
|
||||
basis = "estimate"
|
||||
method = method_text(why, conf)
|
||||
quote = (f"Monthly climate ({source['period']}) from {source['name']} "
|
||||
f"at the trail elevation, read with the seasons of similar trails.")
|
||||
cites = [(source["url"], source["publisher"], quote)]
|
||||
note = "estimated from climate"
|
||||
page, _publisher, quote = cites[0]
|
||||
lines = ["[[proposal]]", 'kind = "change"', f"id = {E._toml_str(tid)}",
|
||||
f"date = {E._toml_str(today)}",
|
||||
f"summary = {E._toml_str('Add a season, ' + note + ': ' + phrase + '.')}", ""]
|
||||
|
||||
def edit(field, new_toml, old_toml=None):
|
||||
lines.append("[[proposal.edit]]")
|
||||
lines.append(f"field = {E._toml_str(field)}")
|
||||
if old_toml is not None:
|
||||
lines.append(f"old = {old_toml}")
|
||||
lines.append(f"new = {new_toml}")
|
||||
lines.append(f"page = {E._toml_str(page)}")
|
||||
lines.append(f"quote = {E._toml_str(quote)}")
|
||||
lines.append("")
|
||||
|
||||
edit("hike.season", E._toml_str(phrase))
|
||||
edit("hike.months", "[" + ", ".join(str(m) for m in months) + "]")
|
||||
edit("hike.season_basis", E._toml_str(basis))
|
||||
edit("hike.season_method", E._toml_str(method))
|
||||
checked_old = hike.get("checked")
|
||||
edit("hike.checked", E._toml_str(today), E._toml_str(checked_old) if checked_old else None)
|
||||
for url, publisher, q in cites:
|
||||
lines += ["[[proposal.append]]", 'table = "hike.source"',
|
||||
f"page = {E._toml_str(url)}", f"quote = {E._toml_str(q)}", "",
|
||||
"[proposal.append.entry]",
|
||||
f"url = {E._toml_str(url)}",
|
||||
f"publisher = {E._toml_str(publisher)}",
|
||||
'facts = ["season", "months"]', ""]
|
||||
if basis == "estimate":
|
||||
change = f"A season was estimated: {phrase}."
|
||||
why_basis = ("No page states a season. It was set by judgement from the climate "
|
||||
"at the trail's elevation and from similar trails.")
|
||||
else:
|
||||
change = f"A season was set from pages that differ: {phrase}."
|
||||
why_basis = ("The pages that state a season differ and none is the managing body, "
|
||||
"association or route author, so it was set by judgement from all of "
|
||||
"them and the climate estimate.")
|
||||
lines += ["[proposal.history]", f"change = {E._toml_str(change)}",
|
||||
f"basis = {E._toml_str(why_basis)}",
|
||||
f"basis_url = {E._toml_str(page)}",
|
||||
'asked_by = "the dataset\'s own check"',
|
||||
'fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]',
|
||||
""]
|
||||
d = os.path.join(out, tid)
|
||||
os.makedirs(d, exist_ok=True)
|
||||
with open(os.path.join(d, "proposal.toml"), "w", encoding="utf-8") as f:
|
||||
f.write("\n".join(lines))
|
||||
report.append((tid, "changed", page, f"season {phrase}; {note}"))
|
||||
os.makedirs(out, exist_ok=True)
|
||||
import csv
|
||||
with open(os.path.join(out, "report.csv"), "w", newline="", encoding="utf-8") as f:
|
||||
writer = csv.writer(f)
|
||||
writer.writerow(["id", "outcome", "pages", "remark"])
|
||||
writer.writerows(report)
|
||||
return len(report)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Command line.
|
||||
|
||||
def _truth(root):
|
||||
truth = {}
|
||||
for tid, rec in E._records(root):
|
||||
hike = rec.get("hike") or {}
|
||||
if season.read_from_a_page(hike):
|
||||
truth[tid] = sorted(int(m) for m in hike.get("months") or [])
|
||||
return truth
|
||||
|
||||
|
||||
def build_packets(root, out_dir, fetch, precip_file=None, pages_text=None):
|
||||
"""Write packets/<id>.md and part-N.txt under out_dir. Reads the climate
|
||||
through fetch (the cache); returns the number of packets."""
|
||||
recs = {tid: dict(rec, id=tid) for tid, rec in E._records(root)}
|
||||
ids = sorted(recs)
|
||||
truth = _truth(root)
|
||||
precip = {}
|
||||
if precip_file:
|
||||
with open(precip_file, encoding="utf-8") as f:
|
||||
precip = json.load(f)
|
||||
params = E.load_params(root)
|
||||
refs = E.references(root, fetch)
|
||||
info, meds, centres = {}, {}, {}
|
||||
for tid in ids:
|
||||
pts, kind = E.sample_points(root, recs[tid])
|
||||
norms = E.normals_at(pts, fetch)
|
||||
profile = None
|
||||
if kind == "track":
|
||||
try:
|
||||
with open(os.path.join(root, tid, "elevation.json"), encoding="utf-8") as f:
|
||||
data = json.load(f)
|
||||
profile = (data["highest"]["m"], data["lowest"]["m"])
|
||||
except (OSError, KeyError, TypeError, ValueError):
|
||||
profile = None
|
||||
got = M.usable(norms)
|
||||
info[tid] = {"points": got or [], "kind": kind, "profile": profile}
|
||||
if got:
|
||||
meds[tid] = M.medians(got)
|
||||
centres[tid] = (sum(p.lat for p in got) / len(got), sum(p.lon for p in got) / len(got))
|
||||
parts = split_parts([t for t in ids if t in truth], [t for t in ids if t not in truth])
|
||||
part_of = {t: n for n, p in enumerate(parts) for t in p}
|
||||
os.makedirs(os.path.join(out_dir, "packets"), exist_ok=True)
|
||||
for n, part in enumerate(parts, 1):
|
||||
with open(os.path.join(out_dir, f"part-{n}.txt"), "w", encoding="utf-8") as f:
|
||||
f.write("\n".join(part) + "\n")
|
||||
pages = {}
|
||||
if os.path.exists(PAGES):
|
||||
with open(PAGES, encoding="utf-8") as f:
|
||||
pages = json.load(f)
|
||||
for tid in ids:
|
||||
rec = recs[tid]
|
||||
est = E.estimate(root, rec, params, fetch, refs)
|
||||
comp = []
|
||||
for other in comparables(tid, part_of, sorted(truth), meds, centres):
|
||||
o = recs[other]
|
||||
high, _low = M.high_low(info[other]["points"])
|
||||
comp.append((o["name"], o.get("regions") or [],
|
||||
_ft(statistics.median(p.elev_m for p in high)),
|
||||
str((o.get("hike") or {}).get("season")), truth[other]))
|
||||
text = packet_text(rec, info[tid], est["months"] or [], comp,
|
||||
pages=_pages_text(pages.get(tid)),
|
||||
precip=precip.get(tid))
|
||||
with open(os.path.join(out_dir, "packets", f"{tid}.md"), "w", encoding="utf-8") as f:
|
||||
f.write(text)
|
||||
return len(ids)
|
||||
|
||||
|
||||
def _pages_text(entry):
|
||||
if not entry:
|
||||
return None
|
||||
publishers = "; ".join(s["publisher"] for s in entry["sources"])
|
||||
return f"Publisher(s): {publishers}\nMonths each gives: {entry.get('months_text', '')}"
|
||||
|
||||
|
||||
def cmd_packets(args):
|
||||
fetch = E._fetch_with_cache(args.cache)
|
||||
n = build_packets(ROOT, args.out, fetch, args.precip)
|
||||
print(f"{n} packets written to {args.out}/packets")
|
||||
return 0
|
||||
|
||||
|
||||
def cmd_score(args):
|
||||
ids = refresh.trail_ids(ROOT)
|
||||
truth = _truth(ROOT)
|
||||
answers = {}
|
||||
for path in args.answers:
|
||||
got, problems = read_answers(path, ids)
|
||||
for n, text in problems:
|
||||
print(f"{path} line {n}: {text}")
|
||||
answers.update(got)
|
||||
figures = score(answers, truth)
|
||||
t, m = figures["tested"], figures["matched"]
|
||||
print(f"owner's measure (within one month at each end): {m} of {t} = {100 * m / t:.1f}%"
|
||||
f" ({figures['unanswered']} unanswered)")
|
||||
for c in CONFIDENCES:
|
||||
v = figures["by_confidence"][c]
|
||||
print(f" {c:<7} {v['matched']:>3} of {v['tested']:<3} = "
|
||||
f"{100 * v['matched'] / v['tested'] if v['tested'] else 0:.1f}%")
|
||||
if args.write:
|
||||
write_blind_test(args.write, figures, args.date or datetime.date.today().isoformat())
|
||||
print(f"written to {args.write}")
|
||||
return 0
|
||||
|
||||
|
||||
def cmd_proposals(args):
|
||||
n = proposals(ROOT, args.answers, args.pages, args.dir)
|
||||
print(f"{n} proposals staged")
|
||||
return 0
|
||||
|
||||
|
||||
def cmd_inputs(args):
|
||||
fetch = E._fetch_with_cache(args.cache)
|
||||
params = E.load_params(ROOT)
|
||||
refs = E.references(ROOT, fetch)
|
||||
doc = {}
|
||||
for tid, rec in E._records(ROOT):
|
||||
if (rec.get("hike") or {}).get("season_basis") == "estimate":
|
||||
doc[tid] = E.inputs_signature(E.estimate(ROOT, dict(rec, id=tid), params, fetch, refs))
|
||||
with open(args.write, "w", encoding="utf-8") as f:
|
||||
json.dump(doc, f, indent=1, sort_keys=True)
|
||||
f.write("\n")
|
||||
print(f"inputs of {len(doc)} estimates written to {args.write}")
|
||||
return 0
|
||||
|
||||
|
||||
def main(argv=None):
|
||||
parser = argparse.ArgumentParser(description=__doc__,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
sub = parser.add_subparsers(dest="command", required=True)
|
||||
p = sub.add_parser("packets", help="write the packets and part lists")
|
||||
p.add_argument("--out", required=True)
|
||||
p.add_argument("--precip", default=None,
|
||||
help="JSON {id: [twelve monthly mm for each sample point]}; optional")
|
||||
p.add_argument("--cache", default=None)
|
||||
p.set_defaults(func=cmd_packets)
|
||||
p = sub.add_parser("score", help="score answer files against the sourced seasons")
|
||||
p.add_argument("answers", nargs="+")
|
||||
p.add_argument("--write", default=None, help="record the figures in this JSON file")
|
||||
p.add_argument("--date", default=None)
|
||||
p.set_defaults(func=cmd_score)
|
||||
p = sub.add_parser("proposals", help="stage the judged seasons for refresh.py")
|
||||
p.add_argument("--answers", default=JUDGED)
|
||||
p.add_argument("--pages", default=PAGES)
|
||||
p.add_argument("--dir", default=None)
|
||||
p.set_defaults(func=cmd_proposals)
|
||||
p = sub.add_parser("inputs", help="record the inputs of every estimate")
|
||||
p.add_argument("--write", default=INPUTS)
|
||||
p.add_argument("--cache", default=None)
|
||||
p.set_defaults(func=cmd_inputs)
|
||||
args = parser.parse_args(argv)
|
||||
return args.func(args)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1,223 @@
|
||||
across-utah-route 4,5,6,9,10 April to June and September to October medium Desert heat in summer and snow in the Henrys, La Sals and Bryce country in winter leave spring and fall.
|
||||
akshayuk-pass 7,8 July to August medium Arctic Baffin Island is frozen and snowbound until late June and freezes up again by September, so the walkable window is the two summer months.
|
||||
alexander-mackenzie 6,7,8,9 June to September medium Snow lingers on the Interior Plateau and Tweedsmuir highlands into June and autumn rain and early snow return in October.
|
||||
allegheny-trail 4,5,6,7,8,9,10 April to October medium Mid-elevation West Virginia mountains are mild and green from April to October, with winter snow and ice and summer humidity making the edges less pleasant.
|
||||
alpine-trail-7 7,8,9 July to September high Heavy winter snow at 7,000 feet in the Swan Range melts out by mid-July, and snow returns in October.
|
||||
american-discovery-trail 4,5,6,7,8,9,10 April to October low A coast-to-coast thru-hike starts in spring and must reach the Colorado and Sierra high ground in summer before autumn snow, so the whole route fits April to October.
|
||||
appalachian 3,4,5,6,7,8,9,10 March to October high A northbound thru-hike starts in March-April in Georgia and reaches Katahdin by September-October before Maine's snow, so the season spans March to October.
|
||||
appalachian-high-route 4,5,6,9,10 Spring and fall medium Mountain loop over 5,000-foot ridges in NC and TN where summer is hot and humid and winter is icy, so spring and fall are the comfortable windows.
|
||||
arizona 3,4,5,9,10,11 Spring and fall medium Low desert is too hot in summer and the high forest and Grand Canyon rim hold snow in winter, so thru-hikers go north from March to May or flip into fall.
|
||||
avon 4,5,6,7,8,9,10 April to October medium Winter snow and early-spring mud on Ontario farmland end with the thaw, and the walk runs until late fall.
|
||||
backbone 1,2,3,4,5,10,11,12 October to May medium Santa Monica Mountains chaparral is baking hot and dry from June to September, so the cool wetter months and spring wildflowers are the walking season.
|
||||
baker 4,5,6,9,10 April to June and September to October medium Humid, buggy summers and icy, muddy winters in western Pennsylvania make spring and fall the usual walking months.
|
||||
bartram 3,4,5,9,10,11 Spring and fall medium Blue Ridge route with summer heat and haze below and winter ice on the 5,000-foot balds, so spring and fall are best.
|
||||
basin-and-range-trail 4,5,9,10 Spring and fall high Nevada desert route with scorching summer heat and little water and snow on the high ranges in winter, so spring and fall are the windows.
|
||||
batona 3,4,5,9,10,11 March to May and September to November medium Flat Pine Barrens walking is best when it is cool, away from summer heat, ticks and biting flies.
|
||||
bay-circuit 3,4,5,9,10,11 March to May and September to November medium Humid, buggy summers and icy winters in low-lying eastern Massachusetts leave spring and fall, though it can be walked all year.
|
||||
bayou-state-trail 1,2,3,4,11,12 November to April medium Summer heat, humidity, mosquitoes and storms in Louisiana push hiking into the cool, dry winter and early spring.
|
||||
beartooth-high-route 7,8,9 July to September high Cross-country route at about 11,000 feet in the Beartooths where snow lingers into July and returns by late September, so only mid-summer works.
|
||||
benton-mackaye 3,4,5,9,10,11 Spring and fall medium Southern Appalachian ridges up to 5800 ft are pleasant in spring and fall, while summer is hot, humid and buggy and winter brings ice.
|
||||
big-bend-100 1,2,3,11,12 November to March high Chihuahuan Desert heat above 90F from May to September makes the cool months the only sensible window.
|
||||
big-seki-loop 7,8,9 July to September high High Sierra passes up to 13,000 ft hold snow into early July and fresh snow returns by October, leaving July to September.
|
||||
bigfoot-trail 7,8,9 July to September medium Klamath-Siskiyou high ground holds snow into June and gets heavy autumn rain from October, so the dry summer months fit.
|
||||
bitterroots-80-mile-route 7,8,9 July to September medium High Selway-Bitterroot ground near 7,900 ft holds snow into early July and fall snow returns by October.
|
||||
black-canyon 1,2,3,4,10,11,12 October to April high Sonoran Desert foothills are dangerously hot from May to September, so the cool months from October to April are the season.
|
||||
blue-mountains-trail 5,6,9,10 May to June and September to October low Hot dry summers in the canyons and snow in the Wallowas and Blues outside late spring and early fall limit the window, though high sections are fine in midsummer.
|
||||
border-route 5,6,7,8,9,10 Late May to October medium Northern Minnesota boundary-waters ridges are snow-bound and muddy until May and bugs peak in June and July, but the trail is walkable from May through fall.
|
||||
boreal-trail 6,7,8,9 June to September medium Saskatchewan boreal forest has long cold winters and is frozen into May, leaving the short warm summer for hiking.
|
||||
boundary-trail-mount-st-helens 7,8,9,10 July to October high Cascade ridges around 5,000 feet hold snow until July, and heavy rain starts in late October.
|
||||
boundary-trail-pasayten 7,8,9 July to September high The Pasayten high country at 5,500 to 7,500 feet is under snow until early July, and snow returns in October.
|
||||
brazeau-loop 7,8,9 July to September high Jasper's high passes and river fords need snowmelt to subside, so it is walkable from July until the first snow in September.
|
||||
bristol-hills-trail 5,6,7,8,9,10 May to October medium Snow and mud make winter and early spring uncommon for walking, so the comfortable months run from late spring through fall.
|
||||
brooks-range-traverse 6,7,8,9 June to September low Arctic tundra is frozen and snowbound most of the year, with river breakup in early June and freeze-up and snow by mid-September.
|
||||
bruce-trail 4,5,6,7,8,9,10 April to October medium The Niagara Escarpment is icy and muddy through winter and early spring, so end-to-end hikes run from the April thaw to the end of October.
|
||||
buckeye 3,4,5,9,10,11 Spring and fall medium Ohio summers are hot, humid and buggy and winters are cold and muddy, so spring and fall are the comfortable thru-hiking windows.
|
||||
california-coastal 4,5,6,7,8,9,10 April to October low The coast can be walked all year, but winter storms bring heavy rain in the north and leave some sections passable only at low tide, so a full walk suits the dry months.
|
||||
canol 7,8 July and August medium Mackenzie Mountains trail where snow lingers on the passes into late June and the first snow returns in early September, leaving July and August.
|
||||
centennial-sd 5,6,9,10 May to June and September to October medium Black Hills summer heat and thunderstorms and winter snow leave late spring and early fall as the best months.
|
||||
central-wilderness-grand-tour 6,7,8,9,10 June to October medium Mid-elevation Golden Trout Wilderness melts out early, but Coyote Lakes Pass and Kern crossings need low snow and low water, so summer through early fall.
|
||||
central-wind-rivers-loop 7,8,9 July to September high Wind River Range snow and swollen creeks persist until mid-July and winter returns by late September.
|
||||
chinese-wall-circuit 7,8,9 July to September high The Bob Marshall high country near 8,500 ft holds snow until July and gets fall snow by late September.
|
||||
circle-of-solitude 7,8,9 July to September high High passes like Colby, Avalanche and Forester stay snowbound and high-water crossings last into July, with autumn storms after September.
|
||||
cohos 6,7,8,9,10 June to October medium The pages differ: The Trek gives May to October and Backpacking Routes gives June to November. It was set by judgement from both and from the climate, since snow and mud last into late May and cold sets in by late October.
|
||||
colorado-trail 7,8,9 July to September high San Juan and Collegiate high ground above 12,000 ft is snow-covered until early July and snows again by late September.
|
||||
condor-trail 3,4,5,10,11 Spring and fall medium Los Padres coast ranges are very hot and dry from June to September and wet in midwinter, so spring and fall are the windows.
|
||||
conestoga-trail 3,4,5,9,10,11 March to May and September to November medium The low Lancaster County hills are hot, humid and tick-ridden in summer, so the cool months suit it best.
|
||||
conservation-trail 4,5,6,7,8,9,10 April to October medium Low-elevation western New York is snowy in winter and muddy in March, and can be walked from April until late fall.
|
||||
continental-divide 5,6,7,8,9,10 May to October medium A thru-hike must start north of the Mexican border after the desert winter and clear the San Juans, Wyoming and Montana high ground between the June snowmelt and the first October storms.
|
||||
corvallis-to-the-sea 5,6,7,8,9,10 May to October medium Very wet, muddy Coast Range winters push the walk into the drier months from late spring through early fall.
|
||||
cottonwood-trail 6,7,8,9 June to September medium Yukon mountain passes are snow-covered until June and cold and snowy again by late September, leaving the short summer.
|
||||
cranberry-lake-50 6,7,8,9,10 June to October medium Adirondack snow and mud in spring and black flies into June leave summer and fall as the usual window.
|
||||
cross-vermont 5,6,7,8,9,10 May to October medium A low-elevation route of mostly rail trail and quiet roads, where winter snow and mud season bracket a long snow-free stretch from May to October.
|
||||
dan-zhur-donjek 7,8 July to August medium Subarctic Kluane high country with glacial river crossings is snowbound until late June and snows again by early September.
|
||||
deadman-and-cloud-canyons 7,8,9 July to September high High Sierra passes like Elizabeth Pass and Colby Pass hold snow and stream crossings run high until July, and autumn storms begin in October.
|
||||
deadman-creek-loop 1,2,3,4,11,12 November to April medium Low Sonoran desert at about 2,200 ft reaches 90 to 100 F from May to September, so the walk belongs in the cool season.
|
||||
deseret-hiking-route 5,6,7,8,9,10 May to October low A route from southern Utah desert canyons to the Pioneer Mountains of Idaho needs the high ground clear of snow and the south not scorching.
|
||||
desert-trail 4,5,6,9,10 April to June and September to October low Waterless desert is too hot in summer and snowy in winter, so a full walk runs through spring and early fall.
|
||||
desert-winter-thru-hike 1,2,3,11,12 November to March medium Designed as a winter route through Sonoran, Colorado and Mojave deserts that are too hot from April through October.
|
||||
donut-hole 4,5,6,9,10 April to June and September to October low Unbridged streams run high in early spring, and the valleys are hot, humid and buggy in midsummer, so the shoulder months suit best.
|
||||
eagle-cap-traverse 7,8,9 July to September high Wallowa high passes near 7,000 ft hold snow until early July and fall storms arrive in October.
|
||||
east-beach-trail 5,6,7,8,9 May to September medium Haida Gwaii beach walking is best in the drier months, as heavy rain and storms dominate from October through winter.
|
||||
east-coast-trail 6,7,8,9 June to September medium Newfoundland's cold, foggy shoulder seasons and lingering snow and ice leave summer into early fall as the comfortable window.
|
||||
eastern-continental-trail 1,2,3,4,5,6,7,8,9,10 January to October low A thru-hike of about 300 days starts in the Florida winter and has to finish in the Gaspe before the November snows.
|
||||
eastern-sierra-high-route 7,8,9 July to September high Cross-country passes above 10,500 feet need the snow to have melted, which is from mid-July through September.
|
||||
finger-lakes 4,5,6,7,8,9,10 April to October medium The pages differ: one Trek page gives winter, spring, summer and fall, and a table on the same page gives spring, summer and fall. It was set by judgement from both and from the climate, since snow lies from December to March and early spring is muddy.
|
||||
florida 1,2,3,11,12 November to March high Subtropical heat, wet-season flooding and bugs from May to October make the cool dry months the thru-hiking season.
|
||||
foothills 3,4,5,9,10,11 Spring and fall medium Blue Ridge escarpment trail is comfortable in spring and fall, with hot humid summers and some winter ice at the higher end.
|
||||
fremont 6,7,8,9,10 June to October medium Oregon ridge route at 6,000 to 8,000 feet is snow-covered into early June and snowy again by November, with dry summers.
|
||||
ganaraska 4,5,6,7,8,9,10 April to October medium Southern Ontario is snowy in winter and muddy in March, and the trail can be walked from April until late fall.
|
||||
general-george-crook 4,5,6,9,10 April to June and September to October medium Rim country is snowy in winter, and the July and August monsoon brings lightning and storms, leaving spring and fall.
|
||||
georgia-loop 3,4,5,9,10,11 March to May and September to November medium The north Georgia mountains are hot, humid and stormy in summer and cold and icy on the ridges in winter.
|
||||
gila-centennial-loop 3,4,5,9,10,11 March to May and September to November medium Gila canyons at 6,000 feet are hot from June to August, with monsoon storms and flash floods, and cold in winter.
|
||||
gospel-hump-loop 7,8,9 July to September high Idaho subalpine ridges around 7,000 feet hold snow until late June and get snow again by October, so only summer into early fall works.
|
||||
grand-enchantment 3,4,5,10,11 March to May, and October to November low The route crosses hot Sonoran desert and 10,000 ft Mogollon peaks, so a spring or fall thru-hike avoids summer heat at low ground and winter snow high up.
|
||||
grand-moab-route 6,9,10 June and September to October low The route crosses 12,000-foot La Sal snow until June and desert canyons above 95F in July and August, which leaves early summer and fall.
|
||||
grand-sawtooth-loop 7,8,9 July to September high Sawtooth passes and lake basins hold snow into early July and fall storms return in late September.
|
||||
grand-teton-loop 7,8,9 July to September high Paintbrush Divide and Hurricane Pass hold snow into July and are snowy again by October, leaving July to September.
|
||||
grand-valley-trail 4,5,6,7,8,9,10 April to October medium A low-elevation southern Ontario footpath that can be walked in all but deep winter and the muddy early spring.
|
||||
great-basin-trail 4,5,6,9,10 April to June and September to October low Scarce water and 80 F summer heat in the valleys, plus winter snow on the ranges, favour spring and early fall.
|
||||
great-colorado-route 6,7,8,9 June to September medium A route linking fourteeners and passes above 12,000 ft needs the snow gone, so it runs from early summer into early fall.
|
||||
great-divide-trail 7,8,9 July to September high Alberta and BC Rockies passes stay snow-covered until early July and fresh snow returns in September, so thru-hikers walk July to mid-September.
|
||||
great-eastern 4,5,6,7,8,9,10 April to October low A very long Appalachian walk, started in spring in Alabama and carried through summer humidity and into fall to avoid winter in the north.
|
||||
great-plains-trail 5,6,7,8,9,10 May to October low A north-to-south prairie route from Saskatchewan to Texas is walked from late spring to fall, avoiding cold northern winters and heat in the south by timing.
|
||||
great-western-divide-loop 7,8,9 July to September medium Kaweah Gap and the Great Western Divide hold deep snow into early July, and autumn storms return by October.
|
||||
great-western-loop 4,5,6,7,8,9,10 April to October low A roughly 208-day circuit of western trails starts in spring from the Arizona desert and must clear the Sierra, Rockies and Cascades in summer before fall snow.
|
||||
green-river-lakes-titcomb-basin-loop 7,8,9 July to September high The northern Wind Rivers hold snow and high water into mid-July and get fall storms by late September.
|
||||
guadalupe-ridge-trail 3,4,10,11 Spring and fall medium Chihuahuan Desert lowlands are very hot from May to September and the ridge gets cold and windy in winter, so spring and fall are best.
|
||||
hayduke-trail 4,5,9,10 April to May and September to October medium Canyon country is too hot in summer and the Henry Mountains and Boulder snow in winter, so thru-hikers start in spring or fall.
|
||||
heart-lake-two-ocean-plateau-loop 7,8,9 July to September high Yellowstone's high backcountry has deep snow and high water into late June and returns to winter by October, so July to September is the window.
|
||||
high-country-pathway 5,6,7,8,9,10 May to October medium Northern Michigan forest is snowbound in winter and muddy in early spring, and walkable from May to October, with bugs the main summer complaint.
|
||||
high-sierra 7,8,9 July to September high Kaweah Gap and Whitney's high ground hold snow and run high streams until July, and autumn storms start in October.
|
||||
highlands 3,4,5,9,10,11 March to May and September to November medium The low New Jersey and New York Highlands ridges are hot, humid and buggy in summer and icy in midwinter.
|
||||
highline 4,5,6,9,10 April to June, and September to October medium Mogollon Rim at 6,000 ft is warm and dry in spring and fall, with summer monsoon storms in July and August and snow in winter.
|
||||
hoosier-heritage-trail 3,4,5,9,10,11 March to May and September to November medium Indiana has hot, humid summers with ticks and thick vegetation, so spring and fall are the most comfortable months.
|
||||
horse-shoe 3,4,5,9,10,11 March to May and September to November medium Southeast Pennsylvania has humid, buggy summers and icy winters, which leaves spring and fall.
|
||||
hot-springs-trail 4,5,6,7,8,9 April to September low A northbound route of about 110 days from coastal California to Idaho needs the Sierra and the northern mountains clear of snow, so it runs from spring to early fall.
|
||||
iat-newfoundland-labrador 6,7,8,9 June to September medium Western Newfoundland is cold, snowy and boggy until June, and storms and snow return in October.
|
||||
ice-age 5,6,7,8,9,10 May to October medium The pages differ: one Trek page gives summer and fall and another gives summer only. It was set by judgement from both and from the climate, since snow and mud last through April and a hard freeze comes by November.
|
||||
idaho-centennial 6,7,8,9 June to September medium Snow on the mountain sections lasts into June while the southern desert gets hot, so a north-bound walk runs June through September.
|
||||
international-appalachian-trail-maine 6,7,8,9,10 June to October medium Northern Maine is snowbound and muddy until late May and frozen from November, and fall is best once the bugs fade.
|
||||
island-walk 6,7,8,9,10 June to October medium Prince Edward Island is cold and wet in spring and late fall, so the walk is done in the warm months.
|
||||
itijjagiaq-trail 7,8 July to August medium Baffin Island's Katannilik park is frozen and used by skiers and snowmobilers until June, so summer hiking is limited to July and August before September freeze.
|
||||
john-muir 7,8,9 July to September high High Sierra passes above 11,000 ft are snow-choked until early July and storms and cold return in late September, so thru-hikes run July to September.
|
||||
kanab-canyon-loop 3,4,5,10,11 Spring and fall high Grand Canyon inner gorge is dangerously hot from June to September with monsoon storms, so spring and fall are the standard seasons.
|
||||
kings-canyon-high-basin-route 7,8,9 July to September high Off-trail travel over 12,000 ft passes needs the snow gone and stable weather, which only holds from July to September.
|
||||
knobstone 3,4,5,9,10,11 March to May and September to November medium Southern Indiana summers are hot, humid and tick-ridden, while the steep, leafless bluffs in the cool shoulder seasons are the draw.
|
||||
koroc-palmer-loop 7,8 July to August medium The Torngat Mountains in the Arctic are snowbound until late June and freeze again by September, leaving a short July and August window.
|
||||
la-cloche 6,7,8,9,10 June to October medium Killarney is snowbound in winter and buggy in spring, so the warm months are the main window, with September and early October the best.
|
||||
laurel-highlands 4,5,6,7,8,9,10 April to October medium Moderate Pennsylvania ridge at about 2,500 feet is snowy in midwinter but mild enough from April to October.
|
||||
lone-star 1,2,3,11,12 November to March high East Texas piney woods are hot, humid and buggy for much of the year, so the cool winter months are the hiking season.
|
||||
long-path 4,5,6,9,10 April to June and September to October medium Humid, buggy summers and icy winters in the Hudson Valley and Catskills favour spring and fall.
|
||||
long-trail 6,7,8,9,10 June to October high Green Mountain ridges are muddy and snowy until late May and wintry by November, so thru-hikers walk June to October.
|
||||
lost-coast 5,6,7,8,9 May to September high Heavy winter rain, slides and high tides make parts of the coast impassable, so the dry months with workable low tides are used.
|
||||
lowest-to-highest-route 5,6,10 Late May to June, or October low Badwater is lethal in summer heat while Whitney holds snow until June, so the route fits a narrow window in late spring or early fall.
|
||||
loyalsock 4,5,6,9,10 April to June and September to October medium Rocky, wet terrain in northern Pennsylvania is best in the cool shoulder seasons, before the humid, buggy summer.
|
||||
maah-daah-hey 5,6,9,10 May to June and September to October medium Badlands clay turns to impassable gumbo when wet and summer is hot, so late spring and early fall are the usual months.
|
||||
maricopa-trail 1,2,3,4,10,11,12 October to April high Phoenix-area Sonoran Desert is above 95F from May to September, so the cool months from October to April are the season.
|
||||
mason-dixon 3,4,5,9,10,11 March to May and September to November medium The low Susquehanna valley is hot and humid in summer, so the cool spring and fall months suit best.
|
||||
massanutten 3,4,5,9,10,11 Spring and fall medium Virginia ridge circuit with hot humid summers and cold winters, so spring and fall are most comfortable.
|
||||
mattabesett 3,4,5,9,10,11 Spring and fall medium Low Connecticut traprock ridges are best in spring and fall, with summer humidity, heat and ticks and some winter ice on ledges.
|
||||
metacomet-monadnock 4,5,6,9,10 Spring and early summer, and fall low New England ridge walking is cold and icy in winter and humid and buggy in midsummer, so spring and fall are favoured.
|
||||
mid-state 4,5,6,7,8,9,10 April to October medium Pennsylvania ridge and plateau trail at about 2,000 feet is snowy in winter but fine from April to October, with summer humidity and ticks.
|
||||
middle-fork-kings-river 7,8,9 July to September high Muir Pass and Hell-for-Sure Pass hold snow into early July and storms return in autumn, so July to September.
|
||||
middle-fork-trail 6,7,8,9,10 June to October low Idaho river canyon and high bench trail clears of snow in June and gets cold wet weather by November, though low canyon heat peaks in July.
|
||||
midland-to-mackinac-trail 6,7,8,9,10 June to October medium Snow and mud last into April in northern Michigan, and the walk is comfortable from June through early fall.
|
||||
midstate-ma 4,5,6,9,10,11 April to June and September to November medium The gentle central Massachusetts hills are pleasant in spring and fall, with humid, buggy summers and cold, icy winters.
|
||||
milestone-basin-and-the-upper-kern 7,8,9 July to September high Sierra passes above 10,000 ft and Kern fords stay snowy and high into early July, with autumn storms returning in October.
|
||||
mogollon-rim-trail 4,5,9,10 April to May and September to October low Low desert sections reach 90 F by June and the White Mountains and Blue Range hold snow in winter, so spring and fall fit a full crossing.
|
||||
mojave-sonoran-trail 1,2,3,11,12 November to March high Colorado River desert lowlands reach 100F from May to September, so the cool winter months are the only practical window.
|
||||
monadnock-sunapee 6,7,8,9,10 June to October medium New Hampshire snow, mud and black flies linger into early June and the summit ridges are snowy from late fall.
|
||||
montana-trail 6,7,8,9 June to September low A 90-to-122-day crossing from the Divide to the plains starts after mountain snow clears in June and aims to finish before winter on the Missouri breaks.
|
||||
mountains-to-sea 3,4,5,9,10,11 March to May and September to November medium High Smokies and Blue Ridge are cold in winter while the Piedmont and coast are hot and humid in summer, so cool shoulder seasons suit a full walk.
|
||||
nankoweap-bright-angel-loop 5,9,10 May and September to October low The Grand Canyon inner canyon is dangerously hot from June to August and the North Rim road is snowed in over winter, leaving late spring and early fall.
|
||||
nepisiguit-migmaq-trail 6,7,8,9 June to September medium Northern New Brunswick is snowy and muddy through May and cold by October, with river and bug conditions favouring summer.
|
||||
new-england 4,5,6,9,10 April to June and September to October medium Traprock ridges are cold and icy in winter and hot, humid and buggy in July and August, so spring and fall suit best.
|
||||
north-boundary 7,8,9 July to September medium Snake Indian Pass and the Smoky River crossings need snowmelt in the Jasper backcountry, and winter returns by October.
|
||||
north-country 5,6,7,8,9,10 May to October low A thru-hike across the northern states starts after the North Dakota spring thaw and must finish before winter sets in the Adirondacks and Vermont by late October.
|
||||
north-south 3,4,5,9,10,11 March to May and September to November medium Rhode Island woods are humid and buggy in summer and cold in winter.
|
||||
north-south-lbl 3,4,5,9,10,11 March to May and September to November medium The forests of western Kentucky and Tennessee are hot, humid and tick-ridden in summer, so spring and fall are favoured.
|
||||
north-umpqua 6,7,8,9,10 June to October medium The upper Cascade sections near 6,000 feet hold snow into June and see heavy rain and snow from late October, though the river canyon can be walked earlier.
|
||||
northern-colorado-trail 7,8,9 July to September medium Flat Tops and Rocky Mountain high ground above 11,000 ft is snowbound until early July and snows again by late September.
|
||||
northern-new-mexico-loop 6,7,8,9,10 June to October low The Sangre de Cristo and Jemez high ground holds snow into June, and lower desert stretches are hot in midsummer, so a whole loop fits June to October.
|
||||
northville-placid 6,7,8,9,10 June to October medium Adirondack wilderness trail is wet, snowy and muddy until late May, with black flies in May and June and cold weather by late October.
|
||||
oak-ridges 4,5,6,7,8,9,10 April to October medium The southern Ontario moraine is snowy and muddy over winter and can be walked from April until late fall.
|
||||
ocean-to-lake 1,2,3,11,12 November to March high South Florida is hot, wet and buggy from May to October with flooded swamp and prairie, so the cooler dry months are used.
|
||||
oregon-coast 5,6,7,8,9 May to September medium The coast gets 10-16 inches of rain a month from November to March and the drier months from May to September make beach walking and creek crossings workable.
|
||||
oregon-desert 4,5,6,9,10 Spring and fall medium High desert at 3,000-8,000 ft is hot and waterless in July and August and cold in winter, so spring and fall are the walking windows.
|
||||
ottawa-temiskaming-highland-trail 6,7,8,9,10 June to October medium Northeastern Ontario forest is snowbound and muddy until May, with black flies in early summer, and cold by November.
|
||||
ouachita 3,4,5,10,11 March to May and October to November medium The pages differ: one gives April to November, one gives late October to late March, and one gives all year. It was set by judgement from all three and from the climate, since summers are hot and humid with ticks and winters are cold but walkable.
|
||||
ozark-highlands 3,4,5,10,11 Spring and fall medium Arkansas Ozark summers are hot, humid and buggy and winters are cold but popular for leaf-off views, so spring and fall are the typical seasons.
|
||||
ozark-trail 3,4,5,9,10,11 March to May and September to November medium The pages differ: one Trek page gives spring or fall and another adds winter. It was set by judgement from both and from the climate, since the heat, humidity and ticks of July and August make summer a poor choice.
|
||||
pacific-crest 4,5,6,7,8,9,10 April to October medium A thru-hike starts at the desert border in April or May, crosses the Sierra after the June to July snowmelt, and must finish the Washington Cascades by early October.
|
||||
pacific-northwest 7,8,9 July to September medium An east-to-west thru-hike starts in Glacier after the snow clears in early July and must finish through the wet Olympic coast before October rain and early snow.
|
||||
paumanok-path 3,4,5,9,10,11 March to May and September to November medium Long Island is humid and tick-heavy in summer, and the pine barrens are pleasant in the cool shoulder seasons.
|
||||
pfiffner-traverse 7,8,9 July to September high A Continental Divide crest route above 11,000 feet with off-trail passes needs the snow gone, which is from July until the first big September storms.
|
||||
pinhoti 3,4,5,10,11 Spring and fall medium Alabama and Georgia hills are hot and humid from June to September, and winter is wet and cold, so spring and fall are best.
|
||||
powell-plateau-loop 5,9,10 May and September to October low The Grand Canyon's North Rim access is snowed in until May and the inner canyon is very hot in June to August, leaving late spring and early fall.
|
||||
prescott-circle 3,4,5,9,10,11 March to May and September to November medium Prescott's high desert is hot in June to August with monsoon storms in July and August, while winters are cool but usually walkable, so shoulder seasons are best.
|
||||
ptarmigan-glenns-lake-highline-loop 7,8,9 July to September high Glacier's Ptarmigan Tunnel, Stoney Indian Pass and Highline are snow-blocked until mid-July and the first snows come in late September.
|
||||
quehanna 4,5,6,7,8,9,10 April to October medium Pennsylvania state forest trail at about 2,000 ft is walkable from April to October, with winter snow and March mud outside the season.
|
||||
rae-lakes-loop 7,8,9 July to September high Glen Pass at 11,978 ft keeps snow into early July and the Kings River crossings run high, with autumn storms after September.
|
||||
rideau-trail 4,5,6,7,8,9,10 April to October medium Eastern Ontario is snowy and muddy over winter, and the trail can be walked from April until late fall.
|
||||
ring-the-peak 6,7,8,9,10 June to October low A loop around Pikes Peak that mixes stretches near 11,000 feet with lower trails, and is snow-free from about June to October.
|
||||
river-to-river 3,4,5,10,11 Spring and fall medium Southern Illinois summers are hot, humid and buggy, with trailside poison ivy and ticks, so spring and fall are the comfortable seasons.
|
||||
route-in-between 4,5,6,7,8,9,10 April to October low A Mexico-to-Canada link route through Arizona desert, Utah canyons and Idaho mountains has to chain a spring start with high Idaho snow clearing by summer and finishing before fall.
|
||||
rutherford-lake-loop 7,8,9 July to September high Yosemite's south boundary passes at over 9,000 feet hold snow until early July, and autumn storms begin in October.
|
||||
san-diego-trans-county-trail 1,2,3,4,11,12 November to April medium The Salton Sea end and the desert washes are over 100F in summer, so the cool months are used, with the 4,900-foot mountains still mild in winter.
|
||||
santa-fe-to-taos 7,8,9 July to September medium Sangre de Cristo peaks near 12,000 ft are snowbound until late June and afternoon monsoon storms peak in July and August.
|
||||
sawtooth-wilderness-high-route 7,8,9 July to September high Mostly cross-country passes near 9,000 feet and above need the snow gone, which is from mid-July through September.
|
||||
sea-to-sea-route 4,5,6,7,8,9,10 April to October low A 7,775-mile coast-to-coast network across the northern prairie, the Rockies and the Cascades can only be walked from spring thaw to autumn snow.
|
||||
selway-river-trail 4,5,6,9,10 Spring and fall medium A low river canyon at 2,000 to 3,000 feet is free of snow early but reaches the mid-80s with fire risk in July and August, so spring and early fall are used.
|
||||
sentier-international-appalaches 6,7,8,9 June to September medium Gaspesie's Chic-Choc summits keep snow into June and the cold and snow return in October, so summer is the window.
|
||||
shawangunk-ridge-trail 3,4,5,9,10,11 March to May and September to November medium A Hudson Valley ridge with humid, buggy summers and icy winters, so spring and fall are the most comfortable months.
|
||||
sheltowee-trace 3,4,5,10,11 Spring and fall medium Kentucky's Daniel Boone National Forest is hot, humid and buggy in summer and cold in winter, so spring and fall are best.
|
||||
shenipsit-trail 3,4,5,9,10,11 March to May and September to November medium Central Connecticut has humid, buggy summers and cold, icy winters, so spring and fall are best.
|
||||
sierra-grand-traverse 7,8,9 July to September high Over 40 passes between 9,000 and 12,000 ft are snow-covered until July, and fall storms close the high country by October.
|
||||
sierra-high-route 7,8,9 July to September high The pages differ: Backpacking Routes gives late July to mid-September, and Skurka warns the route is off-limits to all but expert mountaineers from November through May. It was set by judgement from both and from the climate at the passes, which are near 12,000 feet.
|
||||
silver-moccasin-trail 4,5,6,10,11 April to June and October to November medium San Gabriel low canyons exceed 85 F in midsummer and Mount Baden-Powell is snowy in winter, so spring and autumn suit best.
|
||||
siskiyou-peaks-trail 7,8,9 July to September medium The summits and cirque lakes are snowbound until late June, and Shasta is climbed in summer.
|
||||
sky-islands-traverse 3,4,5,9,10,11 March to May and September to November low Summer heat and the July and August monsoon storms in southeastern Arizona push the walk into spring and fall.
|
||||
solitude-loop 7,8,9 July to September high Cloud Peak Wilderness at 9,000 to 11,000 feet holds snow into early July, and winter storms return in late September.
|
||||
south-boundary 7,8,9 July to September high Jasper's Cairn and Rocky passes near 6,000 ft and glacial river fords need snowmelt and low water, so early July to mid-September.
|
||||
south-lake-to-north-lake 7,8,9 July to September high Bishop, Muir and Piute passes above 11,000 ft hold snow into early July and storms return in late September.
|
||||
southeastern-serpentine-trail 3,4,5,10,11 Spring and fall medium A 30-35 day link of southern Appalachian trails is walked in spring and fall to dodge summer heat, humidity and bugs and winter ice on the higher sections.
|
||||
southern-sierra-high-route 7,8,9 July to September high Cross-country passes above 12,000 ft near Whitney hold snow into July and storms return by late September.
|
||||
southwestern-horseshoe 3,4,5,9,10,11 Spring and fall low Joining the Hayduke, Arizona and Grand Enchantment trails across Utah, Arizona and New Mexico desert means spring or fall to avoid summer heat and monsoon, with the highest ground snow-free by late spring.
|
||||
standing-stone 4,5,6,9,10 April to June and September to October medium Humid, buggy summers and icy winters on the Pennsylvania ridges leave spring and fall as the usual window.
|
||||
stein-valley-traverse 7,8,9 July to September medium The traverse tops out around 7,000 feet, where snow lingers into July, and heavy rain starts in October.
|
||||
sunapee-ragged-kearsarge 6,7,8,9,10 June to October medium New Hampshire snow and mud last into spring and black flies into early June, with foliage-season walking into early October.
|
||||
sunshine-coast 6,7,8,9 June to September medium The coast is drenched by 8-14 inches of rain a month from October to March and the mountaintop sections hold snow until June, so the dry summer months are the season.
|
||||
superior-hiking 5,6,7,8,9,10 May to October medium Lake Superior's North Shore is snowy and cold from November to April and buggy in June and July, so May to October with September and October favoured.
|
||||
susquehannock 5,6,7,8,9,10 May to October medium Northern Pennsylvania plateau stays snowy and wet through April, so late spring through early fall is the walking season.
|
||||
sycamore-canyon-az 3,4,10,11 March to April and October to November medium Low canyon country at 3,800 ft tops 90 F from June to September, so the loop belongs in the cooler spring and fall months.
|
||||
tahoe-rim 6,7,8,9,10 June to October medium The 10,000 ft ridgelines are snow-covered into June and again from late October, so thru-hikers walk from about late June to early October.
|
||||
tahoe-yosemite-trail 7,8,9 July to September high High Sierra passes up to about 10,000 feet hold snow until early July, and fall storms arrive in October.
|
||||
teton-crest 7,8,9 July to September high Crest passes above 10,000 feet hold snow until mid-July and storms and snow return by late September or October.
|
||||
teton-crest-route 7,8,9 July to September high Crest passes up to 10,700 ft hold snow into July and are wintry again by October, so July to September.
|
||||
teton-range-traverse 7,8,9 July to September high The Teton crest and Yellowstone Plateau are snow-covered until early July and wintry again by October, so July to September.
|
||||
teton-wilderness-loop 7,8,9 July to September high Two Ocean Pass and the Yellowstone River fords need snowmelt runoff to drop, which comes in mid-July, and fall storms arrive in late September.
|
||||
thames-valley-trail 5,6,7,8,9,10 May to October low Southwestern Ontario farmland trail is muddy and cold in early spring and snow-covered in winter, so it is walked from late spring to fall.
|
||||
thorofare-and-south-boundary-trail 7,8,9 July to September high Remote Yellowstone backcountry with deep snow and high river fords until early July, and snow returns in October.
|
||||
timberline 7,8,9 July to September high Mount Hood's snowfields and glacial stream crossings are at their best from mid-July through September before heavy autumn rain returns.
|
||||
toiyabe-crest 7,8,9 July to September medium Nevada crest at 10,000 feet is snow-covered into late June and cold again by October, leaving the dry summer.
|
||||
tonto-trail 1,2,3,4,11,12 November to April medium The Grand Canyon Tonto Platform is 90-100F from May to September with scarce water, so the cool months from November to April are the walking season.
|
||||
trans-adirondack-route 6,7,8,9,10 June to October low Adirondack wilderness with deep snow and mud into May, black flies in May and June, and winter returning in November.
|
||||
traversee-charlevoix 6,7,8,9,10 June to October medium The guided cabin crossing runs from after the Quebec thaw and black-fly peak through early October, avoiding the snowbound winter.
|
||||
tuscarora 3,4,5,9,10,11 March to May and September to November medium The Ridge and Valley Appalachians are hot, humid and buggy in summer and icy in winter, so spring and fall are the comfortable months.
|
||||
uinta-highline 7,8,9 July to September high Most of the trail is above 10,000 ft over 12,000 ft passes, so snow keeps it closed until early July and storms return by late September.
|
||||
vagabond-loop 3,4,5,6,7,8,9,10 March to October low A 3,500-mile circuit of Arizona, Utah, Colorado and New Mexico must start in the desert in early spring and cross the high Colorado Trail country in summer, before fall snow.
|
||||
vancouver-island 6,7,8,9 June to September medium Heavy Pacific rain from October to April and snow on the high alpine sections make early summer to September the window.
|
||||
vancouver-island-backbone 7,8,9 July to September medium Alpine ridges in the island interior hold snow until July and wet autumn storms begin in October; the packet's low elevation looks like a location error.
|
||||
warrior-trail 3,4,5,9,10,11 March to May and September to November medium Farmland ridges in southwestern Pennsylvania are overgrown, humid and buggy in summer and icy in winter.
|
||||
wasatch-traverse 7,8,9 July to September low The high Wasatch ridges and off-trail sections hold snow until late June and get early autumn storms, so midsummer fits a whole traverse.
|
||||
washington-coast-trail 5,6,7,8,9 May to September high Heavy rain from October to April and tide-dependent headlands make the drier months from May to September the usual window.
|
||||
waskahegan 5,6,7,8,9,10 May to October low Edmonton-area farmland and parkland is snow-covered and muddy from November to April, and walked from late spring to early fall.
|
||||
west-coast-trail 5,6,7,8,9 May to September high The trail is only open and reservable from May to September because of heavy autumn to spring rain and storms.
|
||||
western-uplands 5,6,7,8,9,10 May to October medium The Algonquin backcountry is frozen and snowy into April, buggy in late spring and cold by late October.
|
||||
wind-river-high-route-dixon-wilson 7,8,9 July to September medium Days above 10,000 ft on the Divide need the snow gone, which happens in mid-July, and storms return in September.
|
||||
wind-river-high-route-skurka 7,8,9 July to September high A mostly off-trail route at 10,000-12,000 ft with snowfields and big stream fords needs melt-out, which comes in mid-July and ends with September storms.
|
||||
wind-river-highline-trail 7,8,9 July to September high Bridger Wilderness benchlands and passes hold snow and high water into early July and winter returns by late September.
|
||||
wonderland 7,8,9 July to September high Mount Rainier's high ground keeps snow into July and heavy autumn rain begins in October, so mid-July to September is the window.
|
||||
wyoming-range 7,8,9 July to September high Crest-top trail at 9,000 ft or more is snowbound until early July and snows again by late September.
|
||||
yosemite-high-route 7,8,9 July to September high Mostly off-trail at 8,000 to 11,000 feet, so snowmelt, high stream crossings and early snow limit it to July through September.
|
||||
yosemite-high-sierra-camp-loop 7,8,9 July to September high Tuolumne's high passes and the camps are snow-bound until late June and shut for the season by early September, so July to September.
|
||||
|
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"sierra-high-route": {
|
||||
"why": "The pages differ: Backpacking Routes gives late July to mid-September, and Skurka warns the route is off-limits to all but expert mountaineers from November through May. It was set by judgement from both and from the climate at the passes, which are near 12,000 feet.",
|
||||
"months_text": "The Skurka page says the route is probably off-limits to all but the most experienced mountaineers from November through May and lists hazards by month; Backpacking Routes gives late July to mid-September",
|
||||
"sources": [
|
||||
{
|
||||
"url": "https://andrewskurka.com/adventures/sierra-high-route/logistical-considerations/",
|
||||
"publisher": "Andrew Skurka",
|
||||
"quote": "For all but the most experienced mountaineers, the SHR is probably off-limits from November through May"
|
||||
},
|
||||
{
|
||||
"url": "https://backpackingroutes.com/sierra-high-route/",
|
||||
"publisher": "Backpacking Routes",
|
||||
"quote": "The best time to hike the Sierra High Route is late July to mid-September."
|
||||
}
|
||||
]
|
||||
},
|
||||
"cohos": {
|
||||
"why": "The pages differ: The Trek gives May to October and Backpacking Routes gives June to November. It was set by judgement from both and from the climate, since snow and mud last into late May and cold sets in by late October.",
|
||||
"months_text": "The Trek 5-10; Backpacking Routes 6-11",
|
||||
"sources": [
|
||||
{
|
||||
"url": "https://thetrek.co/10-trails-can-find-long-distance-solitude-2020/",
|
||||
"publisher": "The Trek",
|
||||
"quote": "Thru-hiking season : May to October"
|
||||
},
|
||||
{
|
||||
"url": "https://backpackingroutes.com/cohos-trail/",
|
||||
"publisher": "Backpacking Routes",
|
||||
"quote": "Season : Summer , Fall"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ouachita": {
|
||||
"why": "The pages differ: one gives April to November, one gives late October to late March, and one gives all year. It was set by judgement from all three and from the climate, since summers are hot and humid with ticks and winters are cold but walkable.",
|
||||
"months_text": "The Hiking Life 4-11; Backpacking Routes 10-3; The Trek 1-12",
|
||||
"sources": [
|
||||
{
|
||||
"url": "https://thehikinglife.com/2014/07/ouachita-trail/",
|
||||
"publisher": "The Hiking Life",
|
||||
"quote": "Season : April to November."
|
||||
},
|
||||
{
|
||||
"url": "https://backpackingroutes.com/ouachita-trail/",
|
||||
"publisher": "Backpacking Routes",
|
||||
"quote": "Late October through late March is very possible, with the bulk of the hikers hitting it in November."
|
||||
},
|
||||
{
|
||||
"url": "https://thetrek.co/10-trails-can-find-long-distance-solitude-2020/",
|
||||
"publisher": "The Trek",
|
||||
"quote": "Thru-hiking season: Year-round"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ice-age": {
|
||||
"why": "The pages differ: one Trek page gives summer and fall and another gives summer only. It was set by judgement from both and from the climate, since snow and mud last through April and a hard freeze comes by November.",
|
||||
"months_text": "The Trek list 6-11; The Trek article 6-8",
|
||||
"sources": [
|
||||
{
|
||||
"url": "https://thetrek.co/a-list-of-long-distance-trails-in-the-us/",
|
||||
"publisher": "The Trek",
|
||||
"quote": "Hiking season: Summer, Fall"
|
||||
},
|
||||
{
|
||||
"url": "https://thetrek.co/the-best-time-of-year-to-hike-these-23-popular-long-trails/",
|
||||
"publisher": "The Trek",
|
||||
"quote": "The Ice Age Trail Best Time: Summer"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ozark-trail": {
|
||||
"why": "The pages differ: one Trek page gives spring or fall and another adds winter. It was set by judgement from both and from the climate, since the heat, humidity and ticks of July and August make summer a poor choice.",
|
||||
"months_text": "The Trek article 3-5 and 9-11; The Trek list 12-5 and 9-11",
|
||||
"sources": [
|
||||
{
|
||||
"url": "https://thetrek.co/the-best-time-of-year-to-hike-these-23-popular-long-trails/",
|
||||
"publisher": "The Trek",
|
||||
"quote": "Best Time: Spring or Fall"
|
||||
},
|
||||
{
|
||||
"url": "https://thetrek.co/a-list-of-long-distance-trails-in-the-us/",
|
||||
"publisher": "The Trek",
|
||||
"quote": "Hiking season: Winter, Spring, Fall"
|
||||
}
|
||||
]
|
||||
},
|
||||
"finger-lakes": {
|
||||
"why": "The pages differ: one Trek page gives winter, spring, summer and fall, and a table on the same page gives spring, summer and fall. It was set by judgement from both and from the climate, since snow lies from December to March and early spring is muddy.",
|
||||
"months_text": "The Trek trail entry 1-12; The Trek table 3-11",
|
||||
"sources": [
|
||||
{
|
||||
"url": "https://thetrek.co/a-list-of-long-distance-trails-in-the-us/",
|
||||
"publisher": "The Trek",
|
||||
"quote": "Hiking season: Winter, Spring, Summer, Fall"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,435 @@
|
||||
"""The season estimator: a pure function over monthly climate normals.
|
||||
|
||||
Python 3 standard library only, no network. tools/estimate_season.py
|
||||
finds a trail's sample points and their normals (tools/season_climate.py
|
||||
downloads them, cached outside the repository) and hands them to this
|
||||
module. See docs/superpowers/specs/2026-11-20-season-on-every-trail-design.md.
|
||||
|
||||
The method, in three parts:
|
||||
|
||||
1. Thresholds. A month is in season when the high ground (points at or
|
||||
above the upper quartile of the track's elevations) has a median mean
|
||||
daily high of at least cold_c_min, and the low ground (points at or
|
||||
below the median elevation) has one of at most heat_c_max.
|
||||
2. Comparable trails. Each trail is described by twelve monthly
|
||||
high-ground highs and twelve low-ground highs. The k most similar
|
||||
sourced trails (a season some page states) vote, each weighted by
|
||||
1 / (distance + 0.05) ** power, on every month.
|
||||
3. The blend. Each month scores mix * (share of the comparable trails'
|
||||
weight that has the month in season) + (1 - mix) * (1 if the
|
||||
thresholds pass it else 0), and the month is in season when the score
|
||||
reaches cut. The thresholds propose and the comparable trails confirm
|
||||
or add, so a desert trail inherits a cool-season pattern and an arctic
|
||||
trail a short summer from trails like it.
|
||||
|
||||
A month set is never empty: when no month reaches the cut the three
|
||||
highest scoring months are used and the result says so.
|
||||
|
||||
The measure (match, score) is the owner's: a trail's estimated season
|
||||
matches a sourced one when each end is within one month, a two-window
|
||||
season is compared window by window, and a year-round season matches
|
||||
only an estimate of ten or more months. fit_model scores the method by
|
||||
leave-one-out over the sourced trails: every trail is predicted by a
|
||||
model that never saw it, including the choice of the numbers above.
|
||||
"""
|
||||
import sys
|
||||
|
||||
sys.dont_write_bytecode = True
|
||||
|
||||
import math
|
||||
import statistics
|
||||
|
||||
import season
|
||||
|
||||
EPS = 0.05
|
||||
FALLBACK_MONTHS = 3
|
||||
GRID_COLD = list(range(-10, 26))
|
||||
GRID_HEAT = list(range(15, 46))
|
||||
GRID_K = (3, 5, 8, 12, 20)
|
||||
GRID_POWER = (1, 2)
|
||||
GRID_CUT = (0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7)
|
||||
GRID_MIX = (0.5, 0.6, 0.7, 0.8, 0.9)
|
||||
GRID_BLEND_CUT = (0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8)
|
||||
FULL = 0xFFF
|
||||
|
||||
|
||||
class Params:
|
||||
"""cold_c_min, heat_c_max (the thresholds), k and power (the comparable
|
||||
trails), mix and cut (the blend)."""
|
||||
|
||||
__slots__ = ("cold_c_min", "heat_c_max", "k", "power", "mix", "cut")
|
||||
|
||||
def __init__(self, cold_c_min, heat_c_max, k=20, power=1, mix=0.7, cut=0.65):
|
||||
self.cold_c_min = float(cold_c_min)
|
||||
self.heat_c_max = float(heat_c_max)
|
||||
self.k = int(k)
|
||||
self.power = int(power)
|
||||
self.mix = float(mix)
|
||||
self.cut = float(cut)
|
||||
|
||||
def as_dict(self):
|
||||
return {name: getattr(self, name) for name in self.__slots__}
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, doc):
|
||||
return cls(**{name: doc[name] for name in cls.__slots__})
|
||||
|
||||
def __eq__(self, other):
|
||||
return isinstance(other, Params) and self.as_dict() == other.as_dict()
|
||||
|
||||
def __repr__(self):
|
||||
return "Params(%s)" % ", ".join(f"{k}={v!r}" for k, v in self.as_dict().items())
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Months as 12-bit masks (bit 0 is January) inside; lists of 1..12 outside.
|
||||
|
||||
def to_mask(months):
|
||||
mask = 0
|
||||
for m in months:
|
||||
mask |= 1 << (int(m) - 1)
|
||||
return mask
|
||||
|
||||
|
||||
def to_months(mask):
|
||||
return [m + 1 for m in range(12) if mask >> m & 1]
|
||||
|
||||
|
||||
def _runs(mask):
|
||||
"""Circular runs of months as (first, last) pairs; December to
|
||||
January joins into one run."""
|
||||
runs = []
|
||||
for m in to_months(mask):
|
||||
if runs and m == runs[-1][1] + 1:
|
||||
runs[-1][1] = m
|
||||
else:
|
||||
runs.append([m, m])
|
||||
if len(runs) > 1 and runs[0][0] == 1 and runs[-1][1] == 12:
|
||||
runs[0][0] = runs.pop()[0]
|
||||
return [tuple(r) for r in runs]
|
||||
|
||||
|
||||
def _near(a, b):
|
||||
d = abs(a - b)
|
||||
return min(d, 12 - d) <= 1
|
||||
|
||||
|
||||
def match(estimated, sourced):
|
||||
"""The owner's measure, on month lists or masks. A sourced season of
|
||||
eleven or twelve months matches an estimate of ten or more. A sourced
|
||||
season in two or more windows matches when every window has an
|
||||
estimated window within a month at both ends and the estimate has no
|
||||
window of its own left over. Any other sourced season matches when
|
||||
the estimate's span (season.span) is within a month at each end."""
|
||||
est = estimated if isinstance(estimated, int) else to_mask(estimated)
|
||||
src = sourced if isinstance(sourced, int) else to_mask(sourced)
|
||||
if not est or not src:
|
||||
return False
|
||||
if bin(src).count("1") >= 11:
|
||||
return bin(est).count("1") >= 10
|
||||
src_runs = _runs(src)
|
||||
if len(src_runs) >= 2:
|
||||
est_runs = _runs(est)
|
||||
return (all(any(_near(a, c) and _near(b, d) for c, d in est_runs)
|
||||
for a, b in src_runs)
|
||||
and all(any(_near(a, c) and _near(b, d) for c, d in src_runs)
|
||||
for a, b in est_runs))
|
||||
return season.grade(to_months(est), to_months(src)) != "worse"
|
||||
|
||||
|
||||
def score(estimated, sourced):
|
||||
"""(match 1 or 0, share of the twelve months classified correctly,
|
||||
Jaccard overlap of the month sets)."""
|
||||
est = estimated if isinstance(estimated, int) else to_mask(estimated)
|
||||
src = sourced if isinstance(sourced, int) else to_mask(sourced)
|
||||
union = bin(est | src).count("1")
|
||||
return (1.0 if match(est, src) else 0.0,
|
||||
bin(~(est ^ src) & FULL).count("1") / 12,
|
||||
bin(est & src).count("1") / union if union else 0.0)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Climate summary of a trail.
|
||||
|
||||
def usable(points):
|
||||
"""The points as a list, or None when any point lacks data. A trail
|
||||
with a gap in its climate data is unestimable, never filled in."""
|
||||
if not points:
|
||||
return None
|
||||
got = list(points)
|
||||
for point in got:
|
||||
if point is None or len(getattr(point, "tmax_c", ()) or ()) != 12:
|
||||
return None
|
||||
return got
|
||||
|
||||
|
||||
def high_low(points):
|
||||
"""Split points into high ground (at or above the upper quartile of
|
||||
the elevations, at least one point) and low ground (at or below
|
||||
the median). A single point is both."""
|
||||
elevs = sorted(p.elev_m for p in points)
|
||||
if len(elevs) == 1:
|
||||
return points, points
|
||||
upper = statistics.quantiles(elevs, n=4, method="inclusive")[2]
|
||||
median = statistics.median(elevs)
|
||||
high = [p for p in points if p.elev_m >= upper]
|
||||
low = [p for p in points if p.elev_m <= median]
|
||||
if not high:
|
||||
high = [max(points, key=lambda p: p.elev_m)]
|
||||
if not low:
|
||||
low = [min(points, key=lambda p: p.elev_m)]
|
||||
return high, low
|
||||
|
||||
|
||||
def medians(points):
|
||||
"""(high-ground, low-ground): each twelve median mean daily highs
|
||||
rounded to a tenth. None when a point lacks data."""
|
||||
got = usable(points)
|
||||
if got is None:
|
||||
return None
|
||||
high, low = high_low(got)
|
||||
|
||||
def med(group):
|
||||
return tuple(round(statistics.median(p.tmax_c[m] for p in group), 1)
|
||||
for m in range(12))
|
||||
return med(high), med(low)
|
||||
|
||||
|
||||
def threshold_mask(med, params):
|
||||
high, low = med
|
||||
mask = 0
|
||||
for m in range(12):
|
||||
if high[m] >= params.cold_c_min and low[m] <= params.heat_c_max:
|
||||
mask |= 1 << m
|
||||
return mask
|
||||
|
||||
|
||||
def _margins(med, params):
|
||||
high, low = med
|
||||
return [min(high[m] - params.cold_c_min, params.heat_c_max - low[m])
|
||||
for m in range(12)]
|
||||
|
||||
|
||||
def _top(scores, n=FALLBACK_MONTHS):
|
||||
order = sorted(range(12), key=lambda m: (-scores[m], m))[:n]
|
||||
return sum(1 << m for m in order)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Comparable trails.
|
||||
|
||||
class Reference:
|
||||
"""A sourced trail the estimate may compare with."""
|
||||
|
||||
__slots__ = ("id", "med", "mask")
|
||||
|
||||
def __init__(self, tid, med, months):
|
||||
self.id = tid
|
||||
self.med = med
|
||||
self.mask = to_mask(months)
|
||||
|
||||
|
||||
def distance(a, b):
|
||||
"""Root mean square difference, in tens of degrees, over the
|
||||
twenty-four high-ground and low-ground monthly highs."""
|
||||
total = 0.0
|
||||
for ga, gb in zip(a, b):
|
||||
for m in range(12):
|
||||
total += ((ga[m] - gb[m]) / 10) ** 2
|
||||
return math.sqrt(total / 24)
|
||||
|
||||
|
||||
def nearest(med, refs, k, exclude=None):
|
||||
"""The k closest references as (distance, reference), nearest first,
|
||||
leaving out the reference whose id is exclude."""
|
||||
found = sorted(((distance(med, r.med), r.id, r) for r in refs
|
||||
if r.id != exclude))
|
||||
return [(d, r) for d, _id, r in found[:k]]
|
||||
|
||||
|
||||
def vote(near, power):
|
||||
"""Weighted share of the comparable trails that have each month."""
|
||||
total = 0.0
|
||||
acc = [0.0] * 12
|
||||
for d, r in near:
|
||||
w = 1.0 / (d + EPS) ** power
|
||||
total += w
|
||||
for m in range(12):
|
||||
if r.mask >> m & 1:
|
||||
acc[m] += w
|
||||
return [a / total for a in acc] if total else [0.0] * 12
|
||||
|
||||
|
||||
def blend(med, near, params):
|
||||
"""(mask, scores, fell_back). Without comparable trails the
|
||||
thresholds stand alone."""
|
||||
thr = threshold_mask(med, params)
|
||||
if not near:
|
||||
if thr:
|
||||
return thr, [float(thr >> m & 1) for m in range(12)], False
|
||||
margins = _margins(med, params)
|
||||
return _top(margins), margins, True
|
||||
votes = vote(near, params.power)
|
||||
scores = [params.mix * votes[m] + (1 - params.mix) * (thr >> m & 1)
|
||||
for m in range(12)]
|
||||
mask = sum(1 << m for m in range(12) if scores[m] >= params.cut)
|
||||
if mask:
|
||||
return mask, scores, False
|
||||
return _top(scores), scores, True
|
||||
|
||||
|
||||
def months_in_season(points, params, refs=(), exclude=None):
|
||||
"""Sorted month numbers in season, or None when some point has no
|
||||
data. Never an empty list."""
|
||||
med = medians(points)
|
||||
if med is None:
|
||||
return None
|
||||
near = nearest(med, list(refs), params.k, exclude) if refs else []
|
||||
return to_months(blend(med, near, params)[0])
|
||||
|
||||
|
||||
def confidence(med, near, scores, fell_back, close=0.12, decisive=0.7):
|
||||
"""("high" or "low", reason). High when the comparable trails are
|
||||
close (mean distance at most `close`) and agree (at least `decisive`
|
||||
of the twelve months have a weighted vote of 0.2 or less or 0.8 or
|
||||
more) and the empty-set fallback was not needed. These two numbers
|
||||
were chosen from the leave-one-out predictions: see
|
||||
tools/season_fit.json, confidence."""
|
||||
if not near:
|
||||
return "low", "no comparable trails"
|
||||
mean_d = sum(d for d, _ in near) / len(near)
|
||||
shares = vote(near, 1)
|
||||
sure = sum(1 for s in shares if s <= 0.2 or s >= 0.8) / 12
|
||||
if fell_back:
|
||||
return "low", "no month reached the cut"
|
||||
if mean_d > close:
|
||||
return "low", f"comparable trails are far (mean distance {mean_d:.2f})"
|
||||
if sure < decisive:
|
||||
return "low", f"comparable trails disagree ({sure:.0%} of months settled)"
|
||||
return "high", f"comparable trails are close ({mean_d:.2f}) and agree"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Fitting by leave-one-out.
|
||||
|
||||
def _obj(s):
|
||||
return s[0] + 1e-3 * s[2]
|
||||
|
||||
|
||||
def fit_model(trails, params_grid=None):
|
||||
"""Fit the method on sourced trails and score it leave-one-out.
|
||||
|
||||
trails: list of (id, medians, sourced months). Returns (params,
|
||||
loo) where params is fitted on all of them and loo maps id to
|
||||
(estimated mask, score) from a model that never saw that trail.
|
||||
Each of the three parts is chosen by the same objective (matches,
|
||||
then Jaccard overlap): thresholds over the cold and heat grids,
|
||||
comparable trails over k, power and a month cut (nested: when
|
||||
trail i is held out, every other trail's score is recomputed
|
||||
without i among its neighbours), and the blend over mix and cut
|
||||
from the other trails' leave-one-out predictions."""
|
||||
ids = [t[0] for t in trails]
|
||||
index = {tid: n for n, tid in enumerate(ids)}
|
||||
meds = [t[1] for t in trails]
|
||||
truth = [to_mask(t[2]) for t in trails]
|
||||
n = len(trails)
|
||||
|
||||
# -- thresholds
|
||||
combos = [(c, h) for c in GRID_COLD for h in GRID_HEAT]
|
||||
thr_masks, thr_obj = [], []
|
||||
for c, h in combos:
|
||||
p = Params(c, h)
|
||||
row = []
|
||||
for j in range(n):
|
||||
mk = threshold_mask(meds[j], p) or _top(_margins(meds[j], p))
|
||||
row.append(mk)
|
||||
thr_masks.append(row)
|
||||
thr_obj.append([_obj(score(row[j], truth[j])) for j in range(n)])
|
||||
totals = [sum(row) for row in thr_obj]
|
||||
full_t = max(range(len(combos)), key=lambda ci: totals[ci])
|
||||
thr_loo = []
|
||||
for i in range(n):
|
||||
ci = max(range(len(combos)), key=lambda ci: totals[ci] - thr_obj[ci][i])
|
||||
thr_loo.append(thr_masks[ci][i])
|
||||
|
||||
# -- comparable trails
|
||||
refs = [Reference(ids[j], meds[j], t[2]) for j, t in enumerate(trails)]
|
||||
order = [sorted(((distance(meds[j], meds[r]), r) for r in range(n) if r != j))
|
||||
for j in range(n)]
|
||||
pos = [{r: p for p, (_d, r) in enumerate(order[j])} for j in range(n)]
|
||||
bits = [[(truth[r] >> m) & 1 for m in range(12)] for r in range(n)]
|
||||
|
||||
def shares(j, k, power, skip=None):
|
||||
total, acc, got = 0.0, [0.0] * 12, 0
|
||||
for d, r in order[j]:
|
||||
if r == skip:
|
||||
continue
|
||||
w = 1.0 / (d + EPS) ** power
|
||||
total += w
|
||||
for m in range(12):
|
||||
if bits[r][m]:
|
||||
acc[m] += w
|
||||
got += 1
|
||||
if got == k:
|
||||
break
|
||||
return [a / total for a in acc] if total else [0.0] * 12
|
||||
|
||||
def mask_of(v, cut):
|
||||
mk = sum(1 << m for m in range(12) if v[m] >= cut)
|
||||
return mk or _top(v)
|
||||
|
||||
knn = [(k, p, c) for k in GRID_K for p in GRID_POWER for c in GRID_CUT]
|
||||
base = {}
|
||||
for k in GRID_K:
|
||||
for p in GRID_POWER:
|
||||
for j in range(n):
|
||||
v = shares(j, k, p)
|
||||
base[k, p, j] = [_obj(score(mask_of(v, c), truth[j])) for c in GRID_CUT]
|
||||
knn_totals = {}
|
||||
for k in GRID_K:
|
||||
for p in GRID_POWER:
|
||||
for ci, c in enumerate(GRID_CUT):
|
||||
knn_totals[k, p, ci] = sum(base[k, p, j][ci] for j in range(n))
|
||||
full_k = max(knn_totals, key=lambda key: knn_totals[key])
|
||||
knn_choice = []
|
||||
for i in range(n):
|
||||
best, best_total = None, None
|
||||
for k in GRID_K:
|
||||
for p in GRID_POWER:
|
||||
row = [knn_totals[k, p, ci] - base[k, p, i][ci]
|
||||
for ci in range(len(GRID_CUT))]
|
||||
# trails that had i among their k neighbours are rescored without it
|
||||
for j in range(n):
|
||||
if j != i and pos[j][i] < k:
|
||||
v = shares(j, k, p, skip=i)
|
||||
for ci, c in enumerate(GRID_CUT):
|
||||
row[ci] += (_obj(score(mask_of(v, c), truth[j]))
|
||||
- base[k, p, j][ci])
|
||||
for ci in range(len(GRID_CUT)):
|
||||
if best_total is None or row[ci] > best_total:
|
||||
best, best_total = (k, p, ci), row[ci]
|
||||
knn_choice.append(best)
|
||||
knn_votes = [shares(i, knn_choice[i][0], knn_choice[i][1]) for i in range(n)]
|
||||
|
||||
# -- the blend
|
||||
blends = [(mix, cut) for mix in GRID_MIX for cut in GRID_BLEND_CUT]
|
||||
b_masks, b_obj = [], []
|
||||
for mix, cut in blends:
|
||||
row = []
|
||||
for j in range(n):
|
||||
v = [mix * knn_votes[j][m] + (1 - mix) * (thr_loo[j] >> m & 1)
|
||||
for m in range(12)]
|
||||
row.append(mask_of(v, cut))
|
||||
b_masks.append(row)
|
||||
b_obj.append([_obj(score(row[j], truth[j])) for j in range(n)])
|
||||
b_totals = [sum(row) for row in b_obj]
|
||||
full_b = max(range(len(blends)), key=lambda bi: b_totals[bi])
|
||||
loo = {}
|
||||
for i in range(n):
|
||||
bi = max(range(len(blends)), key=lambda bi: b_totals[bi] - b_obj[bi][i])
|
||||
mk = b_masks[bi][i]
|
||||
loo[ids[i]] = (mk, score(mk, truth[i]))
|
||||
cold, heat = combos[full_t]
|
||||
k, p, _ci = full_k
|
||||
mix, cut = blends[full_b]
|
||||
return Params(cold, heat, k, p, mix, cut), loo
|
||||
@@ -0,0 +1,512 @@
|
||||
"""Tests for tools/estimate_season.py. The rule tests use hand-made
|
||||
normals, so they run with no network.
|
||||
|
||||
Run from the repository root:
|
||||
python3 -m unittest discover tools/tests
|
||||
"""
|
||||
import csv
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
sys.dont_write_bytecode = True
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
import estimate_season as E # noqa: E402
|
||||
import test_refresh as TR # noqa: E402
|
||||
import season_climate as C # noqa: E402
|
||||
|
||||
PARAMS = E.Params(cold_c_min=5.0, heat_c_max=32.0)
|
||||
|
||||
|
||||
def normals(elev, tmax, snow=None):
|
||||
return C.PointNormals(lat=45.0, lon=-110.0, elev_m=float(elev),
|
||||
tmax_c=tuple(float(v) for v in tmax),
|
||||
snow_cm=None if snow is None
|
||||
else tuple(float(v) for v in snow))
|
||||
|
||||
|
||||
class RuleTest(unittest.TestCase):
|
||||
"""The thresholds on their own: with no sourced trails to compare
|
||||
with, the model is the cold and heat limits."""
|
||||
|
||||
def test_a_cold_high_point_closes_the_winter(self):
|
||||
point = normals(3000, [0, 1, 3, 6, 10, 15, 20, 20, 15, 10, 4, 1])
|
||||
self.assertEqual(E.months_in_season([point], PARAMS),
|
||||
[4, 5, 6, 7, 8, 9, 10])
|
||||
|
||||
def test_heat_at_the_low_ground_closes_a_summer_month(self):
|
||||
desert = normals(400, [19, 22, 26, 31, 36, 42, 44, 43, 39, 32, 24, 19])
|
||||
self.assertEqual(E.months_in_season([desert], PARAMS),
|
||||
[1, 2, 3, 4, 10, 11, 12])
|
||||
|
||||
def test_high_ground_is_the_upper_quartile_of_points(self):
|
||||
low = [normals(e, [15] * 12) for e in (100, 200, 300)]
|
||||
high = normals(400, [15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15])
|
||||
got = E.months_in_season(low + [high], PARAMS)
|
||||
self.assertNotIn(6, got) # only the highest point is cold in June
|
||||
self.assertEqual(len(got), 11)
|
||||
|
||||
def test_a_wrapped_season_is_returned_sorted(self):
|
||||
point = normals(400, [15, 15, 15, 15, 15, 40, 40, 40, 40, 40, 15, 15])
|
||||
self.assertEqual(E.months_in_season([point], PARAMS),
|
||||
[1, 2, 3, 4, 5, 11, 12])
|
||||
|
||||
def test_a_trail_that_never_qualifies_still_gets_three_months(self):
|
||||
arctic = normals(500, [-5, -4, -2, 0, 3, 4, 4, 3, 1, -1, -3, -5])
|
||||
got = E.months_in_season([arctic], PARAMS)
|
||||
self.assertEqual(got, [5, 6, 7]) # the three nearest the cold limit
|
||||
|
||||
def test_all_twelve_months_is_allowed(self):
|
||||
coast = normals(20, [15] * 12)
|
||||
self.assertEqual(E.months_in_season([coast], PARAMS), list(range(1, 13)))
|
||||
|
||||
def test_a_point_with_missing_data_makes_the_trail_unestimable(self):
|
||||
point = normals(20, [15] * 12)
|
||||
self.assertIsNone(E.months_in_season([point, None], PARAMS))
|
||||
self.assertIsNone(E.months_in_season([], PARAMS))
|
||||
|
||||
|
||||
class SamplePointsTest(unittest.TestCase):
|
||||
def make_root(self, td, parts=None, profile=None, multi=False):
|
||||
import json
|
||||
import tempfile # noqa: F401 (td is made by the caller)
|
||||
d = os.path.join(td, "trail-x")
|
||||
os.makedirs(os.path.join(td, "web"))
|
||||
os.makedirs(d)
|
||||
with open(os.path.join(td, "web", "place-bounds.toml"), "w") as f:
|
||||
f.write('[box]\n"US-VT" = [-73.5, 42.7, -71.5, 45.0]\n')
|
||||
if parts is not None:
|
||||
if multi:
|
||||
geom = {"type": "MultiLineString", "coordinates": parts}
|
||||
else:
|
||||
geom = {"type": "LineString", "coordinates": parts[0]}
|
||||
doc = {"type": "FeatureCollection",
|
||||
"features": [{"type": "Feature", "geometry": geom}]}
|
||||
with open(os.path.join(d, "line.geojson"), "w") as f:
|
||||
json.dump(doc, f)
|
||||
if profile is not None:
|
||||
with open(os.path.join(d, "elevation.json"), "w") as f:
|
||||
json.dump({"profile": profile}, f)
|
||||
return td
|
||||
|
||||
@staticmethod
|
||||
def meridian(lat0, lat1, step=0.1, lon=-110.0):
|
||||
n = int(round((lat1 - lat0) / step))
|
||||
return [[lon, lat0 + i * step] for i in range(n + 1)]
|
||||
|
||||
def rec(self, **hike):
|
||||
base = {"summary": "x", "checked": "2026-01-01", "source": []}
|
||||
base.update(hike)
|
||||
return {"id": "trail-x", "country": "US", "regions": ["VT"],
|
||||
"source": {"line_file": "line.geojson"}, "hike": base}
|
||||
|
||||
def test_a_track_gives_points_spaced_along_it(self):
|
||||
import tempfile
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
root = self.make_root(td, parts=[self.meridian(43.0, 44.8)],
|
||||
profile=[[0, 1000], [200, 1000]])
|
||||
points, kind = E.sample_points(root, self.rec())
|
||||
self.assertEqual(kind, "track")
|
||||
self.assertEqual(len(points), 5) # about 200 km, one per 50 km
|
||||
self.assertEqual(points[0].km, 0.0)
|
||||
self.assertAlmostEqual(points[0].lat, 43.0, places=3)
|
||||
self.assertLess(abs(points[-1].km - 200.15), 50)
|
||||
self.assertAlmostEqual(points[-1].lat, 44.8, places=3)
|
||||
|
||||
def test_a_short_track_still_gets_three_points(self):
|
||||
import tempfile
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
root = self.make_root(td, parts=[self.meridian(43.0, 43.09, 0.03)],
|
||||
profile=[[0, 500], [10, 500]])
|
||||
points, kind = E.sample_points(root, self.rec())
|
||||
self.assertEqual(len(points), 3)
|
||||
|
||||
def test_a_very_long_track_is_capped_at_twelve(self):
|
||||
import tempfile
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
root = self.make_root(td, parts=[self.meridian(35.0, 45.0, 0.5)],
|
||||
profile=[[0, 500], [1112, 500]])
|
||||
points, kind = E.sample_points(root, self.rec())
|
||||
self.assertEqual(len(points), 12)
|
||||
|
||||
def test_a_multipart_track_is_sampled_along_all_parts(self):
|
||||
import tempfile
|
||||
parts = [self.meridian(43.0, 43.9), self.meridian(44.1, 45.0)]
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
root = self.make_root(td, parts=parts, multi=True,
|
||||
profile=[[0, 500], [200, 500]])
|
||||
points, kind = E.sample_points(root, self.rec())
|
||||
self.assertEqual(kind, "track")
|
||||
self.assertTrue(any(p.lat > 44.1 for p in points))
|
||||
self.assertTrue(any(p.lat < 43.9 for p in points))
|
||||
|
||||
def test_elevation_comes_from_the_profile_by_distance(self):
|
||||
import tempfile
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
root = self.make_root(td, parts=[self.meridian(43.0, 44.8)],
|
||||
profile=[[0, 1000], [100, 2000], [200, 1500]])
|
||||
points, kind = E.sample_points(root, self.rec())
|
||||
middle = points[len(points) // 2]
|
||||
self.assertLess(abs(middle.elev_m - 2000), 30)
|
||||
self.assertLess(abs(points[0].elev_m - 1000), 30)
|
||||
|
||||
def test_a_track_without_a_profile_uses_the_high_point_for_the_top_only(self):
|
||||
import tempfile
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
root = self.make_root(td, parts=[self.meridian(43.0, 44.8)])
|
||||
points, kind = E.sample_points(root, self.rec(high_point_m=3000))
|
||||
elevs = [p.elev_m for p in points]
|
||||
self.assertEqual(elevs.count(3000), 1)
|
||||
self.assertEqual(elevs.count(None), len(elevs) - 1)
|
||||
|
||||
def test_no_track_uses_the_two_ends(self):
|
||||
import tempfile
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
root = self.make_root(td)
|
||||
points, kind = E.sample_points(
|
||||
root, self.rec(start_lonlat=[-110.0, 43.0],
|
||||
end_lonlat=[-109.0, 44.0]))
|
||||
self.assertEqual(kind, "ends")
|
||||
self.assertEqual(len(points), 2)
|
||||
self.assertEqual((points[0].lat, points[0].lon), (43.0, -110.0))
|
||||
self.assertEqual((points[1].lat, points[1].lon), (44.0, -109.0))
|
||||
|
||||
def test_no_track_and_no_ends_uses_the_place_centre(self):
|
||||
import tempfile
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
root = self.make_root(td)
|
||||
points, kind = E.sample_points(root, self.rec())
|
||||
self.assertEqual(kind, "place")
|
||||
self.assertEqual(len(points), 1)
|
||||
self.assertTrue(-73.5 <= points[0].lon <= -71.5)
|
||||
self.assertTrue(42.7 <= points[0].lat <= 45.0)
|
||||
self.assertAlmostEqual(points[0].lon, -72.5)
|
||||
self.assertAlmostEqual(points[0].lat, 43.85)
|
||||
|
||||
|
||||
class ReportTest(unittest.TestCase):
|
||||
def loo(self, **kw):
|
||||
"""loo entries (mask, (match, classified, jaccard)) by id."""
|
||||
return {tid: (0, v) for tid, v in kw.items()}
|
||||
|
||||
def test_report_counts_matches_and_no_data(self):
|
||||
med = ((15.0,) * 12, (15.0,) * 12)
|
||||
sourced = [("a", med, [7, 8], "g"), ("b", med, [7, 8], "g"),
|
||||
("c", None, [6, 7, 8], "h")]
|
||||
loo = self.loo(a=(1.0, 1.0, 1.0), b=(0.0, 0.5, 0.25))
|
||||
rep = E.report(sourced, loo)
|
||||
self.assertEqual((rep["n"], rep["within1"], rep["worse"], rep["no_data"]),
|
||||
(3, 1, 1, 1))
|
||||
self.assertEqual(rep["within1"] + rep["worse"] + rep["no_data"], rep["n"])
|
||||
self.assertEqual(rep["classified"], 0.75)
|
||||
self.assertEqual(rep["jaccard"], 0.625)
|
||||
self.assertEqual(rep["by_group"]["g"]["within1"], 1)
|
||||
self.assertEqual(rep["by_group"]["h"]["no_data"], 1)
|
||||
|
||||
def test_passes_is_false_below_the_bar_and_true_at_it(self):
|
||||
def rep(within1, no_data=0, n=100):
|
||||
return {"n": n, "within1": within1,
|
||||
"worse": n - within1 - no_data, "no_data": no_data}
|
||||
self.assertFalse(E.passes_bar(rep(74)))
|
||||
self.assertTrue(E.passes_bar(rep(75)))
|
||||
self.assertFalse(E.passes_bar(rep(90, no_data=11))) # coverage 89%
|
||||
|
||||
def test_the_report_splits_by_kind(self):
|
||||
med = ((20.0,) * 12, (20.0,) * 12)
|
||||
sourced = [("a", med, list(range(1, 13)), "x")]
|
||||
rep = E.report(sourced, self.loo(a=(1.0, 1.0, 1.0)))
|
||||
self.assertEqual(rep["by_kind"]["year-round"]["n"], 1)
|
||||
self.assertEqual(rep["by_kind"]["year-round"]["within1"], 1)
|
||||
self.assertEqual(rep["by_kind"]["alpine"]["n"], 0)
|
||||
|
||||
def test_the_same_input_gives_the_same_fit_twice(self):
|
||||
med = lambda v: (tuple([v] * 12), tuple([v] * 12))
|
||||
sourced = [(f"t{i}", med(10.0 + i), [5, 6, 7, 8], "g") for i in range(6)]
|
||||
first = E.fit_sourced(sourced)
|
||||
second = E.fit_sourced(sourced)
|
||||
self.assertEqual(first[0], second[0])
|
||||
self.assertEqual(first[1], second[1])
|
||||
|
||||
|
||||
def mild_fetch(lat, lon, elev):
|
||||
return C.PointNormals(lat=float(lat), lon=float(lon),
|
||||
elev_m=float(elev if elev is not None else 100.0),
|
||||
tmax_c=tuple([15.0] * 12))
|
||||
|
||||
|
||||
def warm_with_latitude(lat, lon, elev):
|
||||
"""Warmer to the south: five degrees a degree of latitude."""
|
||||
return C.PointNormals(lat=float(lat), lon=float(lon),
|
||||
elev_m=float(elev if elev is not None else 100.0),
|
||||
tmax_c=tuple([15.0 + 5.0 * (43.0 - float(lat))] * 12))
|
||||
|
||||
|
||||
def none_fetch(lat, lon, elev):
|
||||
return None
|
||||
|
||||
|
||||
def bounds_root(td):
|
||||
os.makedirs(os.path.join(td, "web"))
|
||||
with open(os.path.join(td, "web", "place-bounds.toml"), "w") as f:
|
||||
f.write('[box]\n"US-VT" = [-73.5, 42.7, -71.5, 45.0]\n')
|
||||
return td
|
||||
|
||||
|
||||
def ends_rec(tid="trail-x", lat=43.0, extra=None):
|
||||
hike = {"summary": "x", "checked": "2026-01-01", "source": [],
|
||||
"start_lonlat": [-110.0, lat], "end_lonlat": [-109.0, lat + 1.0]}
|
||||
hike.update(extra or {})
|
||||
return {"id": tid, "country": "US", "regions": ["VT"],
|
||||
"source": {"line_file": "line.geojson"}, "hike": hike}
|
||||
|
||||
|
||||
class EstimateTest(unittest.TestCase):
|
||||
def test_a_no_track_record_is_flagged(self):
|
||||
import tempfile
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
est = E.estimate(bounds_root(td), ends_rec(), PARAMS, fetch=mild_fetch)
|
||||
self.assertIn("no-track", est["flags"])
|
||||
self.assertEqual(est["months"], list(range(1, 13)))
|
||||
self.assertEqual(est["phrase"], "All year")
|
||||
|
||||
def test_a_trail_with_no_data_is_listed_not_estimated(self):
|
||||
import tempfile
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
est = E.estimate(bounds_root(td), ends_rec(), PARAMS, fetch=none_fetch)
|
||||
self.assertIsNone(est["months"])
|
||||
self.assertIn("no-data", est["flags"])
|
||||
self.assertIn("no data", est["reason"])
|
||||
|
||||
def test_flags_include_far_north_above_sixty_degrees(self):
|
||||
import tempfile
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
est = E.estimate(bounds_root(td), ends_rec(lat=61.0), PARAMS,
|
||||
fetch=mild_fetch)
|
||||
self.assertIn("far-north", est["flags"])
|
||||
|
||||
def test_nothing_in_estimate_touches_the_network_without_a_fetch(self):
|
||||
import tempfile
|
||||
|
||||
def raising(lat, lon, elev):
|
||||
raise AssertionError("network touched")
|
||||
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
with self.assertRaises(AssertionError):
|
||||
E.estimate(bounds_root(td), ends_rec(), PARAMS, fetch=raising)
|
||||
|
||||
def test_comparable_trails_are_listed_nearest_first(self):
|
||||
import tempfile, shutil
|
||||
tmp = tempfile.mkdtemp()
|
||||
self.addCleanup(shutil.rmtree, tmp, True)
|
||||
root = TR.make_repo(tmp, trails=[
|
||||
("near-one", "Near", {"extra_hike":
|
||||
'season = "June to September"\nmonths = [6, 7, 8, 9]\n'
|
||||
'season_basis = "source"\n'
|
||||
'start_lonlat = [-110.0, 43.1]\nend_lonlat = [-110.0, 43.3]\n'}),
|
||||
("far-one", "Far", {"extra_hike":
|
||||
'season = "July to August"\nmonths = [7, 8]\n'
|
||||
'season_basis = "source"\n'
|
||||
'start_lonlat = [-100.0, 35.0]\nend_lonlat = [-100.0, 35.2]\n'}),
|
||||
("target-one", "Target", {"extra_hike":
|
||||
'start_lonlat = [-110.0, 43.0]\nend_lonlat = [-110.0, 43.2]\n'}),
|
||||
])
|
||||
os.makedirs(os.path.join(root, "web"))
|
||||
with open(os.path.join(root, "web", "place-bounds.toml"), "w") as f:
|
||||
f.write('[box]\n"US-VT" = [-73.5, 42.7, -71.5, 45.0]\n')
|
||||
import refresh as R
|
||||
rec = R.load_toml(os.path.join(root, "target-one", "trail.toml"))
|
||||
# fixture records claim line_file "" so sampling uses the ends
|
||||
rec["source"]["line_file"] = "line.geojson"
|
||||
est = E.estimate(root, rec, PARAMS, fetch=warm_with_latitude)
|
||||
self.assertEqual(est["comparable"], "near-one")
|
||||
self.assertEqual(est["comparable_phrase"], "June to September")
|
||||
self.assertEqual([n[0] for n in est["neighbours"]],
|
||||
["near-one", "far-one"])
|
||||
self.assertEqual(est["confidence"], "low") # the location is a fallback
|
||||
|
||||
|
||||
class ProposeCheckTest(unittest.TestCase):
|
||||
def fit_doc(self, root, passes=True, within1=3, n=4):
|
||||
os.makedirs(os.path.join(root, "tools"), exist_ok=True)
|
||||
doc = {"computed": "2026-11-20", "rule_version": E.RULE_VERSION,
|
||||
"dataset": "test", "period": "2011-2020",
|
||||
"params": E.Params(5.0, 32.0).as_dict(),
|
||||
"loo": {"n": n, "within1": within1, "worse": n - within1,
|
||||
"no_data": 0, "classified": 0.8, "jaccard": 0.6,
|
||||
"by_group": {}, "by_kind": {}},
|
||||
"confidence": None, "bar": E.BAR, "passes": passes}
|
||||
with open(os.path.join(root, "tools", "season_fit.json"), "w") as f:
|
||||
json.dump(doc, f)
|
||||
|
||||
def repo_with(self, tmp, trails):
|
||||
root = TR.make_repo(tmp, trails=trails)
|
||||
os.makedirs(os.path.join(root, "web"))
|
||||
with open(os.path.join(root, "web", "place-bounds.toml"), "w") as f:
|
||||
f.write('[box]\n"US-VT" = [-73.5, 42.7, -71.5, 45.0]\n')
|
||||
# fixture records name no track file; point them at the default
|
||||
for tid, _name, _kw in trails:
|
||||
path = os.path.join(root, tid, "trail.toml")
|
||||
text = TR.read(root, f"{tid}/trail.toml").replace(
|
||||
'line_file = ""', 'line_file = "line.geojson"')
|
||||
TR.write(path, text)
|
||||
return root
|
||||
|
||||
ENDS = 'start_lonlat = [-110.0, 43.0]\nend_lonlat = [-110.0, 43.2]\n'
|
||||
|
||||
def test_propose_writes_one_row_per_unsourced_trail(self):
|
||||
import tempfile, shutil, csv
|
||||
tmp = tempfile.mkdtemp()
|
||||
self.addCleanup(shutil.rmtree, tmp, True)
|
||||
root = self.repo_with(tmp, [
|
||||
("aaa", "Aaa", {"extra_hike": self.ENDS}),
|
||||
("bbb", "Bbb", {"extra_hike":
|
||||
'season = "June to September"\nmonths = [6, 7, 8, 9]\n'
|
||||
'season_basis = "source"\n' + self.ENDS}),
|
||||
("ccc", "Ccc", {"hike": False}),
|
||||
])
|
||||
stage = os.path.join(tmp, "stage")
|
||||
n = E.propose(root, PARAMS, mild_fetch, stage)
|
||||
self.assertEqual(n, 2) # aaa and ccc have no season
|
||||
with open(os.path.join(stage, "season", "estimates.csv"),
|
||||
newline="") as f:
|
||||
rows = list(csv.DictReader(f))
|
||||
self.assertEqual([r["id"] for r in rows], ["aaa", "ccc"])
|
||||
# the one sourced trail has the same climate, so its June to
|
||||
# September carries the estimate
|
||||
self.assertEqual(rows[0]["phrase"], "June to September")
|
||||
|
||||
def est_repo(self, tmp, months_extra):
|
||||
return self.repo_with(tmp, [
|
||||
("aaa", "Aaa", {"extra_hike": months_extra + self.ENDS}),
|
||||
])
|
||||
|
||||
EST = ('season = "All year"\n'
|
||||
'months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\n'
|
||||
'season_basis = "estimate"\n'
|
||||
'season_method = "Judged from climate. Confidence: low."\n')
|
||||
|
||||
def blind_doc(self, root, share=0.77, tested=100):
|
||||
matched = int(round(share * tested))
|
||||
doc = {"date": "2026-11-20", "tested": tested, "matched": matched,
|
||||
"share": round(matched / tested, 2),
|
||||
"by_confidence": {
|
||||
"high": {"tested": tested, "matched": matched,
|
||||
"share": round(matched / tested, 2)},
|
||||
"medium": {"tested": 0, "matched": 0, "share": 0.0},
|
||||
"low": {"tested": 0, "matched": 0, "share": 0.0}}}
|
||||
with open(os.path.join(root, "tools", "season_blind_test.json"), "w") as f:
|
||||
json.dump(doc, f)
|
||||
|
||||
def record_inputs(self, root, tid="aaa", **change):
|
||||
params = E.load_params(root)
|
||||
rec = E.refresh.load_toml(os.path.join(root, tid, "trail.toml"))
|
||||
sig = E.inputs_signature(E.estimate(root, dict(rec, id=tid), params, mild_fetch,
|
||||
E.references(root, mild_fetch)))
|
||||
sig.update(change)
|
||||
with open(os.path.join(root, "tools", "season_inputs.json"), "w") as f:
|
||||
json.dump({tid: sig}, f)
|
||||
|
||||
def checked_repo(self, tmp, **kw):
|
||||
root = self.est_repo(tmp, self.EST)
|
||||
self.fit_doc(root)
|
||||
self.blind_doc(root, **kw)
|
||||
return root
|
||||
|
||||
def test_check_passes_when_nothing_changed(self):
|
||||
tmp = tempfile.mkdtemp()
|
||||
self.addCleanup(shutil.rmtree, tmp, True)
|
||||
root = self.checked_repo(tmp)
|
||||
E._REFS.clear()
|
||||
self.record_inputs(root)
|
||||
ok, lines = E.check(root, mild_fetch)
|
||||
self.assertTrue(ok, lines)
|
||||
|
||||
def test_check_flags_an_estimate_whose_machine_estimate_changed(self):
|
||||
tmp = tempfile.mkdtemp()
|
||||
self.addCleanup(shutil.rmtree, tmp, True)
|
||||
root = self.checked_repo(tmp)
|
||||
E._REFS.clear()
|
||||
self.record_inputs(root, machine=[6, 7])
|
||||
ok, lines = E.check(root, mild_fetch)
|
||||
self.assertFalse(ok)
|
||||
self.assertTrue(any("aaa" in line and "inputs changed" in line and "[6, 7]" in line
|
||||
for line in lines), lines)
|
||||
|
||||
def test_check_flags_an_estimate_whose_climate_digest_changed(self):
|
||||
tmp = tempfile.mkdtemp()
|
||||
self.addCleanup(shutil.rmtree, tmp, True)
|
||||
root = self.checked_repo(tmp)
|
||||
E._REFS.clear()
|
||||
self.record_inputs(root, digest="0" * 16)
|
||||
ok, lines = E.check(root, mild_fetch)
|
||||
self.assertFalse(ok)
|
||||
self.assertTrue(any("aaa" in line and "inputs changed" in line for line in lines), lines)
|
||||
|
||||
def test_check_flags_an_estimate_with_no_recorded_inputs(self):
|
||||
tmp = tempfile.mkdtemp()
|
||||
self.addCleanup(shutil.rmtree, tmp, True)
|
||||
root = self.checked_repo(tmp)
|
||||
E._REFS.clear()
|
||||
ok, lines = E.check(root, mild_fetch)
|
||||
self.assertFalse(ok)
|
||||
self.assertTrue(any("aaa" in line and "no inputs are recorded" in line for line in lines), lines)
|
||||
|
||||
def test_check_fails_when_the_blind_test_is_under_the_bar(self):
|
||||
tmp = tempfile.mkdtemp()
|
||||
self.addCleanup(shutil.rmtree, tmp, True)
|
||||
root = self.checked_repo(tmp, share=0.6)
|
||||
E._REFS.clear()
|
||||
self.record_inputs(root)
|
||||
ok, lines = E.check(root, mild_fetch)
|
||||
self.assertFalse(ok)
|
||||
self.assertTrue(any("blind test" in line for line in lines), lines)
|
||||
|
||||
def test_check_fails_when_the_fit_got_worse(self):
|
||||
tmp = tempfile.mkdtemp()
|
||||
self.addCleanup(shutil.rmtree, tmp, True)
|
||||
# one sourced trail that mild all-year normals cannot match
|
||||
extra = ('season = "June"\nmonths = [6]\n'
|
||||
'season_basis = "source"\n' + self.ENDS)
|
||||
root = self.repo_with(tmp, [("only", "Only", {"extra_hike": extra})])
|
||||
self.fit_doc(root, within1=4, n=4)
|
||||
self.blind_doc(root)
|
||||
E._REFS.clear()
|
||||
ok, lines = E.check(root, mild_fetch)
|
||||
self.assertFalse(ok)
|
||||
self.assertTrue(any("fit got worse" in line for line in lines), lines)
|
||||
|
||||
def test_the_estimates_command_lists_only_estimates(self):
|
||||
tmp = tempfile.mkdtemp()
|
||||
self.addCleanup(shutil.rmtree, tmp, True)
|
||||
root = self.repo_with(tmp, [
|
||||
("aaa", "Aaa", {"extra_hike": self.EST + self.ENDS}),
|
||||
("bbb", "Bbb", {"extra_hike": 'season = "June"\nmonths = [6]\n'
|
||||
'season_basis = "source"\n' + self.ENDS}),
|
||||
])
|
||||
self.assertEqual(E.estimates(root), ["aaa"])
|
||||
|
||||
def test_a_season_with_a_method_is_not_a_sourced_season(self):
|
||||
tmp = tempfile.mkdtemp()
|
||||
self.addCleanup(shutil.rmtree, tmp, True)
|
||||
root = self.repo_with(tmp, [
|
||||
("aaa", "Aaa", {"extra_hike": 'season = "June"\nmonths = [6]\nseason_basis = "sources"\n'
|
||||
'season_method = "The pages differ. Confidence: low."\n' + self.ENDS}),
|
||||
])
|
||||
E._PHRASES.clear()
|
||||
self.assertEqual(E._phrases(root), {})
|
||||
|
||||
|
||||
class SeasonKindTest(unittest.TestCase):
|
||||
def test_kinds_of_sourced_seasons(self):
|
||||
self.assertEqual(E.season_kind(list(range(1, 13))), "year-round")
|
||||
self.assertEqual(E.season_kind([7, 8, 9]), "alpine")
|
||||
self.assertEqual(E.season_kind([10, 11, 12, 1, 2, 3, 4]), "cool-season")
|
||||
self.assertEqual(E.season_kind([4, 5, 6, 7, 8, 9, 10]), "other")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -0,0 +1,80 @@
|
||||
"""Tests for the written audit checklist and the monthly season check.
|
||||
|
||||
Run from the repository root:
|
||||
python3 -m unittest discover tools/tests
|
||||
"""
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
sys.dont_write_bytecode = True
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
import estimate_season as E # noqa: E402
|
||||
|
||||
ROOT = E.ROOT
|
||||
|
||||
|
||||
def read(*parts):
|
||||
with open(os.path.join(ROOT, *parts), encoding="utf-8") as f:
|
||||
return f.read()
|
||||
|
||||
|
||||
def section(text, heading):
|
||||
start = text.index(f"## {heading}")
|
||||
nxt = text.find("\n## ", start + 1)
|
||||
return text[start:nxt if nxt != -1 else len(text)]
|
||||
|
||||
|
||||
class AuditChecklistTest(unittest.TestCase):
|
||||
def test_the_audit_checklist_has_a_seasons_section_naming_both_steps(self):
|
||||
doc = read("docs", "audit.md")
|
||||
seasons = section(doc, "Seasons")
|
||||
self.assertIn("estimate_season.py check", seasons)
|
||||
self.assertIn("estimate_season.py estimates", seasons)
|
||||
self.assertIn("docs/season-research.md", seasons)
|
||||
self.assertIn("search afresh for a page that states the season", seasons.lower().replace("\n", " "))
|
||||
self.assertIn("re-run the machine estimate", seasons.lower())
|
||||
self.assertIn("1. ", seasons)
|
||||
self.assertIn("2. ", seasons)
|
||||
|
||||
def test_the_commands_it_names_exist(self):
|
||||
import contextlib
|
||||
import io
|
||||
import season_judge
|
||||
for module, subs in ((E, ("check", "estimates")), (season_judge, ("inputs", "packets", "score", "proposals"))):
|
||||
for sub in subs:
|
||||
out = io.StringIO()
|
||||
with contextlib.redirect_stdout(out), self.assertRaises(SystemExit) as stop:
|
||||
module.main([sub, "--help"])
|
||||
self.assertEqual(stop.exception.code, 0, sub)
|
||||
self.assertIn(f" {sub}", out.getvalue())
|
||||
|
||||
def test_the_estimates_command_prints_one_id_a_line(self):
|
||||
ids = E.estimates(ROOT)
|
||||
self.assertEqual(len(ids), 69)
|
||||
self.assertEqual(ids, sorted(ids))
|
||||
|
||||
def test_house_wording_in_the_audit_doc_and_workflow(self):
|
||||
dash = re.compile("[\u2013\u2014]")
|
||||
for rel in (("docs", "audit.md"), ("docs", "season-judging.md")):
|
||||
text = re.sub(r"`[^`]*`", "", read(*rel))
|
||||
self.assertIsNone(dash.search(text), rel)
|
||||
self.assertNotIn(" - ", text, rel)
|
||||
# in the workflow a dash is YAML's own, so only its comments are read
|
||||
comments = " ".join(l for l in read(".github", "workflows", "season-check.yml").splitlines()
|
||||
if l.lstrip().startswith("#"))
|
||||
self.assertIsNone(dash.search(comments))
|
||||
self.assertNotIn(" - ", comments)
|
||||
|
||||
|
||||
class MonthlyWorkflowTest(unittest.TestCase):
|
||||
def test_the_monthly_workflow_runs_the_check_on_a_schedule(self):
|
||||
text = read(".github", "workflows", "season-check.yml")
|
||||
for want in ("schedule", "workflow_dispatch", "estimate_season.py check", "cron:", "longhikes-climate"):
|
||||
self.assertIn(want, text)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -20,6 +20,22 @@ def src(publisher, facts=("season", "months"), url="https://example.org/trail"):
|
||||
return {"url": url, "publisher": publisher, "facts": list(facts)}
|
||||
|
||||
|
||||
CLIMATE_URL = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
CLIMATE = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
METHOD = "Snow clears from the high ground in June. Confidence: medium."
|
||||
|
||||
|
||||
def climate_src(**kw):
|
||||
return src(CLIMATE, url=CLIMATE_URL, **kw)
|
||||
|
||||
|
||||
def estimate(**fields):
|
||||
fields.setdefault("season_basis", "estimate")
|
||||
fields.setdefault("season_method", METHOD)
|
||||
fields.setdefault("source", [climate_src()])
|
||||
return check(**fields)
|
||||
|
||||
|
||||
def check(**fields):
|
||||
hike = {
|
||||
"season": "June to September",
|
||||
@@ -98,42 +114,102 @@ class SeasonBasisTest(unittest.TestCase):
|
||||
errors = check(source=[src("Park Service", facts=("days",))])
|
||||
self.assertTrue(errors)
|
||||
|
||||
def test_estimate_needs_a_method_and_refuses_one_otherwise(self):
|
||||
self.assertTrue(check(season_basis="estimate"))
|
||||
def test_an_estimate_with_a_method_and_a_climate_source_passes(self):
|
||||
self.assertEqual(estimate(), [])
|
||||
|
||||
def test_an_estimate_phrase_is_built_from_its_months(self):
|
||||
errors = estimate(season="Summer")
|
||||
self.assertTrue(any("built from" in e for e in errors), errors)
|
||||
self.assertEqual(check(season="Summer"), []) # a page's own words stand
|
||||
|
||||
def test_an_estimate_needs_a_method(self):
|
||||
errors = estimate(season_method=None)
|
||||
self.assertTrue(any("season_method" in e for e in errors), errors)
|
||||
self.assertTrue(estimate(season_method=""))
|
||||
self.assertTrue(estimate(season_method="x" * 401))
|
||||
|
||||
def test_an_estimate_method_ends_with_its_confidence(self):
|
||||
for word in ("high", "medium", "low"):
|
||||
self.assertEqual(estimate(season_method=f"Set by snow. Confidence: {word}."), [])
|
||||
errors = estimate(season_method="Set by snow.")
|
||||
self.assertTrue(any("Confidence" in e for e in errors), errors)
|
||||
self.assertTrue(estimate(season_method="Set by snow. Confidence: certain."))
|
||||
|
||||
def test_a_method_without_an_estimate_is_still_an_error_on_a_primary(self):
|
||||
self.assertTrue(check(season_method=METHOD))
|
||||
|
||||
def test_an_estimate_refuses_an_ordinary_page_naming_the_season(self):
|
||||
two = [climate_src(), src("Park Service", url="https://example.org/p")]
|
||||
errors = estimate(source=two)
|
||||
self.assertTrue(errors)
|
||||
only = [src("Park Service", url="https://example.org/p")]
|
||||
errors = estimate(source=only)
|
||||
self.assertTrue(any("climate" in e for e in errors), errors)
|
||||
|
||||
def test_an_estimate_with_no_naming_source_is_an_error(self):
|
||||
self.assertTrue(estimate(source=[climate_src(facts=("days",))]))
|
||||
|
||||
def test_an_estimate_source_names_both_season_and_months(self):
|
||||
errors = estimate(source=[climate_src(facts=("season",))])
|
||||
self.assertTrue(any("months" in e for e in errors), errors)
|
||||
|
||||
def test_a_sourced_season_may_not_cite_the_climate_data(self):
|
||||
errors = check(source=[climate_src()])
|
||||
self.assertTrue(any("climate" in e for e in errors), errors)
|
||||
|
||||
def test_the_climate_host_is_the_one_the_estimator_reads(self):
|
||||
import urllib.parse
|
||||
import season_climate
|
||||
self.assertEqual(
|
||||
check(season_basis="estimate", season_method="Estimated from climate normals."), [])
|
||||
self.assertTrue(check(season_basis="estimate", season_method=""))
|
||||
self.assertTrue(check(season_basis="estimate", season_method="x" * 401))
|
||||
self.assertTrue(check(season_method="Estimated from climate normals."))
|
||||
season.CLIMATE_HOSTS,
|
||||
frozenset({urllib.parse.urlparse(season_climate.SOURCE["url"]).hostname}))
|
||||
|
||||
def test_estimate_with_two_naming_sources_is_an_error(self):
|
||||
two = [src("Climate", url="https://c.example/1"), src("Other", url="https://o.example/1")]
|
||||
errors = check(season_basis="estimate", season_method="Estimated from climate.", source=two)
|
||||
def test_sources_judged_from_pages_that_differ_may_share_a_publisher(self):
|
||||
two = [src("The Trek", url="https://t.example/1"), src("The Trek", url="https://t.example/2")]
|
||||
errors = check(season_basis="sources", source=two)
|
||||
self.assertTrue(errors)
|
||||
self.assertEqual(
|
||||
check(season_basis="sources", source=two,
|
||||
season_method="The pages differ. Confidence: low."), [])
|
||||
|
||||
def test_judged_from_pages_that_differ_needs_a_page(self):
|
||||
errors = check(season_basis="sources", source=[src("The Trek", facts=("days",))],
|
||||
season_method="The pages differ. Confidence: low.")
|
||||
self.assertTrue(errors)
|
||||
|
||||
def test_estimate_with_no_naming_source_is_an_error(self):
|
||||
errors = check(season_basis="estimate", season_method="Estimated from climate.",
|
||||
source=[src("Climate", facts=("days",))])
|
||||
def test_a_season_read_from_a_page_has_no_method_and_no_estimate_basis(self):
|
||||
self.assertTrue(season.read_from_a_page({"season": "x", "season_basis": "primary"}))
|
||||
self.assertFalse(season.read_from_a_page({"season": "x", "season_basis": "estimate"}))
|
||||
self.assertFalse(season.read_from_a_page(
|
||||
{"season": "x", "season_basis": "sources", "season_method": "Judged."}))
|
||||
self.assertFalse(season.read_from_a_page({"season_basis": "primary"}))
|
||||
|
||||
def test_the_confidence_is_read_from_the_method(self):
|
||||
self.assertEqual(season.confidence_of("Set by snow. Confidence: low."), "low")
|
||||
self.assertEqual(season.confidence_of("Set by snow."), "")
|
||||
|
||||
def test_a_hike_without_season_is_an_error(self):
|
||||
errors = check(season=None, months=None, season_basis=None, source=None)
|
||||
self.assertTrue(any("season" in e for e in errors), errors)
|
||||
|
||||
def test_a_record_with_no_hike_is_an_error(self):
|
||||
errors = []
|
||||
season.check_present("t", {}, errors)
|
||||
self.assertTrue(errors)
|
||||
|
||||
def test_a_hike_without_season_passes_until_required(self):
|
||||
self.assertEqual(check(season=None, months=None, season_basis=None, source=None), [])
|
||||
|
||||
def test_required_flag_makes_it_an_error(self):
|
||||
with mock.patch.object(season, "SEASON_REQUIRED", True):
|
||||
errors = check(season=None, months=None, season_basis=None, source=None)
|
||||
self.assertTrue(any("season" in e for e in errors), errors)
|
||||
errors = []
|
||||
season.check_present("t", {"hike": {"season": "x"}}, errors)
|
||||
self.assertEqual(errors, [])
|
||||
|
||||
def test_method_without_season_is_an_error(self):
|
||||
errors = check(season=None, months=None, season_basis=None, season_method="Some method.")
|
||||
self.assertTrue(errors)
|
||||
|
||||
def test_every_record_with_a_season_passes_the_validator(self):
|
||||
def test_every_record_passes_the_validator(self):
|
||||
errors = []
|
||||
for tid in refresh.trail_ids(V.ROOT):
|
||||
rec = refresh.load_toml(os.path.join(V.ROOT, tid, "trail.toml"))
|
||||
if (rec.get("hike") or {}).get("season"):
|
||||
V.check_hike(tid, rec, errors)
|
||||
V.check_hike(tid, rec, errors)
|
||||
season.check_present(tid, rec, errors)
|
||||
self.assertEqual(errors, [])
|
||||
|
||||
def test_provenance_keys_need_no_source_fact(self):
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
"""Tests for tools/season_climate.py. All offline: an injected range
|
||||
getter serves small synthetic GeoTIFFs laid out like CHELSA's (LZW with
|
||||
a horizontal predictor, 16 bit) and ETOPO's (deflate with the floating
|
||||
point predictor).
|
||||
|
||||
Run from the repository root:
|
||||
python3 -m unittest discover tools/tests
|
||||
"""
|
||||
import os
|
||||
import struct
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
import zlib
|
||||
|
||||
sys.dont_write_bytecode = True
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
import season_climate as C # noqa: E402
|
||||
import validate as V # noqa: E402
|
||||
|
||||
W = H = 8
|
||||
TW = TH = 4
|
||||
X0, Y0, RES = -120.0, 40.0, 0.5
|
||||
|
||||
|
||||
def lzw_encode(data):
|
||||
"""A plain TIFF LZW encoder for short inputs (9 bit codes only)."""
|
||||
table = {bytes([i]): i for i in range(256)}
|
||||
nxt = 258
|
||||
codes = [256]
|
||||
cur = b""
|
||||
for byte in data:
|
||||
nb = cur + bytes([byte])
|
||||
if nb in table:
|
||||
cur = nb
|
||||
else:
|
||||
codes.append(table[cur])
|
||||
table[nb] = nxt
|
||||
nxt += 1
|
||||
cur = bytes([byte])
|
||||
if cur:
|
||||
codes.append(table[cur])
|
||||
codes.append(257)
|
||||
assert nxt < 500
|
||||
bits = "".join(format(c, "09b") for c in codes)
|
||||
bits += "0" * (-len(bits) % 8)
|
||||
return bytes(int(bits[i:i + 8], 2) for i in range(0, len(bits), 8))
|
||||
|
||||
|
||||
def build_tiff(tiles, compression, predictor, bits, sampleformat, meta="", nodata=None):
|
||||
"""Classic little-endian TIFF, W x H in TW x TH tiles."""
|
||||
entries = []
|
||||
extra = bytearray()
|
||||
base = 8 + 2 + 20 * 12 + 4 # room for up to 20 entries
|
||||
|
||||
def short(tag, v):
|
||||
entries.append((tag, 3, 1, struct.pack("<HH", v, 0)))
|
||||
|
||||
def blob(tag, typ, count, payload):
|
||||
off = base + len(extra)
|
||||
extra.extend(payload)
|
||||
entries.append((tag, typ, count, struct.pack("<I", off)))
|
||||
|
||||
short(256, W)
|
||||
short(257, H)
|
||||
short(258, bits)
|
||||
short(259, compression)
|
||||
short(277, 1)
|
||||
if predictor != 1:
|
||||
short(317, predictor)
|
||||
short(322, TW)
|
||||
short(323, TH)
|
||||
short(339, sampleformat)
|
||||
blob(33550, 12, 3, struct.pack("<3d", RES, RES, 0.0))
|
||||
blob(33922, 12, 6, struct.pack("<6d", 0, 0, 0, X0, Y0, 0))
|
||||
if meta:
|
||||
text = meta.encode() + b"\x00"
|
||||
blob(42112, 2, len(text), text)
|
||||
if nodata is not None:
|
||||
text = str(nodata).encode() + b"\x00"
|
||||
blob(42113, 2, len(text), text)
|
||||
# tile offsets and byte counts come after everything else
|
||||
n = len(tiles)
|
||||
tile_base = base + len(extra) + 8 * n
|
||||
offs, pos = [], tile_base
|
||||
for t in tiles:
|
||||
offs.append(pos)
|
||||
pos += len(t)
|
||||
blob(324, 4, n, struct.pack("<%dI" % n, *offs))
|
||||
blob(325, 4, n, struct.pack("<%dI" % n, *[len(t) for t in tiles]))
|
||||
entries.sort()
|
||||
ifd = struct.pack("<H", len(entries))
|
||||
for tag, typ, count, val in entries:
|
||||
ifd += struct.pack("<HHI", tag, typ, count) + val
|
||||
ifd += struct.pack("<I", 0)
|
||||
head = b"II*\x00" + struct.pack("<I", 8) + ifd
|
||||
head += b"\x00" * (base - len(head))
|
||||
return head + bytes(extra) + b"".join(tiles)
|
||||
|
||||
|
||||
def tiles_of(values, encode):
|
||||
"""Cut a W x H grid into tiles (row-major tile order) and encode."""
|
||||
out = []
|
||||
for ty in range(H // TH):
|
||||
for tx in range(W // TW):
|
||||
rows = [values[(ty * TH + r) * W + tx * TW: (ty * TH + r) * W + tx * TW + TW]
|
||||
for r in range(TH)]
|
||||
out.append(encode(rows))
|
||||
return out
|
||||
|
||||
|
||||
def encode_u16(rows):
|
||||
"""Horizontal predictor, then LZW."""
|
||||
raw = b""
|
||||
for row in rows:
|
||||
prev = 0
|
||||
for v in row:
|
||||
raw += struct.pack("<H", (v - prev) & 0xFFFF)
|
||||
prev = v
|
||||
return lzw_encode(raw)
|
||||
|
||||
|
||||
def encode_float(rows):
|
||||
"""Floating point predictor, then deflate."""
|
||||
raw = b""
|
||||
for row in rows:
|
||||
be = b"".join(struct.pack(">f", v) for v in row)
|
||||
planar = bytes(be[j * 4 + k] for k in range(4) for j in range(len(row)))
|
||||
diff = bytearray(len(planar))
|
||||
prev = 0
|
||||
for i, b in enumerate(planar):
|
||||
diff[i] = (b - prev) & 255
|
||||
prev = b
|
||||
raw += bytes(diff)
|
||||
return zlib.compress(raw)
|
||||
|
||||
|
||||
def month_file(month, nodata_at=None):
|
||||
"""Kelvin times ten, one value per cell: 280 K plus the month plus
|
||||
the column, so every cell and month is distinguishable."""
|
||||
vals = [int((280.0 + month + (i % W) * 0.1) * 10) for i in range(W * H)]
|
||||
if nodata_at is not None:
|
||||
vals[nodata_at] = 65535
|
||||
meta = ('<GDALMetadata><Item name="OFFSET" sample="0" role="offset">0</Item>'
|
||||
'<Item name="SCALE" sample="0" role="scale">0.1</Item></GDALMetadata>')
|
||||
return build_tiff(tiles_of(vals, encode_u16), 5, 2, 16, 1, meta,
|
||||
nodata=65535 if nodata_at is not None else None)
|
||||
|
||||
|
||||
def dem_file(elev=1000.0):
|
||||
vals = [elev] * (W * H)
|
||||
return build_tiff(tiles_of(vals, encode_float), 8, 3, 32, 3, nodata=-99999)
|
||||
|
||||
|
||||
class Getter:
|
||||
def __init__(self, nodata_at=None, elev=1000.0):
|
||||
self.calls = []
|
||||
self.files = {}
|
||||
for m in range(1, 13):
|
||||
self.files[C.CHELSA_URL.format(month=m)] = month_file(
|
||||
m, nodata_at if m == 1 else nodata_at)
|
||||
self.files[C.ETOPO_URL] = dem_file(elev)
|
||||
|
||||
def __call__(self, url, start, end):
|
||||
self.calls.append((url, start, end))
|
||||
return self.files[url][start:end + 1]
|
||||
|
||||
|
||||
class ReaderTest(unittest.TestCase):
|
||||
def test_lzw_round_trips_repeats(self):
|
||||
data = b"ABABABABCCCCCCDDDDABAB" * 5
|
||||
self.assertEqual(C.lzw_decode(lzw_encode(data)), data)
|
||||
|
||||
def test_a_chelsa_style_tile_is_read_with_its_predictor_and_scale(self):
|
||||
with tempfile.TemporaryDirectory() as cache:
|
||||
src = C.Source(C.CHELSA_URL.format(month=3), cache, Getter())
|
||||
raw = src.pixel(2, 2)
|
||||
self.assertEqual(raw, int((283.0 + 0.2) * 10))
|
||||
self.assertAlmostEqual(src.value_nearest(-119.0, 39.0), 283.2, places=1)
|
||||
|
||||
def test_an_etopo_style_float_tile_is_read(self):
|
||||
with tempfile.TemporaryDirectory() as cache:
|
||||
src = C.Source(C.ETOPO_URL, cache, Getter(elev=1234.5))
|
||||
self.assertAlmostEqual(src.value_bilinear(-119.1, 39.2), 1234.5, places=1)
|
||||
|
||||
|
||||
class NormalsTest(unittest.TestCase):
|
||||
def test_a_point_becomes_twelve_celsius_values_at_the_cell_elevation(self):
|
||||
with tempfile.TemporaryDirectory() as cache:
|
||||
n = C.fetch_normals(39.0, -119.0, None, cache=cache, getter=Getter())
|
||||
self.assertEqual(len(n.tmax_c), 12)
|
||||
self.assertEqual(n.elev_m, 1000.0)
|
||||
self.assertIsNone(n.snow_cm)
|
||||
self.assertAlmostEqual(n.tmax_c[0], 281.0 + 0.2 - 273.15, places=1)
|
||||
|
||||
def test_values_are_corrected_by_the_lapse_rate_to_the_asked_elevation(self):
|
||||
with tempfile.TemporaryDirectory() as cache:
|
||||
g = Getter()
|
||||
cell = C.fetch_normals(39.0, -119.0, None, cache=cache, getter=g)
|
||||
up = C.fetch_normals(39.0, -119.0, 2000, cache=cache, getter=g)
|
||||
self.assertEqual(up.elev_m, 2000.0)
|
||||
self.assertAlmostEqual(cell.tmax_c[6] - up.tmax_c[6], 6.5, places=1)
|
||||
|
||||
def test_a_second_call_reads_the_cache_not_the_network(self):
|
||||
with tempfile.TemporaryDirectory() as cache:
|
||||
g = Getter()
|
||||
C.fetch_normals(39.0, -119.0, 1500, cache=cache, getter=g)
|
||||
first = len(g.calls)
|
||||
self.assertGreater(first, 0)
|
||||
C.fetch_normals(39.0, -119.0, 1500, cache=cache, getter=g)
|
||||
self.assertEqual(len(g.calls), first)
|
||||
|
||||
def test_a_new_getter_still_reads_cached_tiles(self):
|
||||
with tempfile.TemporaryDirectory() as cache:
|
||||
C.fetch_normals(39.0, -119.0, 1500, cache=cache, getter=Getter())
|
||||
g2 = Getter()
|
||||
C.fetch_normals(39.2, -119.0, 1500, cache=cache, getter=g2)
|
||||
# a different point in the same tiles: no tile range is asked again
|
||||
tile_asks = [c for c in g2.calls if c[1] != 0]
|
||||
self.assertEqual(tile_asks, [])
|
||||
|
||||
def test_a_point_with_no_data_returns_none_not_zeros(self):
|
||||
with tempfile.TemporaryDirectory() as cache:
|
||||
# every cell of every month file is nodata
|
||||
g = Getter()
|
||||
for m in range(1, 13):
|
||||
url = C.CHELSA_URL.format(month=m)
|
||||
vals = [65535] * (W * H)
|
||||
meta = ('<GDALMetadata><Item name="SCALE" role="scale">0.1</Item>'
|
||||
'</GDALMetadata>')
|
||||
g.files[url] = build_tiff(tiles_of(vals, encode_u16), 5, 2, 16, 1,
|
||||
meta, nodata=65535)
|
||||
self.assertIsNone(C.fetch_normals(39.0, -119.0, 1500, cache=cache, getter=g))
|
||||
|
||||
def test_a_sea_cell_borrows_the_nearest_land_cell(self):
|
||||
with tempfile.TemporaryDirectory() as cache:
|
||||
# cell (2, 2) is sea in every month; (3, 2) is land
|
||||
g = Getter(nodata_at=2 * W + 2)
|
||||
n = C.fetch_normals(39.0, -119.0, None, cache=cache, getter=g)
|
||||
self.assertIsNotNone(n)
|
||||
|
||||
def test_a_point_outside_the_grid_has_no_data(self):
|
||||
with tempfile.TemporaryDirectory() as cache:
|
||||
self.assertIsNone(C.fetch_normals(80.0, -119.0, 100, cache=cache, getter=Getter()))
|
||||
|
||||
|
||||
class SourceTest(unittest.TestCase):
|
||||
def test_the_cache_is_outside_the_repository(self):
|
||||
self.assertFalse(os.path.abspath(C.CACHE_DIR).startswith(os.path.abspath(V.ROOT)))
|
||||
|
||||
def test_the_source_says_its_licence_and_period(self):
|
||||
for key in ("name", "publisher", "url", "licence", "period"):
|
||||
self.assertIn(key, C.SOURCE)
|
||||
self.assertTrue(str(C.SOURCE[key]).strip())
|
||||
self.assertIn("CC0", C.SOURCE["licence"])
|
||||
self.assertEqual(C.SOURCE["period"], "1981-2010")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -0,0 +1,61 @@
|
||||
"""Tests for the committed fit figure in tools/season_fit.json.
|
||||
|
||||
Run from the repository root:
|
||||
python3 -m unittest discover tools/tests
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
sys.dont_write_bytecode = True
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
import estimate_season as E # noqa: E402
|
||||
import refresh # noqa: E402
|
||||
import validate as V # noqa: E402
|
||||
|
||||
FIT_PATH = os.path.join(V.ROOT, "tools", "season_fit.json")
|
||||
|
||||
|
||||
def load_fit():
|
||||
with open(FIT_PATH, encoding="utf-8") as f:
|
||||
return json.load(f)
|
||||
|
||||
|
||||
class SeasonFitFileTest(unittest.TestCase):
|
||||
def test_the_committed_fit_has_the_fields_the_site_reads(self):
|
||||
fit = load_fit()
|
||||
for key in ("computed", "rule_version", "dataset", "period",
|
||||
"params", "loo", "bar", "passes", "confidence"):
|
||||
self.assertIn(key, fit)
|
||||
self.assertEqual(sorted(fit["params"]), sorted(E.Params(0, 0).as_dict()))
|
||||
for part in ("loo",):
|
||||
for key in ("n", "within1", "worse", "no_data", "classified",
|
||||
"jaccard", "by_group", "by_kind"):
|
||||
self.assertIn(key, fit[part], part)
|
||||
rep = fit[part]
|
||||
self.assertEqual(rep["within1"] + rep["worse"] + rep["no_data"],
|
||||
rep["n"], part)
|
||||
self.assertEqual(fit["bar"], E.BAR)
|
||||
self.assertEqual(fit["rule_version"], E.RULE_VERSION)
|
||||
self.assertEqual(fit["passes"], E.passes_bar(fit["loo"], fit["bar"]))
|
||||
|
||||
def test_estimates_only_over_the_bar_by_the_blind_test(self):
|
||||
"""The machine estimate on its own is under the bar and is never
|
||||
written to a record. Estimated seasons are judged, and the judged
|
||||
method must pass the bar in its blind test."""
|
||||
estimated = []
|
||||
for tid in refresh.trail_ids(V.ROOT):
|
||||
rec = refresh.load_toml(os.path.join(V.ROOT, tid, "trail.toml"))
|
||||
if (rec.get("hike") or {}).get("season_basis") == "estimate":
|
||||
estimated.append(tid)
|
||||
if not estimated:
|
||||
self.skipTest("no estimated seasons on file yet")
|
||||
import season_judge
|
||||
blind = season_judge.load_blind_test()
|
||||
self.assertEqual(season_judge.check_blind_test(blind), [])
|
||||
self.assertGreaterEqual(blind["share"], E.BAR["within1_min"])
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -0,0 +1,85 @@
|
||||
"""Tests for the shared season helpers in tools/season.py.
|
||||
|
||||
Run from the repository root:
|
||||
python3 -m unittest discover tools/tests
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
sys.dont_write_bytecode = True
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
import season # noqa: E402
|
||||
|
||||
|
||||
class SpanTest(unittest.TestCase):
|
||||
def test_span_wraps_the_year(self):
|
||||
self.assertEqual(season.span([11, 12, 1, 2, 3]), (11, 3))
|
||||
|
||||
def test_span_of_two_windows_covers_both(self):
|
||||
self.assertEqual(season.span([4, 5, 9, 10]), (4, 10))
|
||||
|
||||
def test_span_of_one_month(self):
|
||||
self.assertEqual(season.span([7]), (7, 7))
|
||||
|
||||
def test_span_of_all_year(self):
|
||||
self.assertEqual(season.span(list(range(1, 13))), (1, 12))
|
||||
|
||||
def test_span_is_order_independent(self):
|
||||
self.assertEqual(season.span([3, 1, 12, 2, 11]), (11, 3))
|
||||
|
||||
|
||||
class GradeTest(unittest.TestCase):
|
||||
def test_grade_exact(self):
|
||||
self.assertEqual(season.grade([6, 7, 8, 9], [6, 7, 8, 9]), "exact")
|
||||
self.assertEqual(season.grade([11, 12, 1, 2], [11, 12, 1, 2]), "exact")
|
||||
|
||||
def test_grade_within_one_at_each_end(self):
|
||||
self.assertEqual(season.grade([5, 6, 7, 8, 9], [6, 7, 8]), "within1")
|
||||
|
||||
def test_grade_worse(self):
|
||||
self.assertEqual(season.grade([6, 7], [9, 10]), "worse")
|
||||
|
||||
def test_grade_across_the_year_end(self):
|
||||
self.assertEqual(season.grade([12, 1, 2], [1, 2, 3]), "within1")
|
||||
|
||||
def test_grade_two_months_off_at_one_end_is_worse(self):
|
||||
self.assertEqual(season.grade([4, 5, 6, 7, 8], [6, 7, 8]), "worse")
|
||||
|
||||
|
||||
class PhraseTest(unittest.TestCase):
|
||||
def test_phrase_runs(self):
|
||||
self.assertEqual(season.phrase_for([6, 7, 8, 9]), "June to September")
|
||||
self.assertEqual(season.phrase_for([11, 12, 1, 2, 3]), "November to March")
|
||||
self.assertEqual(season.phrase_for([4, 5, 9, 10]),
|
||||
"April to May and September to October")
|
||||
self.assertEqual(season.phrase_for([3, 4, 5, 10, 11]),
|
||||
"March to May and October to November")
|
||||
self.assertEqual(season.phrase_for([11, 12, 1, 2, 6, 7, 8]),
|
||||
"November to February and June to August")
|
||||
self.assertEqual(season.phrase_for([7]), "July")
|
||||
self.assertEqual(season.phrase_for(list(range(1, 13))), "All year")
|
||||
|
||||
def test_phrase_two_month_run(self):
|
||||
self.assertEqual(season.phrase_for([7, 8]), "July to August")
|
||||
self.assertEqual(season.phrase_for([12, 1]), "December to January")
|
||||
|
||||
|
||||
class MethodSentenceTest(unittest.TestCase):
|
||||
def test_method_sentence_names_dataset_period_and_points(self):
|
||||
text = season.method_sentence("ERA5-Land via Open-Meteo", "2011-2020", 5, "track", 1)
|
||||
self.assertIn("ERA5-Land via Open-Meteo", text)
|
||||
self.assertIn("2011-2020", text)
|
||||
self.assertIn("5", text)
|
||||
self.assertTrue(text.endswith("."))
|
||||
self.assertLess(len(text), 400)
|
||||
|
||||
def test_method_sentence_for_each_kind(self):
|
||||
for kind in ("track", "ends", "place"):
|
||||
text = season.method_sentence("Dataset", "2011-2020", 1, kind, 1)
|
||||
self.assertIn("Dataset", text)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -0,0 +1,290 @@
|
||||
"""Tests for tools/season_judge.py: the packets reviewers judge a season from,
|
||||
the blind scoring, and the proposals that write the judged seasons.
|
||||
|
||||
Run from the repository root:
|
||||
python3 -m unittest discover tools/tests
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
sys.dont_write_bytecode = True
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
import season_judge as J # noqa: E402
|
||||
import season_climate as C # noqa: E402
|
||||
import season_model as M # noqa: E402
|
||||
import estimate_season as E # noqa: E402
|
||||
import test_refresh as TR # noqa: E402
|
||||
import refresh as R # noqa: E402
|
||||
import trail_history # noqa: E402
|
||||
import validate as V # noqa: E402
|
||||
|
||||
|
||||
class CleanTest(unittest.TestCase):
|
||||
def test_a_sentence_that_bears_on_timing_is_removed_and_logged(self):
|
||||
kept, removed = J.clean("A pretty ridge walk. Best in July and August. It has huts.")
|
||||
self.assertEqual(kept, "A pretty ridge walk. It has huts.")
|
||||
self.assertEqual(removed, ["Best in July and August."])
|
||||
|
||||
def test_season_words_count_but_place_names_do_not(self):
|
||||
self.assertTrue(J.mentions_season("Snowmelt comes late."))
|
||||
self.assertTrue(J.mentions_season("Open year-round."))
|
||||
self.assertFalse(J.mentions_season("It crosses May Lake and Summer Lake."))
|
||||
self.assertFalse(J.mentions_season("It passes the Hot Springs."))
|
||||
|
||||
def test_nothing_left_is_said_so(self):
|
||||
kept, _ = J.clean("Best in summer.")
|
||||
self.assertEqual(kept, "")
|
||||
self.assertIn("none left", J.shown(kept, "x"))
|
||||
self.assertEqual(J.shown("", None), "(not on file)")
|
||||
|
||||
|
||||
class SplitTest(unittest.TestCase):
|
||||
def test_parts_are_disjoint_balanced_and_repeatable(self):
|
||||
src = [f"s{i}" for i in range(10)]
|
||||
oth = [f"o{i}" for i in range(7)]
|
||||
parts = J.split_parts(src, oth, 3, 1)
|
||||
flat = [t for p in parts for t in p]
|
||||
self.assertEqual(sorted(flat), sorted(src + oth))
|
||||
for part in parts:
|
||||
self.assertIn(sum(t in src for t in part), (3, 4))
|
||||
self.assertIn(sum(t in oth for t in part), (2, 3))
|
||||
self.assertEqual(parts, J.split_parts(src, oth, 3, 1))
|
||||
self.assertNotEqual(parts, J.split_parts(src, oth, 3, 2))
|
||||
|
||||
|
||||
def med(base):
|
||||
return ([base] * 12, [base] * 12)
|
||||
|
||||
|
||||
class ComparablesTest(unittest.TestCase):
|
||||
def test_a_trail_is_never_compared_with_its_own_part_or_itself(self):
|
||||
part_of = {"me": 0, "mate": 0, "a": 1, "b": 2}
|
||||
meds = {k: med(10.0) for k in part_of}
|
||||
centres = {k: (45.0, -110.0) for k in part_of}
|
||||
got = J.comparables("me", part_of, ["mate", "a", "b", "me"], meds, centres, k=10)
|
||||
self.assertEqual(sorted(got), ["a", "b"])
|
||||
|
||||
def test_the_nearest_in_climate_and_place_come_first(self):
|
||||
part_of = {"me": 0, "near": 1, "far": 1, "cold": 2}
|
||||
meds = {"me": med(10.0), "near": med(10.0), "far": med(10.0), "cold": med(-5.0)}
|
||||
centres = {"me": (45.0, -110.0), "near": (45.5, -110.0),
|
||||
"far": (30.0, -80.0), "cold": (45.1, -110.0)}
|
||||
got = J.comparables("me", part_of, ["near", "far", "cold"], meds, centres, k=2)
|
||||
self.assertEqual(got, ["near", "far"])
|
||||
|
||||
|
||||
def info(kind="track"):
|
||||
pts = [C.PointNormals(lat=44.0 + i, lon=-110.0, elev_m=1000.0 * (i + 1),
|
||||
tmax_c=tuple(float(v) for v in range(12)))
|
||||
for i in range(4)]
|
||||
return {"points": pts, "kind": kind, "profile": (3500.0, 800.0)}
|
||||
|
||||
|
||||
class PacketTest(unittest.TestCase):
|
||||
def rec(self):
|
||||
return {"id": "tt", "name": "Test Trail", "country": "US", "regions": ["WY"],
|
||||
"length_km": 160.9344, "kind": "trail",
|
||||
"hike": {"summary": "A ridge walk. Best in July. It has huts.",
|
||||
"start": "Trailhead.", "terrain": ["alpine"], "high_point_m": 3000,
|
||||
"days": [8, 10]}}
|
||||
|
||||
def text(self, **kw):
|
||||
args = dict(rec=self.rec(), info=info(), machine=[6, 7, 8],
|
||||
comparables=[], pages=None, precip=None)
|
||||
args.update(kw)
|
||||
return J.packet_text(**args)
|
||||
|
||||
def test_the_packet_states_the_trail_in_miles_and_feet_and_hides_timing(self):
|
||||
t = self.text()
|
||||
self.assertIn("length: 100 miles", t)
|
||||
self.assertIn("high point: 9843 ft", t)
|
||||
self.assertIn("A ridge walk. It has huts.", t)
|
||||
self.assertNotIn("Best in July", t)
|
||||
|
||||
def test_it_never_carries_the_trails_own_season(self):
|
||||
rec = self.rec()
|
||||
rec["hike"].update(season="July to September", months=[7, 8, 9], season_basis="primary")
|
||||
t = self.text(rec=rec)
|
||||
self.assertNotIn("July to September", t)
|
||||
|
||||
def test_it_gives_the_machine_estimate_and_the_climate(self):
|
||||
t = self.text()
|
||||
self.assertIn("Months: 6, 7, 8 (June, July, August)", t)
|
||||
self.assertIn("| Jan |", t)
|
||||
self.assertIn("Precipitation is not available", t)
|
||||
|
||||
def test_precipitation_is_given_when_supplied(self):
|
||||
t = self.text(precip=[[25.4] * 12] * 4)
|
||||
self.assertIn("precip in", t)
|
||||
self.assertNotIn("Precipitation is not available", t)
|
||||
|
||||
def test_what_pages_say_appears_only_when_given(self):
|
||||
self.assertNotIn("What pages say", self.text())
|
||||
self.assertIn("Months each gives: A 5-10", self.text(pages="Publisher(s): A\nMonths each gives: A 5-10"))
|
||||
|
||||
def test_a_trail_with_no_climate_says_so(self):
|
||||
t = self.text(info=dict(info(), points=[]), machine=[])
|
||||
self.assertIn("No climate data is available", t)
|
||||
self.assertIn("Months: none", t)
|
||||
|
||||
|
||||
class AnswersTest(unittest.TestCase):
|
||||
def write(self, text):
|
||||
d = tempfile.mkdtemp()
|
||||
self.addCleanup(shutil.rmtree, d, True)
|
||||
path = os.path.join(d, "a.tsv")
|
||||
with open(path, "w") as f:
|
||||
f.write(text)
|
||||
return path
|
||||
|
||||
def test_good_rows_are_read_and_bad_rows_are_named(self):
|
||||
path = self.write(
|
||||
"aa\t7,8,9\tJuly to September\thigh\tSnow melts.\n"
|
||||
"bb\t\tNone\thigh\tEmpty.\n"
|
||||
"cc\t13\tX\thigh\tOut of range.\n"
|
||||
"dd\t6\tJune\tsure\tBad confidence.\n"
|
||||
"aa\t6\tJune\tlow\tDuplicate.\n"
|
||||
"zz\t6\tJune\tlow\tUnknown.\n"
|
||||
"ee\t5,6\tMay to June\tmedium\tFine.\n")
|
||||
ans, problems = J.read_answers(path, ["aa", "bb", "cc", "dd", "ee"])
|
||||
self.assertEqual(sorted(ans), ["aa", "ee"])
|
||||
self.assertEqual(ans["aa"], ([7, 8, 9], "July to September", "high", "Snow melts."))
|
||||
self.assertEqual(len(problems), 5)
|
||||
|
||||
|
||||
class ScoreTest(unittest.TestCase):
|
||||
def test_matches_are_counted_within_a_month_at_each_end_by_confidence(self):
|
||||
truth = {"a": [6, 7, 8, 9], "b": [6, 7, 8, 9], "c": [6, 7, 8, 9], "d": [1, 2, 3]}
|
||||
ans = {"a": ([6, 7, 8, 9], "", "high", ""), # exact
|
||||
"b": ([7, 8, 9, 10], "", "medium", ""), # one month at each end
|
||||
"c": ([1, 2, 3], "", "low", ""), # wrong
|
||||
"x": ([1], "", "high", "")} # not a sourced trail: ignored
|
||||
got = J.score(ans, truth)
|
||||
self.assertEqual(got["tested"], 4)
|
||||
self.assertEqual(got["matched"], 2)
|
||||
self.assertEqual(got["by_confidence"]["high"], {"tested": 1, "matched": 1})
|
||||
self.assertEqual(got["by_confidence"]["medium"], {"tested": 1, "matched": 1})
|
||||
self.assertEqual(got["by_confidence"]["low"], {"tested": 1, "matched": 0})
|
||||
# d was never answered: it counts as tested and missed
|
||||
self.assertEqual(got["unanswered"], 1)
|
||||
|
||||
def test_the_figure_file_round_trips_and_shares_are_computed(self):
|
||||
figures = {"tested": 148, "matched": 114, "unanswered": 0,
|
||||
"by_confidence": {"high": {"tested": 52, "matched": 48},
|
||||
"medium": {"tested": 76, "matched": 55},
|
||||
"low": {"tested": 20, "matched": 11}}}
|
||||
d = tempfile.mkdtemp()
|
||||
self.addCleanup(shutil.rmtree, d, True)
|
||||
path = os.path.join(d, "t.json")
|
||||
J.write_blind_test(path, figures, "2026-11-20")
|
||||
got = J.load_blind_test(path)
|
||||
self.assertEqual(got["date"], "2026-11-20")
|
||||
self.assertEqual(got["tested"], 148)
|
||||
self.assertEqual(got["matched"], 114)
|
||||
self.assertEqual(got["share"], 0.77)
|
||||
self.assertEqual(got["by_confidence"]["high"]["share"], 0.92)
|
||||
self.assertEqual(got["by_confidence"]["low"]["share"], 0.55)
|
||||
|
||||
def test_a_loaded_file_must_add_up(self):
|
||||
bad = {"date": "2026-11-20", "tested": 10, "matched": 5, "share": 0.5,
|
||||
"by_confidence": {"high": {"tested": 4, "matched": 5, "share": 1.0},
|
||||
"medium": {"tested": 3, "matched": 1, "share": 0.33},
|
||||
"low": {"tested": 3, "matched": 1, "share": 0.33}}}
|
||||
self.assertTrue(J.check_blind_test(bad))
|
||||
|
||||
|
||||
class CommittedFilesTest(unittest.TestCase):
|
||||
def test_the_committed_blind_test_adds_up_and_passes_the_bar(self):
|
||||
got = J.load_blind_test(os.path.join(J.ROOT, "tools", "season_blind_test.json"))
|
||||
self.assertEqual(J.check_blind_test(got), [])
|
||||
self.assertGreaterEqual(got["share"], E.BAR["within1_min"])
|
||||
|
||||
def test_every_judged_row_is_well_formed_and_matches_its_record(self):
|
||||
ids = R.trail_ids(J.ROOT)
|
||||
ans, problems = J.read_answers(os.path.join(J.ROOT, "tools", "season_judged.tsv"), ids)
|
||||
self.assertEqual(problems, [])
|
||||
self.assertEqual(sorted(ans), sorted(ids))
|
||||
for tid in ids:
|
||||
hike = R.load_toml(os.path.join(J.ROOT, tid, "trail.toml")).get("hike") or {}
|
||||
if hike.get("season_basis") == "estimate" or hike.get("season_method"):
|
||||
months, _phrase, conf, _why = ans[tid]
|
||||
self.assertEqual(months, hike["months"], tid)
|
||||
self.assertEqual(J.season.confidence_of(hike["season_method"]), conf, tid)
|
||||
|
||||
|
||||
class ProposalsTest(unittest.TestCase):
|
||||
HIKE = 'start_lonlat = [-110.0, 43.0]\nend_lonlat = [-110.0, 43.2]\n'
|
||||
|
||||
def setUp(self):
|
||||
self.tmp = tempfile.mkdtemp()
|
||||
self.addCleanup(shutil.rmtree, self.tmp, True)
|
||||
self.root = TR.make_repo(self.tmp, trails=[
|
||||
("aaa", "Aaa", {"extra_hike": self.HIKE}),
|
||||
("bbb", "Bbb", {"extra_hike": self.HIKE}),
|
||||
("ccc", "Ccc", {"extra_hike": 'season = "June"\nmonths = [6]\nseason_basis = "source"\n' + self.HIKE}),
|
||||
])
|
||||
self.stage = os.path.join(self.tmp, "stage")
|
||||
os.makedirs(self.stage)
|
||||
self.answers = os.path.join(self.tmp, "judged.tsv")
|
||||
with open(self.answers, "w") as f:
|
||||
f.write("aaa\t7,8,9\tJuly to September\thigh\tSnow melts late.\n"
|
||||
"bbb\t5,6,7,8,9,10\tMay to October\tmedium\tThe pages differ.\n"
|
||||
"ccc\t1,2\tJanuary to February\tlow\tNot used: it has a season.\n")
|
||||
self.pages = os.path.join(self.tmp, "pages.json")
|
||||
with open(self.pages, "w") as f:
|
||||
json.dump({"bbb": {
|
||||
"why": "The pages differ: one says May to September and one says June to October. "
|
||||
"It was set by judgement from both and from the climate.",
|
||||
"sources": [
|
||||
{"url": "https://a.example/bbb", "publisher": "Guide A", "quote": "Season: May to September"},
|
||||
{"url": "https://b.example/bbb", "publisher": "Guide B", "quote": "Season: June to October"}]}}, f)
|
||||
|
||||
def test_only_trails_with_no_season_are_staged(self):
|
||||
n = J.proposals(self.root, self.answers, self.pages, self.stage)
|
||||
self.assertEqual(n, 2)
|
||||
|
||||
def test_collect_and_apply_write_valid_records_with_history(self):
|
||||
J.proposals(self.root, self.answers, self.pages, self.stage)
|
||||
code, out = TR.main(self.root, "--dir", self.stage, "collect")
|
||||
self.assertEqual(code, 0, out)
|
||||
coll = R.load_toml(os.path.join(self.stage, "collected.toml"))
|
||||
self.assertEqual({p["status"] for p in coll["proposal"]}, {"proposed"}, out)
|
||||
with open(os.path.join(self.stage, "owner.csv"), "w") as f:
|
||||
f.write("pid,decision,digest\n")
|
||||
for p in coll["proposal"]:
|
||||
f.write(f"{p['pid']},accept,{p['digest']}\n")
|
||||
code, out = TR.main(self.root, "--dir", self.stage, "collect")
|
||||
self.assertEqual(code, 0, out)
|
||||
code, out = TR.main(self.root, "--dir", self.stage, "apply")
|
||||
self.assertEqual(code, 0, out)
|
||||
a = R.load_toml(os.path.join(self.root, "aaa", "trail.toml"))
|
||||
h = a["hike"]
|
||||
self.assertEqual((h["season"], h["months"], h["season_basis"]),
|
||||
("July to September", [7, 8, 9], "estimate"))
|
||||
self.assertTrue(h["season_method"].endswith("Confidence: high."))
|
||||
self.assertIn("Snow melts late.", h["season_method"])
|
||||
self.assertEqual(len(h["source"]), 3) # two the record had, and the climate data
|
||||
self.assertEqual(h["source"][-1]["facts"], ["season", "months"])
|
||||
self.assertIn("chelsa", h["source"][-1]["url"])
|
||||
errors = []
|
||||
V.check_hike("aaa", a, errors)
|
||||
trail_history.check_entries("aaa", a, errors)
|
||||
# (the fixture's own end-point fields are not what is under test)
|
||||
self.assertEqual([e for e in errors if "lonlat" not in e], [], errors)
|
||||
self.assertTrue(any("hike.season" in (e.get("fields") or []) for e in a["history"]))
|
||||
b = R.load_toml(os.path.join(self.root, "bbb", "trail.toml"))["hike"]
|
||||
self.assertEqual(b["season_basis"], "sources")
|
||||
self.assertIn("The pages differ", b["season_method"])
|
||||
self.assertEqual([s["publisher"] for s in b["source"]][-2:], ["Guide A", "Guide B"])
|
||||
errors = []
|
||||
V.check_hike("bbb", {"hike": b}, errors)
|
||||
self.assertEqual([e for e in errors if "lonlat" not in e], [], errors)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -0,0 +1,185 @@
|
||||
"""Tests for tools/season_model.py: the measure, the thresholds, the
|
||||
comparable trails, the blend and the leave-one-out fit. No network."""
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
|
||||
|
||||
import season_model as M # noqa: E402
|
||||
|
||||
P = M.Params(cold_c_min=5.0, heat_c_max=30.0, k=3, power=1, mix=0.7, cut=0.65)
|
||||
|
||||
|
||||
def med(high, low=None):
|
||||
return (tuple(float(v) for v in high), tuple(float(v) for v in (low or high)))
|
||||
|
||||
|
||||
SUMMER = [-5, -3, 0, 5, 10, 15, 20, 20, 14, 8, 0, -4]
|
||||
WINTER = [14, 16, 20, 26, 33, 39, 42, 41, 36, 28, 20, 15]
|
||||
|
||||
|
||||
class MatchTest(unittest.TestCase):
|
||||
def test_a_single_window_matches_within_one_month_at_each_end(self):
|
||||
self.assertTrue(M.match([6, 7, 8, 9], [6, 7, 8, 9]))
|
||||
self.assertTrue(M.match([5, 6, 7, 8, 9, 10], [6, 7, 8, 9]))
|
||||
self.assertFalse(M.match([4, 5, 6, 7, 8, 9], [6, 7, 8, 9]))
|
||||
self.assertFalse(M.match([], [6, 7, 8, 9]))
|
||||
|
||||
def test_a_season_over_the_year_end_is_one_window(self):
|
||||
self.assertTrue(M.match([11, 12, 1, 2], [12, 1, 2, 3]))
|
||||
|
||||
def test_a_year_round_season_matches_ten_or_more_months(self):
|
||||
year = list(range(1, 13))
|
||||
self.assertTrue(M.match(year, year))
|
||||
self.assertTrue(M.match(list(range(1, 11)), year))
|
||||
self.assertFalse(M.match(list(range(1, 10)), year))
|
||||
|
||||
def test_two_windows_are_compared_window_by_window(self):
|
||||
spring_fall = [3, 4, 5, 9, 10, 11]
|
||||
self.assertTrue(M.match([3, 4, 5, 9, 10, 11], spring_fall))
|
||||
self.assertTrue(M.match([4, 5, 9, 10], spring_fall))
|
||||
# one long window covers the span but is not two windows
|
||||
self.assertFalse(M.match(list(range(3, 12)), spring_fall))
|
||||
# a window with no partner, and a window left over
|
||||
self.assertFalse(M.match([3, 4, 5], spring_fall))
|
||||
self.assertFalse(M.match([3, 4, 5, 7, 9, 10, 11], spring_fall))
|
||||
|
||||
def test_masks_and_lists_agree(self):
|
||||
self.assertEqual(M.to_months(M.to_mask([3, 1, 12])), [1, 3, 12])
|
||||
self.assertEqual(M.match(M.to_mask([6, 7]), [6, 7]), True)
|
||||
|
||||
def test_score_has_the_three_measures(self):
|
||||
a, b, c = M.score([6, 7, 8], [7, 8, 9])
|
||||
self.assertEqual(a, 1.0)
|
||||
self.assertAlmostEqual(b, 10 / 12)
|
||||
self.assertAlmostEqual(c, 2 / 4)
|
||||
self.assertEqual(M.score([1], [1]), (1.0, 1.0, 1.0))
|
||||
|
||||
|
||||
class ThresholdsAndBlendTest(unittest.TestCase):
|
||||
def test_thresholds_use_high_ground_cold_and_low_ground_heat(self):
|
||||
got = M.threshold_mask(med(SUMMER, WINTER), P)
|
||||
# cold: high ground at least 5 in April to October; heat: low
|
||||
# ground at most 30 in October to April
|
||||
self.assertEqual(M.to_months(got), [4, 10])
|
||||
|
||||
def test_a_vote_is_the_weighted_share_of_comparable_trails(self):
|
||||
a = M.Reference("a", med(SUMMER), [6, 7, 8])
|
||||
b = M.Reference("b", med(SUMMER), [7, 8, 9])
|
||||
near = [(0.0, a), (0.0, b)]
|
||||
v = M.vote(near, 1)
|
||||
self.assertEqual(v[5], 0.5)
|
||||
self.assertEqual(v[6], 1.0)
|
||||
self.assertEqual(v[8], 0.5)
|
||||
self.assertEqual(v[0], 0.0)
|
||||
|
||||
def test_closer_trails_weigh_more(self):
|
||||
a = M.Reference("a", med(SUMMER), [6])
|
||||
b = M.Reference("b", med(SUMMER), [7])
|
||||
v = M.vote([(0.0, a), (0.5, b)], 2)
|
||||
self.assertGreater(v[5], v[6])
|
||||
|
||||
def test_nearest_leaves_out_the_trail_itself(self):
|
||||
refs = [M.Reference("self", med(SUMMER), [7]),
|
||||
M.Reference("other", med([x + 1 for x in SUMMER]), [8])]
|
||||
got = M.nearest(med(SUMMER), refs, 5, exclude="self")
|
||||
self.assertEqual([r.id for _d, r in got], ["other"])
|
||||
|
||||
def test_a_trail_inherits_a_cool_season_from_trails_like_it(self):
|
||||
desert = med(WINTER)
|
||||
refs = [M.Reference(f"d{i}", med([x + i * 0.2 for x in WINTER]),
|
||||
[11, 12, 1, 2, 3]) for i in range(4)]
|
||||
near = M.nearest(desert, refs, 3)
|
||||
mask, scores, fell = M.blend(desert, near, P)
|
||||
self.assertEqual(M.to_months(mask), [1, 2, 3, 11, 12])
|
||||
self.assertFalse(fell)
|
||||
|
||||
def test_without_comparable_trails_the_thresholds_stand_alone(self):
|
||||
mask, _s, fell = M.blend(med(SUMMER), [], P)
|
||||
self.assertEqual(M.to_months(mask), [4, 5, 6, 7, 8, 9, 10])
|
||||
self.assertFalse(fell)
|
||||
|
||||
def test_an_empty_result_falls_back_to_three_months_and_says_so(self):
|
||||
arctic = med([-20, -18, -12, -6, -1, 3, 4, 2, -3, -9, -15, -19])
|
||||
mask, _s, fell = M.blend(arctic, [], P)
|
||||
self.assertTrue(fell)
|
||||
self.assertEqual(M.to_months(mask), [6, 7, 8])
|
||||
self.assertEqual(len(M.to_months(mask)), 3)
|
||||
|
||||
def test_months_in_season_is_none_for_a_gap_and_never_empty(self):
|
||||
class Pt:
|
||||
def __init__(self, tmax, elev=100.0):
|
||||
self.tmax_c = tuple(tmax)
|
||||
self.elev_m = elev
|
||||
self.assertIsNone(M.months_in_season([Pt(SUMMER), None], P))
|
||||
self.assertIsNone(M.months_in_season([], P))
|
||||
got = M.months_in_season([Pt([-30] * 12)], P)
|
||||
self.assertEqual(len(got), 3)
|
||||
|
||||
|
||||
class ConfidenceTest(unittest.TestCase):
|
||||
def refs(self, spread):
|
||||
return [M.Reference(f"r{i}", med([x + i * spread for x in SUMMER]), [6, 7, 8, 9])
|
||||
for i in range(4)]
|
||||
|
||||
def test_close_agreeing_comparable_trails_give_high(self):
|
||||
near = M.nearest(med(SUMMER), self.refs(0.1), 4)
|
||||
mask, scores, fell = M.blend(med(SUMMER), near, P)
|
||||
level, why = M.confidence(med(SUMMER), near, scores, fell)
|
||||
self.assertEqual(level, "high", why)
|
||||
|
||||
def test_far_comparable_trails_give_low(self):
|
||||
near = M.nearest(med(SUMMER), self.refs(8.0), 4)
|
||||
mask, scores, fell = M.blend(med(SUMMER), near, P)
|
||||
level, why = M.confidence(med(SUMMER), near, scores, fell)
|
||||
self.assertEqual(level, "low")
|
||||
self.assertIn("far", why)
|
||||
|
||||
def test_disagreeing_comparable_trails_give_low(self):
|
||||
refs = self.refs(0.1)
|
||||
for ref, months in zip(refs, ([4, 5, 6], [7, 8, 9], [5, 6, 7, 8],
|
||||
[6, 7, 8, 9, 10])):
|
||||
ref.mask = M.to_mask(months)
|
||||
near = M.nearest(med(SUMMER), refs, 4)
|
||||
mask, scores, fell = M.blend(med(SUMMER), near, P)
|
||||
level, why = M.confidence(med(SUMMER), near, scores, fell)
|
||||
self.assertEqual(level, "low")
|
||||
self.assertIn("disagree", why)
|
||||
|
||||
def test_no_comparable_trails_is_low(self):
|
||||
self.assertEqual(M.confidence(med(SUMMER), [], [0] * 12, False)[0], "low")
|
||||
|
||||
|
||||
class FitTest(unittest.TestCase):
|
||||
def trails(self):
|
||||
out = []
|
||||
for i in range(8):
|
||||
out.append((f"alpine{i}", med([x + i * 0.3 for x in SUMMER]), [6, 7, 8, 9]))
|
||||
out.append((f"desert{i}", med([x + i * 0.3 for x in WINTER]), [11, 12, 1, 2, 3]))
|
||||
return out
|
||||
|
||||
def test_leave_one_out_predicts_each_trail_from_the_others(self):
|
||||
params, loo = M.fit_model(self.trails())
|
||||
self.assertEqual(len(loo), 16)
|
||||
for tid, (mask, sc) in loo.items():
|
||||
self.assertEqual(sc[0], 1.0, tid)
|
||||
self.assertIsInstance(params, M.Params)
|
||||
|
||||
def test_the_same_input_gives_the_same_fit_twice(self):
|
||||
self.assertEqual(M.fit_model(self.trails()), M.fit_model(self.trails()))
|
||||
|
||||
def test_a_trail_is_never_scored_by_a_model_that_saw_it(self):
|
||||
trails = self.trails()
|
||||
# one alpine trail whose sourced months disagree with its twins:
|
||||
# leave-one-out cannot learn them, so it must not match
|
||||
odd = ("odd", med(SUMMER), [1, 2, 3])
|
||||
_p, loo = M.fit_model(trails + [odd])
|
||||
self.assertEqual(loo["odd"][1][0], 0.0)
|
||||
|
||||
def test_params_round_trip_through_a_dict(self):
|
||||
self.assertEqual(M.Params.from_dict(P.as_dict()), P)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -0,0 +1,87 @@
|
||||
"""Tests over the real records: every trail has a season, with its provenance.
|
||||
|
||||
Run from the repository root:
|
||||
python3 -m unittest discover tools/tests
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
sys.dont_write_bytecode = True
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
import refresh # noqa: E402
|
||||
import season # noqa: E402
|
||||
import validate as V # noqa: E402
|
||||
|
||||
RECORDS = {tid: refresh.load_toml(os.path.join(V.ROOT, tid, "trail.toml"))
|
||||
for tid in refresh.trail_ids(V.ROOT)}
|
||||
|
||||
|
||||
def hikes():
|
||||
for tid, rec in RECORDS.items():
|
||||
yield tid, rec.get("hike") or {}
|
||||
|
||||
|
||||
class EveryTrailHasASeasonTest(unittest.TestCase):
|
||||
def test_every_record_has_season_months_and_a_basis(self):
|
||||
for tid, hike in hikes():
|
||||
self.assertTrue(hike.get("season"), tid)
|
||||
self.assertTrue(hike.get("months"), tid)
|
||||
self.assertIn(hike.get("season_basis"), season.BASES, tid)
|
||||
|
||||
def test_the_basis_fits_the_sources(self):
|
||||
for tid, hike in hikes():
|
||||
errors = []
|
||||
season.check_season(tid, hike, errors)
|
||||
self.assertEqual(errors, [], tid)
|
||||
|
||||
def test_every_estimate_has_a_method_with_its_confidence_and_a_climate_source(self):
|
||||
found = 0
|
||||
for tid, hike in hikes():
|
||||
if hike.get("season_basis") != "estimate":
|
||||
continue
|
||||
found += 1
|
||||
self.assertIn(season.confidence_of(hike.get("season_method")), season.CONFIDENCES, tid)
|
||||
naming = [s for s in hike["source"] if "season" in s["facts"]]
|
||||
self.assertEqual(len(naming), 1, tid)
|
||||
self.assertEqual(naming[0]["facts"], ["season", "months"], tid)
|
||||
self.assertIn("chelsa-climate.org", naming[0]["url"], tid)
|
||||
self.assertGreater(found, 0)
|
||||
|
||||
def test_no_season_from_a_page_cites_climate_data(self):
|
||||
for tid, hike in hikes():
|
||||
if hike.get("season_basis") == "estimate":
|
||||
continue
|
||||
for source in hike.get("source") or []:
|
||||
if "season" in source["facts"]:
|
||||
self.assertNotIn("chelsa", source["url"], tid)
|
||||
|
||||
def test_no_record_says_a_season_is_missing(self):
|
||||
for tid, hike in hikes():
|
||||
for field in ("summary", "caution"):
|
||||
text = str(hike.get(field) or "").lower()
|
||||
self.assertNotIn("no season", text, tid)
|
||||
self.assertNotIn("season on file", text, tid)
|
||||
|
||||
def test_the_estimated_phrase_is_built_from_its_months(self):
|
||||
for tid, hike in hikes():
|
||||
if hike.get("season_basis") == "estimate":
|
||||
self.assertEqual(hike["season"], season.phrase_for(hike["months"]), tid)
|
||||
|
||||
def test_a_season_with_a_method_has_its_confidence_in_the_method(self):
|
||||
judged = [t for t, h in hikes() if h.get("season_method")]
|
||||
self.assertEqual(len(judged), 75)
|
||||
for tid in judged:
|
||||
self.assertTrue(season.confidence_of(RECORDS[tid]["hike"]["season_method"]), tid)
|
||||
|
||||
def test_a_judged_season_changed_its_record_history(self):
|
||||
for tid, hike in hikes():
|
||||
if hike.get("season_method"):
|
||||
changed = [e for e in RECORDS[tid]["history"]
|
||||
if "hike.season_method" in (e.get("fields") or [])]
|
||||
self.assertEqual(len(changed), 1, tid)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -939,6 +939,7 @@ def main():
|
||||
check_guides(tid, guides, errors)
|
||||
check_links(tid, rec, errors)
|
||||
check_hike(tid, rec, errors)
|
||||
season.check_present(tid, rec, errors)
|
||||
check_elevation(tid, tdir, rec, errors)
|
||||
trail_history.check_entries(tid, rec, errors)
|
||||
|
||||
|
||||
+19
-1
@@ -58,13 +58,22 @@ end = "Appalachian Trail atop Blue Mountain near Duncannon, Pennsylvania"
|
||||
shape = "point-to-point"
|
||||
terrain = ["forest", "farmland"]
|
||||
travel = "trail-and-road"
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and September to November"
|
||||
months = [3, 4, 5, 9, 10, 11]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. The Ridge and Valley Appalachians are hot, humid and buggy in summer and icy in winter, so spring and fall are the comfortable months. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.patc.net/tuscarora-trail"
|
||||
publisher = "Potomac Appalachian Trail Club"
|
||||
facts = ["summary", "official_url", "start", "end", "shape", "terrain", "travel"]
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
[[link]]
|
||||
title = "Tuscarora Trail"
|
||||
publisher = "LongTrailsWiki"
|
||||
@@ -110,3 +119,12 @@ basis = "Measured from the trail's main track against the GMBA Mountain Inventor
|
||||
basis_url = "https://www.earthenv.org/mountains"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: March to May and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -67,7 +67,11 @@ official_url = "https://www.freedirtmonger.com/p/vagabond-loop-four-corners-conn
|
||||
start = "Mexican border on the Arizona Trail, Arizona"
|
||||
shape = "loop"
|
||||
terrain = ["desert"]
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "March to October"
|
||||
months = [3, 4, 5, 6, 7, 8, 9, 10]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. A 3,500-mile circuit of Arizona, Utah, Colorado and New Mexico must start in the desert in early spring and cross the high Colorado Trail country in summer, before fall snow. Confidence: low."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.freedirtmonger.com/p/vagabond-loop-four-corners-connection-1.html"
|
||||
@@ -152,6 +156,11 @@ slug = "weminuche-wilderness"
|
||||
basis = "stated"
|
||||
source = "https://www.freedirtmonger.com/p/vagabond-loop-four-corners-connection-1.html"
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -189,3 +198,12 @@ basis = "The page says: \"Hayduke Trail: (844m) *Zion NP-Hack Canyon (70m) ... *
|
||||
basis_url = "https://www.freedirtmonger.com/p/vagabond-loop-four-corners-connection-1.html"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: March to October."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -55,7 +55,11 @@ end_lonlat = [-80.743, 39.92]
|
||||
shape = "point-to-point"
|
||||
terrain = ["farmland"]
|
||||
caution = "The trail passes through private property, and walkers are asked to be courteous to the landowners and the volunteers who maintain it."
|
||||
checked = "2026-11-14"
|
||||
checked = "2026-11-20"
|
||||
season = "March to May and September to November"
|
||||
months = [3, 4, 5, 9, 10, 11]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. Farmland ridges in southwestern Pennsylvania are overgrown, humid and buggy in summer and icy in winter. Confidence: medium."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://visitgreene.org/?p=1265"
|
||||
@@ -78,6 +82,11 @@ slug = "allegheny-plateau"
|
||||
basis = "stated"
|
||||
source = "https://visitgreene.org/?p=1265"
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -106,3 +115,12 @@ basis = "The trail's own description says: \"The Warrior Trail crosses the ridge
|
||||
basis_url = "https://visitgreene.org/?p=1265"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: March to May and September to November."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -70,7 +70,11 @@ terrain = ["alpine", "forest"]
|
||||
travel = "some-cross-country"
|
||||
caution = "The off-trail sections range from straightforward scrambling to heavy bushwhacking, and detailed maps and a compass are essential."
|
||||
days = [11, 11]
|
||||
checked = "2026-11-13"
|
||||
checked = "2026-11-20"
|
||||
season = "July to September"
|
||||
months = [7, 8, 9]
|
||||
season_basis = "estimate"
|
||||
season_method = "Judged from the climate at the trail's elevation and from similar trails. The high Wasatch ridges and off-trail sections hold snow until late June and get early autumn storms, so midsummer fits a whole traverse. Confidence: low."
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.eathomas.com/other-long-trails/wasatchoverview"
|
||||
@@ -101,6 +105,11 @@ slug = "wellsville-mountain-wilderness"
|
||||
basis = "stated"
|
||||
source = "https://www.eathomas.com/other-long-trails/wasatchoverview"
|
||||
|
||||
[[hike.source]]
|
||||
url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
publisher = "WSL (CHELSA) and NOAA NCEI (ETOPO)"
|
||||
facts = ["season", "months"]
|
||||
|
||||
# History of this record, oldest first. Add to it; never rewrite it.
|
||||
# See docs/schema.md, section [[history]].
|
||||
|
||||
@@ -129,3 +138,12 @@ basis = "The trail's own description says: \"The Wasatch Traverse follows the le
|
||||
basis_url = "https://www.eathomas.com/other-long-trails/wasatchoverview"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-20"
|
||||
change = "A season was estimated: July to September."
|
||||
fields = ["hike.season", "hike.months", "hike.season_basis", "hike.season_method"]
|
||||
basis = "No page states a season. It was set by judgement from the climate at the trail's elevation and from similar trails."
|
||||
basis_url = "https://www.chelsa-climate.org/datasets/chelsa_climatologies"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
Loaded 100 of 122 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user