Ë
    ÿÿæi   ã                  óÚ   — 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 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 d dlmZ d dlmZ d dlmZ dZ G d„ de«      Zy)é    )Úannotations)ÚSequenceN)ÚAny)Úoverload)Údistributions)Úconvert_positional_args)Údeprecated_func)Úoptuna_warn)ÚBaseDistribution)ÚCategoricalChoiceType)ÚCategoricalDistribution)ÚFloatDistribution)ÚIntDistribution)Ú_SUGGEST_INT_POSITIONAL_ARGS)Ú	BaseTrialz Use suggest_float{args} instead.c                  ó†  — e Zd ZdZd)d*d„Zdddœ	 	 	 	 	 	 	 	 	 	 	 d+d„Z eddej                  d	¬
«      ¬«      d,d„«       Z	 eddej                  d¬
«      ¬«      d,d„«       Z
 eddej                  d¬
«      ¬«      d-d„«       Z eedd¬«      dddœ	 	 	 	 	 	 	 	 	 	 	 d.d„«       Zed/d„«       Zed0d„«       Zed1d„«       Zed2d„«       Zed3d„«       Ze	 	 	 	 	 	 d4d„«       Z	 	 	 	 	 	 d4d„Zd5d„Zd6d„Zd7d„Z ed d«      d7d!„«       Zd8d"„Zed9d#„«       Zed:d$„«       Zed9d%„«       Zed9d&„«       Zed;d'„«       Zed<d(„«       Zy)=Ú
FixedTriala}  A trial class which suggests a fixed value for each parameter.

    This object has the same methods as :class:`~optuna.trial.Trial`, and it suggests pre-defined
    parameter values. The parameter values can be determined at the construction of the
    :class:`~optuna.trial.FixedTrial` object. In contrast to :class:`~optuna.trial.Trial`,
    :class:`~optuna.trial.FixedTrial` does not depend on :class:`~optuna.study.Study`, and it is
    useful for deploying optimization results.

    Example:

        Evaluate an objective function with parameter values given by a user.

        .. testcode::

            import optuna


            def objective(trial):
                x = trial.suggest_float("x", -100, 100)
                y = trial.suggest_categorical("y", [-1, 0, 1])
                return x**2 + y


            assert objective(optuna.trial.FixedTrial({"x": 1, "y": 0})) == 1


    .. note::
        Please refer to :class:`~optuna.trial.Trial` for details of methods and properties.

    Args:
        params:
            A dictionary containing all parameters.
        number:
            A trial number. Defaults to ``0``.

    c                óž   — || _         i | _        i | _        i | _        i | _        t
        j
                  j                  «       | _        || _        y ©N)	Ú_paramsÚ_suggested_paramsÚ_distributionsÚ_user_attrsÚ_system_attrsÚdatetimeÚnowÚ_datetime_startÚ_number)ÚselfÚparamsÚnumbers      úh/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/optuna/trial/_fixed.pyÚ__init__zFixedTrial.__init__>   sG   € ØˆŒØ13ˆÔØ;=ˆÔØ+-ˆÔØ-/ˆÔÜ'×0Ñ0×4Ñ4Ó6ˆÔØˆ�ó    NF)ÚstepÚlogc          	     ó@   — | j                  |t        ||||¬«      «      S ©N)r&   r%   )Ú_suggestr   ©r   ÚnameÚlowÚhighr%   r&   s         r"   Úsuggest_floatzFixedTrial.suggest_floatG   s!   € ð �}‰}˜TÔ#4°S¸$ÀCÈdÔ#SÓTÐTr$   z3.0.0z6.0.0Ú )Úargs)Útextc                ó(   — | j                  |||«      S r   ©r.   ©r   r+   r,   r-   s       r"   Úsuggest_uniformzFixedTrial.suggest_uniformR   s   € à×!Ñ! $¨¨TÓ2Ð2r$   z(..., log=True)c                ó,   — | j                  |||d¬«      S )NT)r&   r3   r4   s       r"   Úsuggest_loguniformzFixedTrial.suggest_loguniformV   s   € à×!Ñ! $¨¨T°tÐ!Ó<Ð<r$   z(..., step=...)c                ó,   — | j                  ||||¬«      S )N)r%   r3   )r   r+   r,   r-   Úqs        r"   Úsuggest_discrete_uniformz#FixedTrial.suggest_discrete_uniformZ   s   € à×!Ñ! $¨¨T¸Ð!Ó:Ð:r$   z3.5.0z5.0.0)Úprevious_positional_arg_namesÚdeprecated_versionÚremoved_versioné   c               óR   — t        | j                  |t        ||||¬«      «      «      S r(   )Úintr)   r   r*   s         r"   Úsuggest_intzFixedTrial.suggest_int^   s&   € ô �4—=‘= ¤°s¸DÀcÐPTÔ'UÓVÓWÐWr$   c                 ó   — y r   © ©r   r+   Úchoicess      r"   Úsuggest_categoricalzFixedTrial.suggest_categoricalh   ó   € ØORr$   c                 ó   — y r   rC   rD   s      r"   rF   zFixedTrial.suggest_categoricalk   rG   r$   c                 ó   — y r   rC   rD   s      r"   rF   zFixedTrial.suggest_categoricaln   ó   € ØMPr$   c                 ó   — y r   rC   rD   s      r"   rF   zFixedTrial.suggest_categoricalq   s   € ØQTr$   c                 ó   — y r   rC   rD   s      r"   rF   zFixedTrial.suggest_categoricalt   rJ   r$   c                 ó   — y r   rC   rD   s      r"   rF   zFixedTrial.suggest_categoricalw   s   € ð !$r$   c                ó:   — | j                  |t        |¬«      «      S )N)rE   )r)   r   rD   s      r"   rF   zFixedTrial.suggest_categorical|   s   € ð �}‰}˜TÔ#:À7Ô#KÓLÐLr$   c                 ó   — y r   rC   )r   Úvaluer%   s      r"   ÚreportzFixedTrial.report�   s   € Ør$   c                 ó   — y)NFrC   ©r   s    r"   Úshould_prunezFixedTrial.should_prune„   s   € Ør$   c                ó"   — || j                   |<   y r   ©r   ©r   ÚkeyrP   s      r"   Úset_user_attrzFixedTrial.set_user_attr‡   s   € Ø %ˆ×Ñ˜Òr$   z3.1.0c                ó"   — || j                   |<   y r   ©r   rW   s      r"   Úset_system_attrzFixedTrial.set_system_attrŠ   s   € à"'ˆ×Ñ˜3Òr$   c           	     ój  — || j                   vrt        d|› d�«      ‚| j                   |   }|j                  |«      }|j                  |«      st	        d|› d|› d|› d�«       || j
                  v r#t        j                  | j
                  |   |«       || j                  |<   || j
                  |<   |S )NzThe value of the parameter 'zK' is not found. Please set it at the construction of the FixedTrial object.z
