"""Base class for SHADHO task managers.

Classes
-------
Manager
    Base class for task managers.
"""


class Manager():
    """Base class for task managers.

    Notes
    -----
    To implement a new local or distributed manager, create an __init__
    method and override all 
    """
    def __init__(self):
        pass

    def add_task(self, tag, cmd, params):
        """Add a task for the manger to run.

        Override this with all of the arguments necessary to run the task.

        Parameters
        ----------
        cmd
            Command or function to run in the task.
        tag : str
            Task id generated by SHADHO.
        params : dict
            Generarted hyperparameters to send to the task.
        """
        raise NotImplementedError

    def can_accept_tasks(self):
        """
        """
        raise NotImplementedError

    def handle_success(self):
        """
        """
        raise NotImplementedError

    def handle_failure(self):
        """
        """
        raise NotImplementedError

    def run_task(self):
        """
        """
        raise NotImplementedError