§
    ‡Ûg±&  ã                   óª  — d Z ddlZddlZddlZddlmZ ddlZddlZej        dk    rddl	m
Z nddlZddlZddlmZmZmZmZ  ej        e¦  «        Zg d¢Zej                              ej        ¦   «         d¦  «        Zej                              ej        ¦   «         d¦  «        gZdZh d	£Zd
„ dD ¦   «         ZdZ ej         d                      e!dj"         e#ee$j%        ¬¦  «        ¦  «        ¦  «        ¦  «        d„ ¦   «         Z&ej'        dd„¦   «         Z(d„ Z)d„ Z*d„ Z+ G d„ de,¦  «        Z- e*e¦  «        Z. e-¦   «         Z/g Z0d„ Z1 e1¦   «          dS )aD  
Core functions and attributes for the matplotlib style library:

``use``
    Select style sheet to override the current matplotlib settings.
``context``
    Context manager to use a style sheet temporarily.
``available``
    List available style sheets.
``library``
    A dictionary of style names and matplotlib settings.
é    N)ÚPath)é   é
   )Ú_apiÚ
_docstringÚ_rc_params_in_fileÚrcParamsDefault)ÚuseÚcontextÚ	availableÚlibraryÚreload_libraryÚstylelibÚmplstyle>   ú
date.epochúwebagg.portúwebagg.addressútk.window_focusúsavefig.directoryúdocstring.hardcopyúfigure.raise_windowúwebagg.port_retriesúwebagg.open_in_browserúfigure.max_open_warningÚbackendÚtoolbarÚtimezoneÚinteractiveÚbackend_fallbackc                 ó<   — i | ]}||                      d d¦  «        “ŒS )Úseabornzseaborn-v0_8)Úreplace)Ú.0Úss     úK/granary/edev/quantum/lib/python3.11/site-packages/matplotlib/style/core.pyú
<dictcomp>r&   /   s8   € ð ð ð à	ð €q‡y‚y�˜NÑ+Ô+ðð ð ó    )r!   zseaborn-brightzseaborn-colorblindzseaborn-darkzseaborn-darkgridzseaborn-dark-palettezseaborn-deepzseaborn-mutedzseaborn-notebookzseaborn-paperzseaborn-pastelzseaborn-posterzseaborn-talkzseaborn-tickszseaborn-whitezseaborn-whitegridzûThe seaborn styles shipped by Matplotlib are deprecated since %(since)s, as they no longer correspond to the styles shipped by seaborn. However, they will remain available as 'seaborn-v0_8-<style>'. Alternatively, directly use the seaborn API instead.ú
z- {})Úkeyc                 ó   — t          | t          t          f¦  «        st          | d¦  «        r| g}n| }dddœ}|D �]Ò} t          | t          ¦  «        �r|                     | | ¦  «        } | t
          v r(t          j        dt          ¬¦  «         t
          |          } | dk    r=t          j	        ¦   «         5  d„ t          D ¦   «         } ddd¦  «         n# 1 swxY w Y   nŠ| t          v rt          |          } nsd	| v ro|                      d	¦  «        \  }}}	 t          j        |¦  «        |› d	t          › �z  }t!          |¦  «        } n$# t"          t$          t&          f$ r
}Y d}~nd}~ww xY wt          | t          t          f¦  «        r6	 t!          | ¦  «        } n%# t(          $ r}t)          | ›d
�¦  «        |‚d}~ww xY wi }	| D ]/}
|
t*          v rt          j        d|
›d�¦  «         Œ$| |
         |	|
<   Œ0t.          j                             |	¦  «         �ŒÔdS )aß  
    Use Matplotlib style settings from a style specification.

    The style name of 'default' is reserved for reverting back to
    the default style settings.

    .. note::

       This updates the `.rcParams` with the settings from the style.
       `.rcParams` not defined in the style are kept.

    Parameters
    ----------
    style : str, dict, Path or list

        A style specification. Valid options are:

        str
            - One of the style names in `.style.available` (a builtin style or
              a style installed in the user library path).

            - A dotted name of the form "package.style_name"; in that case,
              "package" should be an importable Python package name, e.g. at
              ``/path/to/package/__init__.py``; the loaded style file is
              ``/path/to/package/style_name.mplstyle``.  (Style files in
              subpackages are likewise supported.)

            - The path or URL to a style file, which gets loaded by
              `.rc_params_from_file`.

        dict
            A mapping of key/value pairs for `matplotlib.rcParams`.

        Path
            The path to a style file, which gets loaded by
            `.rc_params_from_file`.

        list
            A list of style specifiers (str, Path or dict), which are applied
            from first to last in the list.

    Notes
    -----
    The following `.rcParams` are not related to style and will be ignored if
    found in a style specification:

    %s
    ÚkeysÚdefaultÚclassic)Úmpl20Úmpl15ú3.6©Úmessagec                 ó<   — i | ]}|t           v¯|t          |         “ŒS © )ÚSTYLE_BLACKLISTr	   )r#   Úks     r%   r&   zuse.<locals>.<dictcomp>’   s3   € ð :ð :ð :°qØ !­Ð 8Ð 8ð ¥°Ô 2Ø 8Ð 8Ð 8r'   Nú.zŒ is not a valid package style, path of style file, URL of style file, or library style name (library styles are listed in `style.available`)zStyle includes a parameter, z9, that is not related to style.  Ignoring this parameter.)Ú
