Filter: alle / Nahverkehr / Fernverkehr
Einteilung nach Gattung (Schweiz: route_desc, Deutschland: Präfix der Linie): ICE, IC, EC, ECE, EN, NJ, RJ(X), TGV, IR, … = Fernverkehr. Auswahl bleibt im Browser gespeichert. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X48pE4bzjHej8w9HyZXCjb
This commit is contained in:
+6
-1
@@ -110,7 +110,7 @@ def test_all():
|
||||
assert len(v) == 1 and v[0]["properties"]["delay"] is None
|
||||
lon, lat = v[0]["geometry"]["coordinates"]
|
||||
assert lat < 47.0 and abs(lon - 8.05) < 0.01, (lon, lat) # halbe Fahrzeit = Umweg-Scheitelpunkt
|
||||
assert v[0]["properties"]["next"] == "Beta"
|
||||
assert v[0]["properties"]["next"] == "Beta" and v[0]["properties"]["fv"] is True # IC = Fernverkehr
|
||||
assert abs(v[0]["properties"]["heading"] - 90) < 15, v[0]["properties"]["heading"] # Scheitel: Richtung Osten
|
||||
assert f.vehicles(at(8, 11), {})[0]["properties"]["heading"] is not None # auch im Stillstand
|
||||
|
||||
@@ -150,6 +150,11 @@ def test_all():
|
||||
assert len(v) == 1 and v[0]["properties"]["to"] == "Gamma" and v[0]["properties"]["nr"] == ""
|
||||
assert de.vehicles(dt.datetime(2026, 10, 25, 8, 5, tzinfo=TZ).timestamp(), {}) == [] # calendar_dates
|
||||
|
||||
from trainpulse.feed import long_distance
|
||||
assert long_distance("", "ICE 75") and long_distance("IR", "IR36") and long_distance("", "ECE 20")
|
||||
assert not long_distance("S", "S5") and not long_distance("", "RE6") and not long_distance("", "IRE 3")
|
||||
assert not long_distance("TER", "K1") and not long_distance("", "")
|
||||
|
||||
from trainpulse.border import SHOW, in_switzerland
|
||||
assert in_switzerland(8.540, 47.378) and not in_switzerland(9.177, 47.659) # Zürich HB / Konstanz
|
||||
assert not in_switzerland(8.690, 47.697) # Büsingen (deutsche Exklave)
|
||||
|
||||
Reference in New Issue
Block a user