o
    h
                     @  sT   d dl mZ d dlmZmZ d dlZerd dlmZ 	ddddZ		ddddZ
dS )    )annotations)TYPE_CHECKINGAnyN)CoordinateArrayFshapetuple[int, int]	want_maskboolreturnVtuple[CoordinateArray, CoordinateArray, CoordinateArray | np.ma.MaskedArray[Any, Any]]c              
   C  sr  | \}}t j|t jd}t j|t jd}t ||\}}|d }|d }t g d}t ddgddgdd	gd
dgdd
gg}	t g d}
t |}tt|D ]*}||| t || |	|df  d || |	|df  d   |
| d   7 }qQ|rt 	|| d d d || d d d  dk || d d d || d d d  dk }t j
j||d}|||fS )ai  Return simple test data consisting of the sum of two gaussians.

    Args:
        shape (tuple(int, int)): 2D shape of data to return.
        want_mask (bool, optional): Whether test data should be masked or not, default ``False``.

    Return:
        Tuple of 3 arrays: ``x``, ``y``, ``z`` test data, ``z`` will be masked if
        ``want_mask=True``.
    dtype      ?)r   g      皙?gffffff?皙?皙?g333333?r   g?g      ?r   g?)r   r   r   r   皙?r                 r   g{Gz?g?g{Gz?mask)nparangefloat64meshgridasarray
zeros_likerangelenexp
logical_ormaarray)r   r   nynxxyxscaleyscaleampmidwidthzir    r0   g/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/contourpy/util/data.pysimple   s&   (
R**
r2     r   seedintmask_fractionfloatc           
      C  s   | \}}t j|t jd}t j|t jd}t ||\}}t j|}|j| d}|dkrAt|d}|j| d|k }	t jj	||	d}|||fS )a  Return random test data in the range 0 to 1.

    Args:
        shape (tuple(int, int)): 2D shape of data to return.
        seed (int, optional): Seed for random number generator, default 2187.
        mask_fraction (float, optional): Fraction of elements to mask, default 0.

    Return:
        Tuple of 3 arrays: ``x``, ``y``, ``z`` test data, ``z`` will be masked if
        ``mask_fraction`` is greater than zero.
    r   )sizer   gGz?r   )
r   r   r   r   randomdefault_rnguniformminr#   r$   )
r   r4   r6   r%   r&   r'   r(   rngr.   r   r0   r0   r1   r9   3   s   

r9   )F)r   r   r   r	   r
   r   )r3   r   )r   r   r4   r5   r6   r7   r
   r   )
__future__r   typingr   r   numpyr   contourpy._contourpyr   r2   r9   r0   r0   r0   r1   <module>   s    )