# Copyright 2025 The Meridian Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""`Converter` class for all dataframe converters."""

import abc
from collections.abc import Iterator

from scenarioplanner.converters import mmm
import pandas as pd


__all__ = ["Converter"]


class Converter(abc.ABC):
  """Converts a trained model and analyses to one or more data frame tables.

  Attributes:
    mmm: An `Mmm` proto wrapper.
  """

  def __init__(
      self,
      mmm_wrapper: mmm.Mmm,
  ):
    self._mmm = mmm_wrapper

  @abc.abstractmethod
  def __call__(self) -> Iterator[tuple[str, pd.DataFrame]]:
    raise NotImplementedError()
