core.common: move stats-related stuff to my.core.stats and add more thorough tests/docs

deprecate core.common.stat and core.common.Stats with backwards compatibility
This commit is contained in:
Dima Gerasimov 2024-08-15 17:51:46 +03:00
parent 1f8c719e6d
commit 242e31b05c
14 changed files with 343 additions and 246 deletions

View file

@ -19,6 +19,7 @@ import re
# pip3 install geopy
import geopy # type: ignore
from my.core import stat, Stats
from my.core.common import LazyLogger
from my.core.cachew import cache_dir, mcachew
@ -164,7 +165,6 @@ def locations(**kwargs) -> Iterable[Location]:
return _iter_locations(path=last_takeout, **kwargs)
from ..core.common import stat, Stats
def stats() -> Stats:
return stat(locations)