project/analyzers/__init__.py

25 lines
820 B
Python

from .analyzer import Analyzer, Result
from .analyzer.biogames import BoardDurationAnalyzer
from .analyzer.default import LogEntryCountAnalyzer, LocationAnalyzer, LogEntrySequenceAnalyzer, ActionSequenceAnalyzer
from .analyzer.locomotion import LocomotionActionAnalyzer, CacheSequenceAnalyzer
from .analyzer.mask import MaskSpatials
from .render import Render
from .render.default import PrintRender
from .render.locomotion import LocomotionActionRelativeRender, LocomotionActionAbsoluteRender, \
LocomotionActionRatioRender
__FALLBACK__ = PrintRender
__MAPPING__ = {
LocomotionActionAnalyzer: [
LocomotionActionAbsoluteRender,
LocomotionActionRelativeRender,
LocomotionActionRatioRender],
}
def get_renderer(cls: type) -> [type]:
if cls not in __MAPPING__:
return [__FALLBACK__]
return __MAPPING__[cls]