
    -ji                     (   S SK Jr  S SKJr  S SKJr  S SKJr  S SKJr  S SK	J
r
  S SKJr  S SKJr  S S	KJr  \R                   " 5       (       a  S S
KJr  S SKJr  S SKJr  \" S5      SSSSSS.             SS jj5       rSS jrSS jrSS jrg)    )annotations)Callable)Sequence)experimental_func)Study)FrozenTrial)_get_pareto_front_info)_ParetoFrontInfo)_imports)Axes)Axes3D)pltz2.8.0NT)target_namesinclude_dominated_trials
axis_orderconstraints_functargetsc               \    [         R                  " 5         [        XX#XE5      n[        U5      $ )aZ  Plot the Pareto front of a study.

.. seealso::
    Please refer to :func:`optuna.visualization.plot_pareto_front` for an example.

Args:
    study:
        A :class:`~optuna.study.Study` object whose trials are plotted for their objective
        values. ``study.n_objectives`` must be either 2 or 3 when ``targets`` is :obj:`None`.
    target_names:
        Objective name list used as the axis titles. If :obj:`None` is specified,
        "Objective {objective_index}" is used instead. If ``targets`` is specified
        for a study that does not contain any completed trial,
        ``target_name`` must be specified.
    include_dominated_trials:
        A flag to include all dominated trial's objective values.
    axis_order:
        A list of indices indicating the axis order. If :obj:`None` is specified,
        default order is used. ``axis_order`` and ``targets`` cannot be used at the same time.

        .. warning::
            Deprecated in v3.0.0. This feature 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.0.0.
    constraints_func:
        An optional function that computes the objective constraints. It must take a
        :class:`~optuna.trial.FrozenTrial` and return the constraints. The return value must
        be a sequence of :obj:`float` s. A value strictly larger than 0 means that a
        constraint is violated. A value equal to or smaller than 0 is considered feasible.
        This specification is the same as in, for example,
        :class:`~optuna.samplers.NSGAIISampler`.

        If given, trials are classified into three categories: feasible and best, feasible but
        non-best, and infeasible. Categories are shown in different colors. Here, whether a
        trial is best (on Pareto front) or not is determined ignoring all infeasible trials.

        .. warning::
            Deprecated in v4.0.0. This feature will be removed in the future. The removal of
            this feature is currently scheduled for v6.0.0, but this schedule is subject to
            change. See https://github.com/optuna/optuna/releases/tag/v4.0.0.
    targets:
        A function that returns a tuple of target values to display.
        The argument to this function is :class:`~optuna.trial.FrozenTrial`.
        ``targets`` must be :obj:`None` or return 2 or 3 values.
        ``axis_order`` and ``targets`` cannot be used at the same time.
        If the number of objectives is neither 2 nor 3, ``targets`` must be specified.

        .. note::
            Added in v3.0.0 as an experimental feature. The interface may change in newer
            versions without prior notice.
            See https://github.com/optuna/optuna/releases/tag/v3.0.0.

Returns:
    A :class:`matplotlib.axes.Axes` object.
)r   checkr	   _get_pareto_front_plot)studyr   r   r   r   r   infos          g/home/james-whalen/.local/lib/python3.13/site-packages/optuna/visualization/matplotlib/_pareto_front.pyplot_pareto_frontr      s/    D NN!5CSD "$''    c                |    U R                   S:X  a  [        U 5      $ U R                   S:X  a  [        U 5      $  S5       e)N      zMust not reach here)	n_targets_get_pareto_front_2d_get_pareto_front_3d)r   s    r   r   r   ^   s;    ~~#D))	1	#D))+++ur   c           
     b   [         R                  R                  S5        [         R                  " 5       u  pUR	                  S5        [         R
                  " S5      nUR                  U R                  U R                  S      5        UR                  U R                  U R                  S      5        Sn[        U R                  5      S:  ap  UR                  U R                   VVs/ s H  u  pXPR                  S      PM     snnU R                   VVs/ s H  u  pXPR                  S      PM     snnSSS	9  S
n[        U R                  5      S:  at  UR                  U R                   VVs/ s H  u  pXPR                  S      PM     snnU R                   VVs/ s H  u  pXPR                  S      PM     snnU" S5      US	9  [        U R                  5      S:  at  UR                  U R                   VVs/ s H  u  pXPR                  S      PM     snnU R                   VVs/ s H  u  pXPR                  S      PM     snnU" S5      SS	9  U R                  b%  UR                  5       (       a  UR!                  5         U$ s  snnf s  snnf s  snnf s  snnf s  snnf s  snnf )NggplotPareto-front Plottab10r      Trial#ccccccInfeasible Trial)xycolorlabelFeasible Trialr   
Best Trial)r   styleusesubplots	set_titleget_cmap
set_xlabelr   r   
set_ylabelleninfeasible_trials_with_valuesscatternon_best_trials_with_valuesbest_trials_with_valueshas_datalegend)r   _axcmaptrial_labelvaluess         r   r    r    g   s?   IIMM(LLNEALL$%<< DMM$##DOOA$678MM$##DOOA$678K
4--.2


;?;];]^;]iavooa();]^;?;];]^;]iavooa();]^$	 	 	
 '
