Simplify return home heuristics now that we have comprehensive travel data

Remove complex country-based return home assumptions since we now track actual train and ferry travel back to the UK. The system can rely on real travel data rather than heuristics.

- Remove NEARBY_BALKAN_COUNTRIES constant
- Remove geographic assumptions about returning home after trips
- Keep only UK trip ending logic (if trip ends in UK, you're home)

With complete train/ferry tracking, actual return travel is captured rather than inferred.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Edward Betts 2025-07-16 11:16:33 +02:00
parent e370049bcb
commit f396d8a62f

View file

@ -11,20 +11,6 @@ from . import events_yaml, get_country, travel
from .event import Event
from .types import StrDict, Trip
NEARBY_BALKAN_COUNTRIES = {
"GR",
"AL",
"XK",
"HR",
"SI",
"MK",
"BA",
"ME",
"RS",
"BG",
"RO",
}
def busy_event(e: Event) -> bool:
"""Busy."""
@ -522,19 +508,6 @@ def _check_return_home_heuristic(
if hasattr(final_country, "alpha_2") and final_country.alpha_2 == "GB":
return (None, get_country("gb"))
# For short trips to nearby countries or international trips
# (ended >=1 day ago), assume returned home if no subsequent travel data
if days_since_trip >= 1 and (
# European countries (close by rail/ferry)
final_alpha_2 in {"BE", "NL", "FR", "DE", "CH", "AT", "IT", "ES"}
# Nearby Balkan countries
or final_alpha_2 in NEARBY_BALKAN_COUNTRIES
# International trips (assume return home after trip ends)
or final_alpha_2
in {"US", "CA", "IN", "JP", "CN", "AU", "NZ", "BR", "AR", "ZA"}
):
return (None, get_country("gb"))
return None