o
    }o™i°  ã                   @  sˆ   d dl mZ d dlmZ d dl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 er6d d	lmZ e	 e¡ZG d
d„ dƒZdS )é    )Úannotations)ÚSequenceN)ÚAny)ÚTYPE_CHECKING)Úlogging)Úoptuna_warn)ÚStudyDirection)ÚFrozenTrialc                   @  sh   e Zd ZdZddœd(dd„Zd)dd„Zd)dd„Zd)dd„Zed*d!d"„ƒZ	ed+d$d%„ƒZ
ed,d&d'„ƒZdS )-ÚStudySummaryaë  Basic attributes and aggregated results of a :class:`~optuna.study.Study`.

    See also :func:`optuna.study.get_all_study_summaries`.

    Attributes:
        study_name:
            Name of the :class:`~optuna.study.Study`.
        direction:
            :class:`~optuna.study.StudyDirection` of the :class:`~optuna.study.Study`.

            .. note::
                This attribute is only available during single-objective optimization.
        directions:
            A sequence of :class:`~optuna.study.StudyDirection` objects.
        best_trial:
            :class:`optuna.trial.FrozenTrial` with best objective value in the
            :class:`~optuna.study.Study`.
        user_attrs:
            Dictionary that contains the attributes of the :class:`~optuna.study.Study` set with
            :func:`optuna.study.Study.set_user_attr`.
        system_attrs:
            Dictionary that contains the attributes of the :class:`~optuna.study.Study` internally
            set by Optuna.

            .. warning::
                Deprecated in v3.1.0. ``system_attrs`` argument will be removed in the future.
                The removal of this feature is currently scheduled for v5.0.0,
                but this schedule is subject to change.
                See https://github.com/optuna/optuna/releases/tag/v3.1.0.
        n_trials:
            The number of trials ran in the :class:`~optuna.study.Study`.
        datetime_start:
            Datetime where the :class:`~optuna.study.Study` started.

    N)Ú
directionsÚ
study_nameÚstrÚ	directionúStudyDirection | NoneÚ
best_trialúFrozenTrial | NoneÚ
user_attrsúdict[str, Any]Úsystem_attrsÚn_trialsÚintÚdatetime_startúdatetime.datetime | NoneÚstudy_idr   úSequence[StudyDirection] | Nonec	          
      C  st   || _ |d u r|	d u rtdƒ‚|	d urt|	ƒ| _n|d ur"|g| _ntdƒ‚|| _|| _|| _|| _|| _|| _	d S )Nz,Specify one of `direction` and `directions`.z1Specify only one of `direction` and `directions`.)
r   Ú
ValueErrorÚlistÚ_directionsr   r   Ú_system_attrsr   r   Ú	_study_id)
Úselfr   r   r   r   r   r   r   r   r   © r!   úO/home/ubuntu/.local/lib/python3.10/site-packages/optuna/study/_study_summary.pyÚ__init__8   s   

zStudySummary.__init__Úotherr   ÚreturnÚboolc                 C  s   t |tƒstS |j| jkS ©N)Ú
isinstancer
   ÚNotImplementedÚ__dict__©r    r$   r!   r!   r"   Ú__eq__U   ó   
zStudySummary.__eq__c                 C  s   t |tƒstS | j|jk S r'   ©r(   r
   r)   r   r+   r!   r!   r"   Ú__lt__[   r-   zStudySummary.__lt__c                 C  s   t |tƒstS | j|jkS r'   r.   r+   r!   r!   r"   Ú__le__a   r-   zStudySummary.__le__r   c                 C  s    t | jƒdkrtdƒ‚| jd S )Né   zDThis attribute is not available during multi-objective optimization.r   )Úlenr   ÚRuntimeError©r    r!   r!   r"   r   g   s
   ÿ
zStudySummary.directionúSequence[StudyDirection]c                 C  s   | j S r'   )r   r4   r!   r!   r"   r   p   s   zStudySummary.directionsc                 C  s   t dtƒ | jS )NzÎ`system_attrs` has been deprecated in v3.1.0. The removal of this feature is currently scheduled for v5.0.0, but this schedule is subject to change. See https://github.com/optuna/optuna/releases/tag/v3.1.0.)r   ÚFutureWarningr   r4   r!   r!   r"   r   t   s
   ûzStudySummary.system_attrs)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r$   r   r%   r&   )r%   r   )r%   r5   )r%   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r#   r,   r/   r0   Úpropertyr   r   r   r!   r!   r!   r"   r
      s    /õ


r
   )Ú
__future__r   Úcollections.abcr   ÚdatetimeÚtypingr   r   Úoptunar   Úoptuna._warningsr   Úoptuna.study._study_directionr   Úoptuna.trialr	   Ú
get_loggerr7   Ú_loggerr
   r!   r!   r!   r"   Ú<module>   s    