4++,q0


;?;[;[\;[iavooa();[\;?;[;[\;[iavooa();[\q'	 	 	
 4''(1,


;?;W;WX;Wiavooa();WX;?;W;WX;Wiavooa();WXq'	 	 	
 ''3
		I1 _^ ]\ YXs$   )J
J2J
!J?J%
.J+c                `   [         R                  R                  S5        [         R                  " 5       nUR	                  SS9nUR                  S5        [         R                  " S5      nUR                  U R                  U R                  S      5        UR                  U R                  U R                  S      5        UR                  U R                  U R                  S      5        S	nU R                  b  [        U R                  5      S:  a  UR                  U R                   VVs/ s H  u  pVX`R                  S      PM     snnU R                   VVs/ s H  u  pVX`R                  S      PM     snnU R                   VVs/ s H  u  pVX`R                  S      PM     snnS
SS9  SnU R                  b  [        U R                  5      S:  a  UR                  U R                   VVs/ s H  u  pVX`R                  S      PM     snnU R                   VVs/ s H  u  pVX`R                  S      PM     snnU R                   VVs/ s H  u  pVX`R                  S      PM     snnU" S5      US9  U R                   b  [        U R                   5      (       a  UR                  U R                    VVs/ s H  u  pVX`R                  S      PM     snnU R                    VVs/ s H  u  pVX`R                  S      PM     snnU R                    VVs/ s H  u  pVX`R                  S      PM     snnU" S5      SS9  U R                  b%  UR#                  5       (       a  UR%                  5         U$ s  snnf s  snnf s  snnf s  snnf s  snnf s  snnf s  snnf s  snnf s  snnf )Nr#   3d)
projectionr$   r%   r   r&   r   r'   r(   r)   )xsyszsr,   r-   r.   r   r/   )r   r0   r1   figureadd_subplotr3   r4   r5   r   r   r6   
set_zlabelr8   r7   r9   r:   r;   r<   r=   )r   figr?   r@   rA   r>   rB   s          r   r!   r!      s   IIMM(
**,CD1BLL$%<< DMM$##DOOA$678MM$##DOOA$678MM$##DOOA$678K**6223a7


<@<^<^_<^yqq)*<^_<@<^<^_<^yqq)*<^_<@<^<^_<^yqq)*<^_$ 	 	
 '''3D<\<\8]`a8a


<@<\<\]<\yqq)*<\]<@<\<\]<\yqq)*<\]<@<\<\]<\yqq)*<\]q' 	 	
 ##/C8T8T4U4U


<@<X<XY<Xyqq)*<XY<@<X<XY<Xyqq)*<XY<@<X<XY<Xyqq)*<XYq' 	 	
 ''3
		I; `__ ^]] ZYYs6   .M:
N N3N
"NN=N
,N$N*)r   r   r   zlist[str] | Noner   boolr   zlist[int] | Noner   /Callable[[FrozenTrial], Sequence[float]] | Noner   rN   return'Axes')r   r
   rO   rP   )
__future__r   collections.abcr   r   optuna._experimentalr   optuna.studyr   optuna.trialr   "optuna.visualization._pareto_frontr	   r
   3optuna.visualization.matplotlib._matplotlib_importsr   is_successfulr   r   r   r   r   r    r!    r   r   <module>rZ      s    " $ $ 2  $ E ? H HJG 7 &*%)#'HL?CF(F( #F( #	F(
 !F( FF( =F( F( F(R,%P/r   