# Path: tia/analysis/util.py
# def per_series(result_is_frame=0):
#     def _ps(fct):
#         return PerSeries(fct, result_is_frame=result_is_frame)
# 
#     return _ps
# 
# def per_level():
#     def _pl(fct):
#         return PerLevel(fct)
# 
#     return _pl


import talib
import pandas as pd
from tia.analysis.util import per_series, per_level
"""

help to interface with ta-lib dealing with NaNs and returning timeseries and such

"""



@per_level()
def _frame_to_series(frame, colnames, fct, *fctargs):
    args = [frame[c].values for c in colnames]
    args.extend(fctargs)
    values = fct(*args)
    return pd.Series(values, index=frame.index)



# Path: tia/analysis/util.py
# def per_series(result_is_frame=0):
#     def _ps(fct):
#         return PerSeries(fct, result_is_frame=result_is_frame)
# 
#     return _ps
# 
# def per_level():
#     def _pl(fct):
#         return PerLevel(fct)
# 
#     return _pl


# Path: tia/analysis/talib_wrapper.py
import talib
import pandas as pd
from tia.analysis.util import per_series, per_level

"""

help to interface with ta-lib dealing with NaNs and returning timeseries and such

"""



@per_level()
def _frame_to_series(frame, colnames, fct, *fctargs):
    args = [frame[c].values for c in colnames]
    args.extend(fctargs)
    values = fct(*args)
    return pd.Series(values, index=frame.index)



@per_level()