a
    ßÁd—	  ã                   @   s–   d Z ddlZddlmZmZmZ ddd„ZG dd„ deƒZG d	d
„ d
eƒZG dd„ deƒZ	G dd„ de
ƒZG dd„ deƒZG dd„ deƒZdd„ ZdS )zShapely errors.é    N)Ú_setup_signal_checksÚGEOSExceptionÚShapelyErroré'  c                 C   s$   | dkrt dƒ‚t| t ¡ jƒ dS )aw  This enables Python signal checks in the ufunc inner loops.

    Doing so allows termination (using CTRL+C) of operations on large arrays of vectors.

    Parameters
    ----------
    interval : int, default 10000
        Check for interrupts every x iterations. The higher the number, the slower
        shapely will respond to a signal. However, at low values there will be a negative effect
        on performance. The default of 10000 does not have any measureable effects on performance.

    Notes
    -----
    For more information on signals consult the Python docs:

    https://docs.python.org/3/library/signal.html
    r   z1Signal checks interval must be greater than zero.N)Ú
ValueErrorr   Ú	threadingÚmain_threadÚident)Úinterval© r   úQ/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/shapely/errors.pyÚsetup_signal_checks   s    r   c                   @   s   e Zd ZdZdS )ÚUnsupportedGEOSVersionErrorzJRaised when the GEOS library version does not support a certain operation.N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r      s   r   c                   @   s   e Zd ZdZdS )ÚDimensionErrorz0An error in the number of coordinate dimensions.Nr   r   r   r   r   r   #   s   r   c                   @   s   e Zd ZdZdS )ÚTopologicalErrorz1A geometry is invalid or topologically incorrect.Nr   r   r   r   r   r   '   s   r   c                   @   s   e Zd ZdZdS )ÚShapelyDeprecationWarningzn
    Warning for features that will be removed or behaviour that will be
    changed in a future release.
    Nr   r   r   r   r   r   +   s   r   c                   @   s   e Zd ZdZdS )ÚEmptyPartErrorzMAn error signifying an empty part was encountered when creating a multi-part.Nr   r   r   r   r   r   2   s   r   c                   @   s   e Zd ZdZdS )ÚGeometryTypeErrorzi
    An error raised when the type of the geometry in question is
    unrecognized or inappropriate.
    Nr   r   r   r   r   r   6   s   r   c                 C   s>   dd l }| dv r*|j| › d�tdd� tS td| › d�ƒ‚d S )Nr   )ZReadingErrorZWKBReadingErrorZWKTReadingErrorZPredicateErrorZInvalidGeometryErrorz� is deprecated and will be removed in a future version. Use ShapelyError instead (functions previously raising {name} will now raise a ShapelyError instead).é   )Ú
stacklevelz*module 'shapely.errors' has no attribute 'ú')ÚwarningsÚwarnÚDeprecationWarningr   ÚAttributeError)Únamer   r   r   r   Ú__getattr__=   s    ûr!   )r   )r   r   Zshapely.libr   r   r   r   r   r   r   ÚFutureWarningr   r   r   r!   r   r   r   r   Ú<module>   s   
