from abc import abstractmethod

from numpy.typing import ArrayLike
from typing import Any


class Metric:
    def __init__(self) -> None:
        self._score = None

    def get_score(self):
        return self._score

    @abstractmethod
    def _update(self, x: ArrayLike, y: ArrayLike):
        raise NotImplementedError()

    def __call__(self, x: ArrayLike, y: ArrayLike) -> Any:
        self._update(x, y)