# Path: dynts/dsl/functions/registry.py
# class FunctionBase(ASTFunctionBase):
#     '''Base class for a timeseries function implementation.
# The only member function to implement is the ``__call__`` method.
# 
#     .. function:: __call__(args, **kwargs)
# 
#         where *args* is a list of arguments (timeseries or other objects) and
#         *kwargs* is a dictionary of input parameters.
#         For example, the rolling-standard deviation is defined as::
# 
#             std(expression,window=20)
#     '''
#     abstract = True
#     description = ''
# 
#     def __str__(self):
#         return self.name
# 
#     def __repr__(self):
#         return self.name


from .registry import FunctionBase



class ScalarFunction(FunctionBase):
    abstract = True

    def get_name(self, arg, window, **kwargs):
        return '%s(%s)' % (self.name,arg)

    def __call__(self, args, window=20, **kwargs):
        result = []
        for arg in args:
            name = self.get_name(arg, window, **kwargs)

# Path: dynts/dsl/functions/registry.py
# class FunctionBase(ASTFunctionBase):
#     '''Base class for a timeseries function implementation.
# The only member function to implement is the ``__call__`` method.
# 
#     .. function:: __call__(args, **kwargs)
# 
#         where *args* is a list of arguments (timeseries or other objects) and
#         *kwargs* is a dictionary of input parameters.
#         For example, the rolling-standard deviation is defined as::
# 
#             std(expression,window=20)
#     '''
#     abstract = True
#     description = ''
# 
#     def __str__(self):
#         return self.name
# 
#     def __repr__(self):
#         return self.name


# Path: dynts/dsl/functions/simple.py
from .registry import FunctionBase



class ScalarFunction(FunctionBase):
    abstract = True

    def get_name(self, arg, window, **kwargs):
        return '%s(%s)' % (self.name,arg)

    def __call__(self, args, window=20, **kwargs):
        result = []
        for arg in args:
            name = self.get_name(arg, window, **kwargs)

            ts = self.apply(arg, window=window, name=name, **kwargs)
