a
    BCCf                     @   s   d dl Z d dlZd dlmZmZmZ z&d dlZdejd< d dl	m
Z dZW n ey`   dZY n0 d dlmZmZmZmZmZmZ e jje dd	G d
d dZdS )    N)assert_assert_array_equalassert_allcloseZAggbackendTF)delaunay_plot_2dvoronoi_plot_2dconvex_hull_plot_2dDelaunayVoronoi
ConvexHullzMatplotlib not available)reasonc                   @   s<   e Zd Zg dZdd Zdd Zdd Zdd	 Zd
d ZdS )TestPlotting))r   r   )r      )r   r   )r   r   c                 C   sX   t  }t| j}|j }t|| d}t|j| t	||u  t|| d d S Nax)
pltfigurer	   pointsZ	simplicescopyr   gcar   r   )selffigobjZs_beforer r   _/var/www/html/django/DPS/env/lib/python3.9/site-packages/scipy/spatial/tests/test__plotutils.pytest_delaunay   s    

zTestPlotting.test_delaunayc                 C   sF   t  }t| j}t|| d}t||u  t| t|dd d S )Nr   F)Zshow_vertices)r   r   r
   r   r   r   r   )r   r   r   r   r   r   r   test_voronoi    s    
zTestPlotting.test_voronoic                 C   s:   t  }t| j}t|| d}t||u  t| d S r   )r   r   r   r   r   r   r   )r   r   Ztrir   r   r   r   test_convex_hull)   s
    
zTestPlotting.test_convex_hullc                 C   s   t ddgddgddgddgd	d
gg}t|}t|}| }|jd  }t ddgddggddgddggddgddggddgddggg}t|| d S )Ngnin@br(%@gft@>,%@g$$Im@ӝ7*@gBz!vp@`MNe)@g1f'qk@ 5*@r   g*g\q@g*ogV謫q@gf3gwh\q@ggaogϘ^z@giZ@gl@g9nJf4gkZ~egxðgr@gtg@g}t@g6-p@nparrayr
   r   r   collectionsZget_segmentsr   r   r   Zvorr   r   Zinfinite_segmentsZexpected_segmentsr   r   r   test_gh_196531   s0    

zTestPlotting.test_gh_19653c                 C   s   t ddgddgddgddgd	d
gg}t|}t|}| }|jd  }t ddgddggddgddggddgddggddgddggg}t|| d S )NgnN[8@r    g4>@@r!   gI'L7@r"   g 0b:@r#   g6;5@r$   r   g7eF<@gҍ @g.+=E<@gVLEg eF<@gۮ @g6E@gmBR9L@gFv6@go'@g]tq/(g\rV8g>=@gwS@gώLn@@g8`@r%   r)   r   r   r   test_gh_19653_smaller_aspectG   s0    

z)TestPlotting.test_gh_19653_smaller_aspectN)	__name__
__module____qualname__r   r   r   r   r*   r+   r   r   r   r   r      s   
	r   )Zpytestnumpyr&   Znumpy.testingr   r   r   Z
matplotlibZrcParamsZmatplotlib.pyplotZpyplotr   Zhas_matplotlib	ExceptionZscipy.spatialr   r   r   r	   r
   r   markZskipifr   r   r   r   r   <module>   s   

 