
    Og	                     R    d dl Z d dlmZ d dlZd dlmZ d dlmZ  G d d      Z	d Z
y)    Nwraps)libUnsupportedGEOSVersionErrorc                       e Zd Zd Zd Zy)requires_geosc                     |j                  d      dk7  rt        d      t        d |j                  d      D              | _        y )N.   z.Version must be <major>.<minor>.<patch> formatc              3   2   K   | ]  }t        |        y wN)int).0xs     W/var/www/html/public_html/myphp/venv/lib/python3.12/site-packages/shapely/decorators.py	<genexpr>z)requires_geos.__init__.<locals>.<genexpr>   s     @SV@s   )count
ValueErrortuplesplitversion)selfr   s     r   __init__zrequires_geos.__init__   s:    =="MNN@W]]3-?@@    c                    t         j                  | j                  k\  }t        j                  j                  d      dk(  }|r|sS  dj                  j                  g| j                   |rt              fd       }nt              fd       }|j                  }|rU|j                  d      dz   }d}	 |||z      d	k(  r|d
z  }nn|j                  ddj                  d	|z        d
      |_	        |S )NSPHINX_DOC_BUILD1z%'{}' requires at least GEOS {}.{}.{}.c                       | i |S r    )argskwargsfuncs     r   wrappedz'requires_geos.__call__.<locals>.wrapped   s    T,V,,r   c                      t              r   r   )r!   r"   msgs     r   r$   z'requires_geos.__call__.<locals>.wrapped!   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__zrequires_geos.__call__   s   ((DLL8zz~~&89S@K<5<<MM
 LL
 4[- -
 4[7 7 ooxx'!+HFx&()S0aKF	 
 "kk077fcJAGO r   N)r.   
__module____qualname__r   r7   r    r   r   r	   r	   
   s    A
$r   r	   c                 .     t                fd       }|S )zPrepare multithreading by setting the writable flags of object type
    ndarrays to False.

    NB: multithreading also requires the GIL to be released, which is done in
    the C extension (ufuncs.c).c            	      r   | D cg c]3  }t        |t        j                        s|j                  t        k(  s2|5 c}|j                         D cg c]8  \  }}|dvr/t        |t        j                        r|j                  t        k(  r|: c}}z   }|D cg c]  }|j                  j                   }}	 |D ]  }d|j                  _          | i |t        ||      D ]  \  }}||j                  _         S c c}w c c}}w c c}w # t        ||      D ]  \  }}||j                  _         w xY w)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$   z'multithreading_enabled.<locals>.wrapped>   s)     
:c2::#>399PVCVC
 $\\^
c++3

+		V#	 


 5??SSYY((?	?	/! ,&+		#,((!$Z!; /X&.		#/

 @ "%Z!; /X&.		#/s'   C?C?C?=DD
:D 'D6r   )r#   r$   s   ` r   multithreading_enabledrM   7   s"     4[/ /& Nr   )r*   	functoolsr   numpyr?   shapelyr   shapely.errorsr   r	   rM   r    r   r   <module>rR      s$    	    6* *Zr   