Write a season for the 75 trails that had none: 69 estimates and 6 set from pages that differ
This commit is contained in:
1 parent
40f4cd43c4
commit
191b5cfc4f
79 files changed
+1468
-88
No files matched your search
+4
-4
@@ -204,7 +204,8 @@ def phrase_for(months):
|
||||
|
||||
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".
|
||||
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:
|
||||
@@ -220,9 +221,8 @@ def phrase_for(months):
|
||||
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]
|
||||
first = span(got)[0]
|
||||
while runs and runs[0][0] != first:
|
||||
runs.append(runs.pop(0))
|
||||
# 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
|
||||
|
||||
@@ -145,7 +145,7 @@ ocean-to-lake 1,2,3,11,12 November to March high South Florida is hot, wet and b
|
||||
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 October to November and March to May 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.
|
||||
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.
|
||||
|
||||
|
@@ -41,7 +41,10 @@ class SeasonFitFileTest(unittest.TestCase):
|
||||
self.assertEqual(fit["rule_version"], E.RULE_VERSION)
|
||||
self.assertEqual(fit["passes"], E.passes_bar(fit["loo"], fit["bar"]))
|
||||
|
||||
def test_estimates_only_with_a_passing_fit(self):
|
||||
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"))
|
||||
@@ -49,12 +52,10 @@ class SeasonFitFileTest(unittest.TestCase):
|
||||
estimated.append(tid)
|
||||
if not estimated:
|
||||
self.skipTest("no estimated seasons on file yet")
|
||||
fit = load_fit()
|
||||
self.assertTrue(fit["passes"], fit)
|
||||
held = fit["loo"]
|
||||
self.assertGreaterEqual(held["within1"] / held["n"],
|
||||
E.BAR["within1_min"])
|
||||
|
||||
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()
|
||||
@@ -54,6 +54,10 @@ class PhraseTest(unittest.TestCase):
|
||||
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")
|
||||
|
||||
|
||||
Reference in new issue
Block a user