
    9i>                         S r SSKrSSKrSSKJrJr  SSKJrJr  SSK	J
r
  SSKrSSKJr  SSKJr   " S S	5      rS
 r\4S\\   S\\   4S jjrg)z!Decorators for Shapely functions.    N)CallableIterable)	lru_cachewraps)unwrap)libUnsupportedGEOSVersionErrorc                   $    \ rS rSrSrS rS rSrg)requires_geos   z,Decorator to require a minimum GEOS version.c                     UR                  S5      S:w  a  [        S5      e[        S UR                  S5       5       5      U l        g)z8Create a decorator that requires a minimum GEOS version..   z.Version must be <major>.<minor>.<patch> formatc              3   8   #    U  H  n[        U5      v   M     g 7fN)int).0xs     R/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/shapely/decorators.py	<genexpr>)requires_geos.__init__.<locals>.<genexpr>   s     @-?SVV-?s   N)count
ValueErrortuplesplitversion)selfr   s     r   __init__requires_geos.__init__   s:    =="MNN@W]]3-?@@    c                 (  ^^ [         R                  U R                  :  n[        R                  R                  S5      S:H  nU(       a	  U(       d  T$ SR                  " TR                  /U R                  Q76 mU(       a  [        T5      U4S j5       nO[        T5      U4S j5       nUR                  nU(       aV  UR                  S5      S-   nSn XVU-      S	:X  a  US
-  nOOM  UR                  SSR                  S	U-  T5      S
5      Ul	        U$ )zReturn the wrapped function.SPHINX_DOC_BUILD1z%'{}' requires at least GEOS {}.{}.{}.c                     > T" U 0 UD6$ r    )argskwargsfuncs     r   wrapped'requires_geos.__call__.<locals>.wrapped$   s    T,V,,r!   c                     > [        T5      er   r	   )r'   r(   msgs     r   r*   r+   *   s    1#66r!   z

r   r       z

{}.. note:: {}

)r   geos_versionr   osenvirongetformat__name__r   __doc__findreplace)	r   r)   is_compatibleis_doc_buildr*   docpositionindentr-   s	    `      @r   __call__requires_geos.__call__   s   ((DLL8zz~~&89S@K5<<MM
 LL
 4[- -
 4[7 7 ooxx'!+HF&()S0aKF	 
 "kk077fcJAGO r!   )r   N)r5   
__module____qualname____firstlineno__r6   r   r>   __static_attributes__r&   r!   r   r   r      s    6A%r!   r   c                 0   ^  [        T 5      U 4S j5       nU$ )zEnable multithreading.

To do this, the writable flags of object type ndarrays are set to False.

NB: multithreading also requires the GIL to be released, which is done in
the C extension (ufuncs.c).
c            	        > U  Vs/ s H<  n[        U[        R                  5      (       d  M$  UR                  [        :X  d  M:  UPM>     snUR                  5        VVs/ s HF  u  p2US;  d  M  [        U[        R                  5      (       d  M.  UR                  [        :X  d  MD  UPMH     snn-   nU Vs/ s H  oUR                  R                  PM     nn U H  nSUR                  l        M     T" U 0 UD6[        XF5       H  u  pWXuR                  l        M     $ s  snf s  snnf s  snf ! [        XF5       H  u  pWXuR                  l        M     f = f)N>   outwhereF)	
isinstancenpndarraydtypeobjectitemsflags	writeablezip)	r'   r(   argname
array_argsarr	old_flagsold_flagr)   s	           r   r*   'multithreading_enabled.<locals>.wrappedI   s$     
C:c2::#>C399PVCVC4
 $\\^
+	++  3

+  		V#	 +


 5??JSYY((J	?	/!&+		# "((!$Z!;&.		# "<

 @ "%Z!;&.		# "<s:   #DDDD".D"D"%D"5D(!D- -&E)r   )r)   r*   s   ` r   multithreading_enabledrX   @   s"     4[/ /& Nr!   should_be_kwargscategoryc                 (   ^ ^ S[         4UU 4S jjnU$ )a  Show warning if positional arguments are used that should be keyword.

Parameters
----------
should_be_kwargs : Iterable[str]
    Names of parameters that should be passed as keyword arguments.
category : type[Warning], optional (default: DeprecationWarning)
    Warning category to use for deprecation warnings.

Returns
-------
callable
    Decorator function that adds positional argument deprecation warnings.

Examples
--------
>>> from shapely.decorators import deprecate_positional
>>> @deprecate_positional(['b', 'c'])
... def example(a, b, c=None):
...     return a, b, c
...
>>> example(1, 2)  # doctest: +SKIP
DeprecationWarning: positional argument `b` for `example` is deprecated. ...
(1, 2, None)
>>> example(1, b=2)  # No warnings
(1, 2, None)
r)   c                   >^ ^^^	 [        T 5      R                  nUR                  S UR                   n[	        U5       VVs0 s H  u  p4XC_M	     nnnT Vs/ s H  nXE;   d  M
  XT   U4PM     snmT(       d  T $ [        T5      S   m	[        S5      S[        4UU 4S jj5       m[        T 5      U
U UU	4S j5       nU$ s  snnf s  snf )Nr   
   n_argsc                 b  > T VVs/ s H  u  pX:  d  M  UPM     nnn[        U5      S:X  a  SUS    S3nSnSnOSSnSn[        U5      S:X  a  S	R                  S
 U 5       5      nO'SR                  S US S  5       5      nUSUS    S3-  nSU SU STR                   SU SU S3$ s  snnf )Nr/   `r    issarer   z and c              3   .   #    U  H  nS U S 3v   M     g7fr`   Nr&   r   us     r   r   Ldeprecate_positional.<locals>.decorator.<locals>.make_msg.<locals>.<genexpr>   s     +Cdas!Hd   z, c              3   .   #    U  H  nS U S 3v   M     g7frf   r&   rg   s     r   r   ri      s     (E9a1QCq9rj   z, and `zpositional argumentr.   z for `z` z( deprecated. Please use keyword argumentz	 instead.)lenjoinr5   )	r^   idxrR   usedargs_txtplrisaredeprecate_positionsr)   s	          r   make_msg9deprecate_positional.<locals>.decorator.<locals>.make_msg   s    *=N*=YSD*=DN4yA~tAwiq>t9>&||+Cd+CCH#yy(E49(EEH'$r(1 55H &cU!H:VDMM?"'A#iQ Os
   B+B+c                  r   > T" U 0 UD6n[        U 5      nUT:  a  [        R                  " T" U5      TSS9  U$ )Nr   )rZ   
stacklevel)rm   warningswarn)r'   r(   resultnrZ   r)   ru   	warn_froms       r   wrapper8deprecate_positional.<locals>.decorator.<locals>.wrapper   s;    4*6*FD	A9}hqkHKMr!   )	r   __code__co_varnamesco_argcount	enumerateminr   r   r   )r)   code	pos_namesro   rR   name_to_idxr~   rt   ru   r}   rZ   rY   s   `      @@@r   	decorator'deprecate_positional.<locals>.decorator   s    d|$$ $$%7t'7'78	2;I2FG2FYSty2FG )
(" &[%(
 #K +,Q/		2	S 	 
	* 
t	 
	 _ H
s   B>	C$
C)r   )rY   rZ   r   s   `` r   deprecate_positionalr   `   s    @5 5 5n r!   )r6   r1   ry   collections.abcr   r   	functoolsr   r   inspectr   numpyrI   shapelyr   shapely.errorsr
   r   rX   DeprecationWarningstrtypeWarningr   r&   r!   r   <module>r      sV    ' 	  . &    6. .bD 1WsmW7mWr!   