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:
parent
18529257e7
commit
c45c51af22
14 changed files with 343 additions and 246 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@ from typing import Iterator
|
|||
from my.google.takeout.parser import events, _cachew_depends_on
|
||||
from google_takeout_parser.models import Location as GoogleLocation
|
||||
|
||||
from my.core import stat, Stats, LazyLogger
|
||||
from my.core.cachew import mcachew
|
||||
from my.core.common import LazyLogger, stat, Stats
|
||||
from .common import Location
|
||||
|
||||
logger = LazyLogger(__name__)
|
||||
|
|
|
@ -12,9 +12,8 @@ from typing import Iterator, List
|
|||
from my.google.takeout.parser import events, _cachew_depends_on as _parser_cachew_depends_on
|
||||
from google_takeout_parser.models import PlaceVisit as SemanticLocation
|
||||
|
||||
from my.core import dataclass, make_config
|
||||
from my.core import dataclass, make_config, stat, LazyLogger, Stats
|
||||
from my.core.cachew import mcachew
|
||||
from my.core.common import LazyLogger, Stats, stat
|
||||
from my.core.error import Res
|
||||
from .common import Location
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue