location fallback (#263)
see https://github.com/karlicoss/HPI/issues/262 * move home to fallback/via_home.py * move via_ip to fallback * add fallback model * add stub via_ip file * add fallback_locations for via_ip * use protocol for locations * estimate_from helper, via_home estimator, all.py * via_home: add accuracy, cache history * add datasources to gpslogger/google_takeout * tz/via_location.py: update import to fallback * denylist docs/installation instructions * tz.via_location: let user customize cachew refresh time * add via_ip.estimate_location using binary search * use estimate_location in via_home.get_location * tests: add gpslogger to location config stub * tests: install tz related libs in test env * tz: add regression test for broken windows dates * vendorize bisect_left from python src doesnt have a 'key' parameter till python3.10
This commit is contained in:
parent
6dc5e7575f
commit
98b086f746
25 changed files with 1166 additions and 190 deletions
|
@ -72,16 +72,18 @@ class google:
|
|||
|
||||
|
||||
from typing import Sequence, Union, Tuple
|
||||
from datetime import datetime, date
|
||||
from datetime import datetime, date, timedelta
|
||||
DateIsh = Union[datetime, date, str]
|
||||
LatLon = Tuple[float, float]
|
||||
class location:
|
||||
# todo ugh, need to think about it... mypy wants the type here to be general, otherwise it can't deduce
|
||||
# and we can't import the types from the module itself, otherwise would be circular. common module?
|
||||
home: Union[LatLon, Sequence[Tuple[DateIsh, LatLon]]] = (1.0, -1.0)
|
||||
home_accuracy = 30_000.0
|
||||
|
||||
class via_ip:
|
||||
accuracy: float
|
||||
for_duration: timedelta
|
||||
|
||||
class gpslogger:
|
||||
export_path: Paths = ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue