# Path: alphaware/const.py
# INDEX_FACTOR = namedtuple('INDEX_FACTOR', ['date_index', 'sec_index', 'full_index', 'col_score'])
# 
# Path: alphaware/enums.py
# class FreqType(StrEnum):
#     EOD = 'D'
#     EOW = 'W'
#     EOM = 'M'
#     EOQ = 'Q'
#     EOSY = 'S'
#     EOY = 'Y'
# 
# class OutputDataFormat(IntEnum):
#     MULTI_INDEX_DF = 0
#     PITVOT_TABLE_DF = 1
# 
# Path: alphaware/utils/input_validation.py
# @expect_types(arg=(list, np.ndarray, pd.DataFrame, pd.Series))
# def ensure_pd_df(func, argname, arg):
#     if isinstance(arg, pd.DataFrame):
#         return arg
#     else:
#         return pd.DataFrame(arg)


import pandas as pd
import numpy as np
from argcheck import (expect_types,
                      optional,
                      preprocess)
from xutils import py_assert
from alphaware.const import INDEX_FACTOR
from alphaware.enums import (FreqType,
                             OutputDataFormat)
from .input_validation import ensure_pd_df
# -*- coding: utf-8 -*-



@expect_types(data=(pd.Series, pd.DataFrame))
def convert_df_format(data, target_format=OutputDataFormat.MULTI_INDEX_DF, col_name='factor',
                      multi_index=INDEX_FACTOR):

# Path: alphaware/const.py
# INDEX_FACTOR = namedtuple('INDEX_FACTOR', ['date_index', 'sec_index', 'full_index', 'col_score'])
# 
# Path: alphaware/enums.py
# class FreqType(StrEnum):
#     EOD = 'D'
#     EOW = 'W'
#     EOM = 'M'
#     EOQ = 'Q'
#     EOSY = 'S'
#     EOY = 'Y'
# 
# class OutputDataFormat(IntEnum):
#     MULTI_INDEX_DF = 0
#     PITVOT_TABLE_DF = 1
# 
# Path: alphaware/utils/input_validation.py
# @expect_types(arg=(list, np.ndarray, pd.DataFrame, pd.Series))
# def ensure_pd_df(func, argname, arg):
#     if isinstance(arg, pd.DataFrame):
#         return arg
#     else:
#         return pd.DataFrame(arg)


# Path: alphaware/utils/pandas_utils.py
import pandas as pd
import numpy as np
from argcheck import (expect_types,
                      optional,
                      preprocess)
from xutils import py_assert
from alphaware.const import INDEX_FACTOR
from alphaware.enums import (FreqType,
                             OutputDataFormat)
from .input_validation import ensure_pd_df

# -*- coding: utf-8 -*-



@expect_types(data=(pd.Series, pd.DataFrame))
def convert_df_format(data, target_format=OutputDataFormat.MULTI_INDEX_DF, col_name='factor',
                      multi_index=INDEX_FACTOR):

    if target_format == OutputDataFormat.MULTI_INDEX_DF: