o
    qoi<                     @   sx   d Z ddlmZ ddlmZmZmZmZ ddlm	Z	 ddl
mZ ddlmZ ddlmZ dd	lmZ G d
d deZdS )z
Sweeper plugin interface
    )abstractmethod)AnyListSequenceOptional)TaskFunction)
DictConfig   )Launcher)Plugin)HydraContextc                	   @   s   e Zd ZU dZee ed< ee ed< ee ed< e	dede
deddfdd	Ze	d
ee defddZdeee  ddfddZdS )Sweeperz
    An abstract sweeper interface
    Sweeper takes the command line arguments, generates a and launches jobs
    (where each job typically takes a different command line arguments)
    hydra_contextconfiglaunchertask_functionreturnNc                C   s   t  )N)NotImplementedError)selfr   r   r    r   I/home/ubuntu/.local/lib/python3.10/site-packages/hydra/plugins/sweeper.pysetup   s   zSweeper.setup	argumentsc                 C   s   dS )a.  
        Execute a sweep
        :param arguments: list of strings describing what this sweeper should do.
        exact structure is determine by the concrete Sweeper class.
        :return: the return objects of all thy launched jobs. structure depends on the Sweeper
        implementation.
        Nr   )r   r   r   r   r   sweep%   s   	zSweeper.sweepbatchc                 C   s^   t | dr| jdur| jjn| j}|dusJ | jdusJ |D ]}|j| jt|d q dS )z
        Ensures that the given batch can be composed.
        This repeat work the launcher will do, but as the launcher may be performing this in a different
        process/machine it's important to do it here as well to detect failures early.
        r   N)master_configsweep_overrides)hasattrr   config_loaderr   load_sweep_configlist)r   r   r   	overridesr   r   r   validate_batch_is_legal0   s   

zSweeper.validate_batch_is_legal)__name__
__module____qualname____doc__r   r   __annotations__r   r
   r   r   r   r   strr   r   r   r"   r   r   r   r   r      s$   
 	
r   N)r&   abcr   typingr   r   r   r   hydra.typesr   	omegaconfr   r   r
   pluginr   r   r   r   r   r   r   <module>   s   