isinstanceÚstrr   ÚhasattrÚgetÚ_DEPRECATED_SEABORN_STYLESr   Úwarn_deprecatedÚ_DEPRECATED_SEABORN_MSGÚ'suppress_matplotlib_deprecation_warningr	   r   Ú
rpartitionÚimportlib_resourcesÚfilesÚSTYLE_EXTENSIONr   ÚModuleNotFoundErrorÚOSErrorÚ	TypeErrorÚIOErrorr5   Úwarn_externalÚmplÚrcParamsÚupdate)ÚstyleÚstylesÚstyle_aliasÚpkgÚ_ÚnameÚpathÚexcÚerrÚfilteredr6   s              r%   r
   r
   K   së  € õh �%�#�t˜Ñ%Ô%ð ­°¸Ñ)?Ô)?ð à�ˆˆàˆà%°	Ð:Ð:€Kàð -&ñ -&ˆÝ�e�SÑ!Ô!ñ 	Ø—O’O E¨5Ñ1Ô1ˆEØÕ2Ð2Ð2ÝÔ$ UÕ4KÐLÑLÔLÐLÝ2°5Ô9�Ø˜	Ò!Ð!õ ÔAÑCÔCð :ð :ð:ð :½Oð :ñ :ô :�Eð:ð :ð :ñ :ô :ð :ð :ð :ð :ð :ð :øøøð :ð :ð :ð :øð �'Ð!Ð!Ý œ��Ø˜��Ø$×/Ò/°Ñ4Ô4‘��Q˜ðÝ/Ô5°cÑ:Ô:Ø!%Ð9Ð9­Ð9Ð9ñ:�Då.¨tÑ4Ô4�E�EøÝ+­WµiÐ@ð ð ð ð �D�D�D�Døøøøðøøøõ �e�c¥4˜[Ñ)Ô)ð 	IðIÝ*¨5Ñ1Ô1��øÝð Ið Ið IÝØð ?ð ?ð ?ñ@ô @ð FIðIøøøøðIøøøð
 ˆØð 	'ð 	'ˆAØ•OÐ#Ð#ÝÔ"ðC°1ð Cð Cð CñDô Dð Dð Dð $ Aœh�˜‘�ÝŒ×Ò˜HÑ%Ô%Ð%Ñ%ð[-&ð -&s<   Â3CÃC	ÃC	Ä0EÅE$ÅE$ÆFÆ
F6ÆF1Æ1F6Fc              #   ó²   K  — t          j        ¦   «         5  |rt          j        ¦   «          t          | ¦  «         dV — ddd¦  «         dS # 1 swxY w Y   dS )aû  
    Context manager for using style settings temporarily.

    Parameters
    ----------
    style : str, dict, Path or list
        A style specification. Valid options are:

        str
            - One of the style names in `.style.available` (a builtin style or
              a style installed in the user library path).

            - A dotted name of the form "package.style_name"; in that case,
              "package" should be an importable Python package name, e.g. at
              ``/path/to/package/__init__.py``; the loaded style file is
              ``/path/to/package/style_name.mplstyle``.  (Style files in
              subpackages are likewise supported.)

            - The path or URL to a style file, which gets loaded by
              `.rc_params_from_file`.
        dict
            A mapping of key/value pairs for `matplotlib.rcParams`.

        Path
            The path to a style file, which gets loaded by
            `.rc_params_from_file`.

        list
            A list of style specifiers (str, Path or dict), which are applied
            from first to last in the list.

    after_reset : bool
        If True, apply style after resetting settings to their defaults;
        otherwise, apply style on top of the current settings.
    N)rI   Ú
rc_contextÚ
rcdefaultsr
   )rL   Úafter_resets     r%   r   r   ·   s¥   è è € õJ 
