
    rbi                         d Z ddlZddlZddlmZ  edd          Z G d d          Zd Z ed	dd
ed          Zd Z	d Z
 eddde
d          Z eddde	d          Z eeeed          ZdS )z
Lightweight options machinery.

Based on https://github.com/topper-123/optioneer, but simplified (don't deal
with nested options, deprecated options, ..), just the attribute-style dict
like holding the options and giving a nice repr.
    N)
namedtupleOptionz(key default_value doc validator callbackc                   :     e Zd ZdZ fdZd Zd Zd Zd Z xZ	S )Optionsz5Provide attribute-style access to configuration dict.c                     t                                          d|           i }|                                D ]\  }}|j        ||<   t                                          d|           d S )N_options_config)super__setattr__itemsdefault_value)selfoptionsconfigkeyoption	__class__s        a/var/www/html/mdtn/previsions/meteo_cartes/venv/lib/python3.11/site-packages/geopandas/_config.py__init__zOptions.__init__   sk    J000"==?? 	/ 	/KC .F3KKIv.....    c                     || j         v rT| j        |         }|j        r|                    |           || j         |<   |j        r|                    ||           d S d S d}t	          |          )Nz.You can only set the value of existing options)r	   r   	validatorcallbackAttributeError)r   r   valuer   msgs        r   r   zOptions.__setattr__   s    $,]3'F (  ''' %DL ,U+++++, , CC %%%r   c                 X    	 | j         |         S # t          $ r t          d          w xY w)NzNo such option)r	   KeyErrorr   )r   r   s     r   __getattr__zOptions.__getattr__)   s>    	3<$$ 	3 	3 	3 !1222	3s    )c                 N    t          | j                                                  S )N)listr	   keys)r   s    r   __dir__zOptions.__dir__/   s    DL%%''(((r   c                    | j         j        }d}| j                                        D ]{\  }}| d| j        |         d|j        d}||z  }|j        r/d                    t          j	        |j        d                    }nd}t          j
        |d	
          }||dz   z  }|d}|                    d|          }| d| | dS )N z: z [default: z]

F   )widthzNo description available.z    )prefixz
  ())r   __name__r   r   r	   r   docjointextwrapwrapindentreplace)r   clsdescriptionr   r   descrdoc_textspaces           r   __repr__zOptions.__repr__2   s    n%=..00 	+ 	+KCUU$,s+UU&:NUUU  5 Kz 799X]6:R%H%H%HII6x???H8d?*KK!))$66---{----r   )
r,   
__module____qualname____doc__r   r   r   r#   r8   __classcell__)r   s   @r   r   r      sz        ??/ / / / /& & &3 3 3) ) ). . . . . . .r   r   c                 t    | 3t          | t                    rd| cxk    rdk    sn t          d          d S d S )Nr      z,Invalid value, needs to be an integer [0-16])
isinstanceint
ValueErrorr   s    r   _validate_display_precisionrC   F   sV    %%% 	Ma5.>.>.>.>B.>.>.>.>KLLL .>.>r   display_precisionzThe precision (maximum number of decimals) of the coordinates in the WKT representation in the Series/DataFrame display. By default (None), it tries to infer and use 3 decimals for projected coordinates and 5 decimals for geographic coordinates.)r   r   r-   r   r   c                 2    t          j        dd           d S )Nzhpygeos support was removed in 1.0. geopandas.use_pygeos is a no-op and will be removed in geopandas 1.1.   )
stacklevel)warningswarn)_values    r   _warn_use_pygeos_deprecatedrK   Z   s.    M	P     r   c                 <    | | dvrt          d|  d          d S d S )N)pyogriofionaz$Expected 'pyogrio' or 'fiona', got '')rA   rB   s    r   _validate_io_enginerP   b   s<    ,,,LELLLMMM ,,r   	io_enginezXThe default engine for ``read_file`` and ``to_file``. Options are 'pyogrio' and 'fiona'.
use_pygeosFzXDeprecated option previously used to enable PyGEOS. It will be removed in GeoPandas 1.1.)rD   rR   rQ   )r;   r/   rH   collectionsr   r   r   rC   rD   rK   rP   rQ   rR   r    r   r   <module>rU      sP      " " " " " "	HH	I	I3. 3. 3. 3. 3. 3. 3. 3.lM M M F	A
 *     N N N F	- "	 	 		 V	/ *	 	 	
 '.   r   