# -*- coding: utf-8 -*-
"""
@author: yq
@time: 2024/11/1
@desc:  常用指标实体集合
"""
from typing import Union

import pandas as pd


class MetricFucResultEntity():
    """
    指标计算函数结果类
    """

    def __init__(self, table: pd.DataFrame = None, value: str = None, image_path: Union[str, list] = None,
                 table_font_size=12, table_autofit=False, table_cell_width=None, image_size: int = 6):
        self._table = table
        self._table_font_size = table_font_size
        self._table_cell_width = table_cell_width
        self._table_autofit = table_autofit

        self._value = value
        self._image_path = image_path
        self._image_size = image_size

    @property
    def table_cell_width(self):
        return self._table_cell_width

    @property
    def table_autofit(self):
        return self._table_autofit

    @property
    def table_font_size(self):
        return self._table_font_size

    @property
    def table(self) -> pd.DataFrame:
        return self._table

    @property
    def value(self):
        return self._value

    @property
    def image_path(self):
        return self._image_path

    @property
    def image_size(self):
        return self._image_size


class MetricConfigEntity():
    def __init__(self, metric_code: str, metric_func: str, *args, **kwargs):
        self._args = args
        self._kwargs = kwargs
        # metric_code 用于填充模板时查找
        self._metric_code = metric_code
        # metric_func 用于查找对应的指标计算函数
        self._metric_func = metric_func

    @property
    def args(self):
        return self._args

    @property
    def kwargs(self):
        return self._kwargs

    @property
    def metric_code(self):
        return self._metric_code

    @property
    def metric_func(self):
        return self._metric_func


if __name__ == "__main__":
    pass