ŒÑ	Ô	ð ð Øð 	ÝŒNÑÔÐÝˆE‰
Œ
ˆ
Øˆˆˆð	ð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð s   –)AÁAÁAc                 ó’   — t          t          j        j        t          ¦  «        D ]!}t          |¦  «        }t          | |¦  «         Œ"| S )z0Update style library with user-defined rc files.)ÚmapÚosrR   Ú
expanduserÚUSER_LIBRARY_PATHSÚread_style_directoryÚupdate_nested_dict)r   Ústylelib_pathrM   s      r%   Úupdate_user_libraryrb   ã   sF   € å�RœWÔ/Õ1CÑDÔDð ,ð ,ˆÝ% mÑ4Ô4ˆÝ˜7 FÑ+Ô+Ð+Ð+Ø€Nr'   c                 óP  — t          ¦   «         }t          | ¦  «                             dt          › �¦  «        D ]l}t	          j        d¬¦  «        5 }t          |¦  «        ||j        <   ddd¦  «         n# 1 swxY w Y   |D ]#}t           	                    d||j
        ¦  «         Œ$Œm|S )z3Return dictionary of styles defined in *style_dir*.z*.T)ÚrecordNz	In %s: %s)Údictr   ÚglobrC   ÚwarningsÚcatch_warningsr   ÚstemÚ_logÚwarningr2   )Ú	style_dirrM   rR   ÚwarnsÚws        r%   r_   r_   ë   så   € å‰VŒV€FÝ�Y‘”×$Ò$Ð%;­/Ð%;Ð%;Ñ<Ô<ð 7ð 7ˆÝÔ$¨DÐ1Ñ1Ô1ð 	9°UÝ 2°4Ñ 8Ô 8ˆF�4”9Ñð	9ð 	9ð 	9ñ 	9ô 	9ð 	9ð 	9ð 	9ð 	9ð 	9ð 	9øøøð 	9ð 	9ð 	9ð 	9àð 	7ð 	7ˆAÝ�LŠL˜ d¨A¬IÑ6Ô6Ð6Ð6ð	7à€Ms   ÁA4Á4A8	Á;A8	c                 óŒ   — |                      ¦   «         D ].\  }}|                      |i ¦  «                             |¦  «         Œ/| S )a  
    Update nested dict (only level of nesting) with new values.

    Unlike `dict.update`, this assumes that the values of the parent dict are
    dicts (or dict-like), so you shouldn't replace the nested dict if it
    already exists. Instead you should update the sub-dict.
    )ÚitemsÚ
setdefaultrK   )Ú	main_dictÚnew_dictrQ   Úrc_dicts       r%   r`   r`   ö   sN   € ð "ŸšÑ)Ô)ð 7ð 7‰ˆˆgØ×Ò˜T 2Ñ&Ô&×-Ò-¨gÑ6Ô6Ð6Ð6ØÐr'   c                   ó   — e Zd Zd„ ZdS )Ú_StyleLibraryc                 óš   — |t           v r(t          j        dt          ¬¦  «         t           |         }t                               | |¦  «        S )Nr0   r1   )r<   r   r=   r>   re   Ú__getitem__)Úselfr)   s     r%   rx   z_StyleLibrary.__getitem__  sE   € ØÕ,Ð,Ð,ÝÔ  Õ0GÐHÑHÔHÐHÝ,¨SÔ1ˆCå×Ò  cÑ*Ô*Ð*r'   N)Ú__name__Ú
__module__Ú__qualname__rx   r4   r'   r%   rv   rv     s#   € € € € € ð+ð +ð +ð +ð +r'   rv   c                  óð   — t                                ¦   «          t                                t          t          ¦  «        ¦  «         t          t                                ¦   «         ¦  «        t          dd…<   dS )zReload the style library.N)r   ÚclearrK   rb   Ú_base_libraryÚsortedr+   r   r4   r'   r%   r   r     sK   € å‡M‚M�O„O€OÝ‡N‚NÕ&¥}Ñ5Ô5Ñ6Ô6Ð6Ý�'Ÿ,š,™.œ.Ñ)Ô)…Iˆaˆaˆa�L€L€Lr'   )F)2Ú__doc__Ú
contextlibÚloggingr\   Úpathlibr   Úsysrg   Úversion_infoÚimportlib.resourcesÚ	resourcesrA   Ú
matplotlibrI   r   r   r   r	   Ú	getLoggerrz   rj   Ú__all__rR   ÚjoinÚget_data_pathÚBASE_LIBRARY_PATHÚget_configdirr^   rC   r5   r<   r>   ÚSubstitutionr[   Úformatr€   r9   Úlowerr
   Úcontextmanagerr   rb   r_   r`   re   rv   r   r   r   r   r4   r'   r%   ú<module>r”      s~  ððð ð Ð Ð Ð Ø €€€Ø 	€	€	€	Ø Ð Ð Ð Ð Ð Ø 
€
€
€
Ø €€€àÔ�wÒÐØ5Ð5Ð5Ð5Ð5Ð5Ð5ð ÐÐÐà Ð Ð Ð Ø LÐ LÐ LÐ LÐ LÐ LÐ LÐ LÐ LÐ LÐ LÐ Là€wÔ˜Ñ"Ô"€à
FÐ
FÐ
F€ð ”G—L’LÐ!2 Ô!2Ñ!4Ô!4°jÑAÔAÐ à”g—l’lÐ#4 3Ô#4Ñ#6Ô#6¸
ÑCÔCÐDÐ Ø€ð(ð (ð (€ðð ððñ ô Ð ð,,ð ð €ÔØ‡I‚Iˆcˆc�&”-  ¨¸S¼YÐ!GÑ!GÔ!GÑHÔHÑIÔIñô ðf&ð f&ñô ðf&ðR Ôð(ð (ð (ñ Ôð(ðVð ð ðð ð ðð ð ð+ð +ð +ð +ð +�Dñ +ô +ð +ð %Ð$Ð%6Ñ7Ô7€Ø
ˆ-‰/Œ/€Ø€	ð*ð *ð *ð €Ñ Ô Ð Ð Ð r'   