
    h                         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y)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 }|j                         D ]  \  }}|j                  ||<    t         |   d|       y )N_options_config)super__setattr__itemsdefault_value)selfoptionsconfigkeyoption	__class__s        D/var/www/html/immo/lib/python3.12/site-packages/geopandas/_config.py__init__zOptions.__init__   sP    J0"==? 	/KC ..F3K	/ 	Iv.    c                     || j                   v r[| j                  |   }|j                  r|j                  |       || j                   |<   |j                  r|j                  ||       y y 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__   sn    $,,]]3'F  ' %DLLU+  CC %%r   c                 R    	 | j                   |   S # t        $ r t        d      w xY w)NzNo such option)r	   KeyErrorr   )r   r   s     r   __getattr__zOptions.__getattr__)   s1    	3<<$$ 	3 !122	3s    &c                 H    t        | j                  j                               S )N)listr	   keys)r   s    r   __dir__zOptions.__dir__/   s    DLL%%'((r   c                    | j                   j                  }d}| j                  j                         D ]  \  }}| d| j                  |   d|j
                  d}||z  }|j                  r1dj                  t        j                  |j                  d            }nd}t        j                  |d	
      }||dz   z  } d}|j                  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    nn%%==..0 	+KC%r$,,s+.k&:N:N9QQTU  5 Kzz99X]]6::R%HI6x?H8d?*K	+ !))$6aw{m1--r   )
r,   
__module____qualname____doc__r   r   r   r#   r8   __classcell__)r   s   @r   r   r      s    ?/&3).r   r   c                 n    | 3t        | t              rd| cxk  rdk  st        d       t        d      y y )Nr      z,Invalid value, needs to be an integer [0-16])
isinstanceint
ValueErrorr   s    r   _validate_display_precisionrC   F   sE    %%a5.>B.>KLL /?K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       y )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    MM	Pr   c                 0    | | dvrt        d|  d      y y )N)pyogriofionaz$Expected 'pyogrio' or 'fiona', got '')rA   rB   s    r   _validate_io_enginerP   b   s0    ,,CE7!L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      s      "	HH	I3. 3.lM 	A
 * N 	- "		 	/ *	
 . r   