o
    i
                     @   sJ   d dl Zd dlZd dlmZ G dd dZG dd dZG dd dZdS )	    N)
LineStringc                   @   s    e Zd ZdZdd Zdd ZdS )
TestCoordsz
    Shapely assumes contiguous C-order float64 data for internal ops.
    Data should be converted to contiguous float64 if numpy exists.
    c9a0707 broke this a little bit.
    c                 C   sD   t jddgddggt jd}t t|j}| | ks J d S )N   "   8   N   dtypenparrayfloat32r   coordstolistselfr   processed_coords r   ]/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/shapely/tests/geometry/test_coords.pytest_data_promotion   s   zTestCoords.test_data_promotionc                 C   sX   t jddgddggt jd}t t|d d d j}|d d d  | ks*J d S )Nr   r   r   r   r   r
   r   r   r   r   test_data_destriding   s   "zTestCoords.test_data_destridingN)__name__
__module____qualname____doc__r   r   r   r   r   r   r      s    r   c                   @   s4   e Zd Zdd Zdd Zdd Zdd Zd	d
 ZdS )TestCoordsGetItemc                 C      dd t dD }t|}t ddD ]}|j| || ksJ qtt |jd  W d    n1 s5w   Y  tt |jd  W d    d S 1 sPw   Y  d S )Nc                 S      g | ]}t |t | fqS r   float.0xr   r   r   
<listcomp>       z:TestCoordsGetItem.test_index_2d_coords.<locals>.<listcomp>   ranger   r   pytestraises
IndexErrorr   cgir   r   r   test_index_2d_coords      "z&TestCoordsGetItem.test_index_2d_coordsc                 C   r   )Nc                 S   (   g | ]}t |t | t |d  fqS    r   r!   r   r   r   r$   )      ( z:TestCoordsGetItem.test_index_3d_coords.<locals>.<listcomp>r&   r'   r(   r)   r.   r   r   r   test_index_3d_coords(   r3   z&TestCoordsGetItem.test_index_3d_coordsc                 C   st   t  }tt |jd  W d    n1 sw   Y  tt |jd  W d    d S 1 s3w   Y  d S )Nr           )r   r+   r,   r-   r   	TypeError)r   r0   r   r   r   test_index_coords_misc2   s   "z(TestCoordsGetItem.test_index_coords_miscc                 C      dd t dD }t|}|jdd  |dd  ksJ |jd d |d d ks+J |jd d d |d d d ks<J |jd d d |d d d ksMJ |jd d |d d ks\J |jdd  |dd    krpg kssJ  J d S )Nc                 S   r   r   r   r!   r   r   r   r$   :   r%   z:TestCoordsGetItem.test_slice_2d_coords.<locals>.<listcomp>r&      r   r6   r*   r   r   r   r/   r0   r   r   r   test_slice_2d_coords9      ""2z&TestCoordsGetItem.test_slice_2d_coordsc                 C   r<   )Nc                 S   r4   r5   r   r!   r   r   r   r$   D   r7   z:TestCoordsGetItem.test_slice_3d_coords.<locals>.<listcomp>r&   r=   r   r6   r>   r?   r   r   r   test_slice_3d_coordsC   rA   z&TestCoordsGetItem.test_slice_3d_coordsN)r   r   r   r2   r8   r;   r@   rB   r   r   r   r   r      s    


r   c                   @   s   e Zd ZdZdd ZdS )TestXYz<New geometry/coordseq method 'xy' makes numpy interop easierc                 C   s^   t ddgj\}}t|dksJ t|ddgksJ t|dks#J t|ddgks-J d S )N)r   r   )r=   r=   r6   r9   g      ?)r   xylenlist)r   r#   yr   r   r   test_arraysQ   s
   zTestXY.test_arraysN)r   r   r   r   rH   r   r   r   r   rC   N   s    rC   )numpyr   r+   shapelyr   r   r   rC   r   r   r   r   <module>   s    1