
    e                     ~    d dl Zd dlZd dlZd dlmZ d dlmZmZm	Z	m
Z
mZmZ d dlmZ d dlmZ  G d de          ZdS )    N)Version)
AnnotationArrowHLineSplineTextVLine)Points)ComparisonTestCasec                   <    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	S )
AnnotationTestszU
    Tests allowable data formats when constructing
    the basic Element types.
    c                    t          t          j                  t          d          k    rd}nd}t          j        t
                    5 }t          d            d d d            n# 1 swxY w Y   |t          |j                  v sJ d S )Nz2.0.0a2z>ClassSelector parameter 'HLine.y' value must be an instance ofz8ClassSelector parameter 'y' value must be an instance of)	r   param__version__pytestraises
ValueErrorr   strvalue)selferrexcinfos      Hlib/python3.11/site-packages/holoviews/tests/element/test_annotations.pytest_hline_invalid_constructorz.AnnotationTests.test_hline_invalid_constructor   s    5$%%	(:(:::RCCLC]:&& 	'$KKK	 	 	 	 	 	 	 	 	 	 	 	 	 	 	c'-((((((((s   	A%%A),A)c                     t          ddd          }t          dg          |z   |                     |j        d           d S )NA   )r   r   )r   r
   assertEqualx)r   texts     r   test_text_string_positionz)AnnotationTests.test_text_string_position   sF    CC  zT!!%%%%%    c                    t          d          }|                     t          d |                    d          D                                  |                     |                    d          d           t          t          j        dg                    }|                     t          d |                    d          D                                  |                     |                    d          d           t          t          j        d                    }|                     t          d |                    d          D                                  |                     |                    d          d           d S )Nr   c              3   @   K   | ]}t          j        |           V  d S Nnpisfinite.0vs     r   	<genexpr>z>AnnotationTests.test_hline_dimension_values.<locals>.<genexpr>!   -      GG1A.GGGGGGr"   r   r   r   c              3   @   K   | ]}t          j        |           V  d S r%   r&   r)   s     r   r,   z>AnnotationTests.test_hline_dimension_values.<locals>.<genexpr>&   r-   r"   c              3   @   K   | ]}t          j        |           V  d S r%   r&   r)   s     r   r,   z>AnnotationTests.test_hline_dimension_values.<locals>.<genexpr>*   r-   r"   )r   
assertTrueallranger   r'   array)r   hlines     r   test_hline_dimension_valuesz+AnnotationTests.test_hline_dimension_values   s:   aGGAGGGGGHHHQ000 bhsmm$$GGAGGGGGHHHQ000bhqkk""GGAGGGGGHHHQ00000r"   c                    t          d          }|                     |                    d          d           |                     t	          d |                    d          D                                  t          t          j        dg                    }|                     |                    d          d           |                     t	          d |                    d          D                                  t          t          j        d                    }|                     |                    d          d           |                     t	          d |                    d          D                                  d S )Nr   r.   c              3   @   K   | ]}t          j        |           V  d S r%   r&   r)   s     r   r,   z>AnnotationTests.test_vline_dimension_values.<locals>.<genexpr>0   r-   r"   r   c              3   @   K   | ]}t          j        |           V  d S r%   r&   r)   s     r   r,   z>AnnotationTests.test_vline_dimension_values.<locals>.<genexpr>5   r-   r"   c              3   @   K   | ]}t          j        |           V  d S r%   r&   r)   s     r   r,   z>AnnotationTests.test_vline_dimension_values.<locals>.<genexpr>9   r-   r"   )r	   r   r3   r1   r2   r'   r4   )r   vlines     r   test_vline_dimension_valuesz+AnnotationTests.test_vline_dimension_values-   s:   aQ000GGAGGGGGHHH bhsmm$$Q000GGAGGGGGHHHbhqkk""Q000GGAGGGGGHHHHHr"   c                     t          dd          }|j                            d          }|                     |j        d         j        d           d S )Nr   )g      g      ?r   )r   redimr3   r   kdims)r   annotationsredimmeds      r   test_arrow_redim_range_auxz*AnnotationTests.test_arrow_redim_range_aux;   sN    Aqkk$**Z*88*0*=====r"   c                    t          ddd          t          dd          z   t          d          z   t          d          z   }|                    d          }|                    d          }|                    dd          }|                    d	 t                    }t          dd
dddg          }| 
                    |j         j        t          di |           | 
                    |j        j        t          di |           | 
                    |j        j        t          di |           | 
                    |j        j        t          di |           d S )Nr   r   )r      r>   zfoorE   )labeldepthc                 .    |                      d          S )Nbar)group)cloner>   s    r   <lambda>zBAnnotationTests.test_deep_clone_map_select_redim.<locals>.<lambda>E   s    !'''*>*> r"   rK   )r   NrE   Ny)rH   rL   extentsr@   )r   r   r   r.   )r   )r   r   r   r	   selectr?   relabelmapr   dictr   I)r   rA   selectedrB   
relabelledmappedkwargss          r    test_deep_clone_map_select_redimz0AnnotationTests.test_deep_clone_map_select_redim@   sP   Aq#q!4uQxx?%((J%%%//>>C>((%%E%;;
 > >
KKE8JSVX[R\]]](A(A&(A(ABBB)>)>v)>)>???););F););<<<););F););<<<<<r"   c                 H   g d}t          |g f                                          }|                     |                    d          t	          j        g d                     |                     |                    d          t	          j        g d                     d S )N))333333ӿr\   r.   )      ?      п)333333?r_   r   )r\   r   r]   r_   r   )r\   r   r^   r_   )r   rM   r   dimension_valuesr'   r4   )r   pointssplines      r   test_spline_clonez!AnnotationTests.test_spline_cloneL   s    AAA$$**,,0033RX>R>R>R5S5STTT0033RX>S>S>S5T5TUUUUUr"   N)__name__
__module____qualname____doc__r   r!   r6   r<   rC   rZ   rc    r"   r   r   r      s         
) ) )& & &
1 1 1I I I> > >

= 
= 
=V V V V Vr"   r   )numpyr'   r   r   packaging.versionr   	holoviewsr   r   r   r   r   r	   holoviews.elementr
   holoviews.element.comparisonr   r   rh   r"   r   <module>rn      s          % % % % % % C C C C C C C C C C C C C C C C $ $ $ $ $ $ ; ; ; ; ; ;EV EV EV EV EV( EV EV EV EV EVr"   