def accepts_one_row(func):
    """
    Method decorator for functions that process a 2-d array.
    Adds the possibility of being called with a 1-d array (a single row) and
    returning a 1-d array (first row of the result)
    """
    def process(self, arr):
        if arr.ndim == 1:
            return func(self, [arr])[0]
        else:
            return func(self, arr)
    return process