The value z of the parameter 'z*' is out of the range of the distribution Ú.)	r   Ú
ValueErrorÚto_internal_reprÚ	_containsr
   r   r   Ú check_distribution_compatibilityr   )r   r+   ÚdistributionrP   Úparam_value_in_internal_reprs        r"   r)   zFixedTrial._suggestŽ   sÕ   € Ø�t—|‘|Ñ#ÜØ.¨t¨fð 5=ð =óð ð
 —‘˜TÑ"ˆØ'3×'DÑ'DÀUÓ'KÐ$Ø×%Ñ%Ð&BÔCÜØ˜U˜GÐ#6°t°fð =1Ø1=°¸aðAôð
 �4×&Ñ&Ñ&Ü×:Ñ:¸4×;NÑ;NÈtÑ;TÐVbÔcà',ˆ×Ñ˜tÑ$Ø$0ˆ×Ñ˜DÑ!àˆr$   c                ó   — | j                   S r   )r   rS   s    r"   r    zFixedTrial.params¥   s   € à×%Ñ%Ð%r$   c                ó   — | j                   S r   )r   rS   s    r"   r   zFixedTrial.distributions©   s   € à×"Ñ"Ð"r$   c                ó   — | j                   S r   rV   rS   s    r"   Ú
user_attrszFixedTrial.user_attrs­   s   € à×ÑÐr$   c                ó   — | j                   S r   r[   rS   s    r"   Úsystem_attrszFixedTrial.system_attrs±   s   € à×!Ñ!Ð!r$   c                ó   — | j                   S r   )r   rS   s    r"   Údatetime_startzFixedTrial.datetime_startµ   s   € à×#Ñ#Ð#r$   c                ó   — | j                   S r   )r   rS   s    r"   r!   zFixedTrial.number¹   s   € à�|‰|Ðr$   )r   )r    údict[str, Any]r!   r@   ÚreturnÚNone)r+   Ústrr,   Úfloatr-   rr   r%   zfloat | Noner&   Úboolro   rr   )r+   rq   r,   rr   r-   rr   ro   rr   )
r+   rq   r,   rr   r-   rr   r9   rr   ro   rr   )r+   rq   r,   r@   r-   r@   r%   r@   r&   rs   ro   r@   )r+   rq   rE   zSequence[None]ro   rp   )r+   rq   rE   zSequence[bool]ro   rs   )r+   rq   rE   zSequence[int]ro   r@   )r+   rq   rE   zSequence[float]ro   rr   )r+   rq   rE   zSequence[str]ro   rq   )r+   rq   rE   zSequence[CategoricalChoiceType]ro   r   )rP   rr   r%   r@   ro   rp   )ro   rs   )rX   rq   rP   r   ro   rp   )r+   rq   rc   r   ro   r   )ro   rn   )ro   zdict[str, BaseDistribution])ro   zdatetime.datetime | None)ro   r@   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r#   r.   r	   Ú_suggest_deprecated_msgÚformatr5   r7   r:   r   r   rA   r   rF   rQ   rT   rY   r\   r)   Úpropertyr    r   rh   rj   rl   r!   rC   r$   r"   r   r      s€  „ ñ#ôJð "Øñ	Uàð	Uð ð	Uð ð		Uð ð	Uð ð	Uð 
ó	Uñ �W˜gÐ,C×,JÑ,JÐPRÐ,JÓ,SÔTò3ó Uð3ñ �W˜gÐ,C×,JÑ,JÐPaÐ,JÓ,bÔcò=ó dð=ñ �W˜gÐ,C×,JÑ,JÐPaÐ,JÓ,bÔcò;ó dð;ñ Ø&BØ"Øôð >?ÈEñXØðXØ!ðXØ),ðXØ7:ðXØEIðXà	òXóð
Xð
 ÚRó ØRàÚRó ØRàÚPó ØPàÚTó ØTàÚPó ØPàð$Øð$Ø"Að$à	ò$ó ð$ðMØðMØ"AðMà	óMó
óó&ñ �W˜gÓ&ò(ó 'ð(óð. ò&ó ð&ð ò#ó ð#ð ò ó ð ð ò"ó ð"ð ò$ó ð$ð òó ñr$   r   )Ú
__future__r   Úcollections.abcr   r   Útypingr   r   Úoptunar   Úoptuna._convert_positional_argsr   Úoptuna._deprecatedr	   Úoptuna._warningsr
   Úoptuna.distributionsr   r   r   r   r   Úoptuna.trial._baser   r   rx   r   rC   r$   r"   Ú<module>r„      sK   ðÝ "å $Û Ý Ý å  Ý CÝ .Ý (Ý 1Ý 6Ý 8Ý 2Ý 0Ý ;Ý (ð =Ð ôc�õ cr$   