
    dW                       d dl Z d dlZd dlmZ d dlZd dlZd dlm	Z	 dZ
dZ G d dej                  Z G d d	e	j        e	j                  Zed
         Z G d de          Z G d de          Ze	j                            e	j         d           G d de                      Ze	j                            e	j         d           G d de                      Ze	j                            e	j         d           G d de                      Z G d de          Z G d de          Z G d de          Z G d de          Z G d  d!e          Z  G d" d#e          Z! G d$ d%e	j        e	j                  Z" G d& d'          Z# e#            Z$ e#d()          Z% e# ej&        d*d+d(d(,          -          Z' G d. d/e	j        e	j                  Z( G d0 d1e(          Z) G d2 d3e(          Z* G d4 d5e(          Z+ G d6 d7e(          Z, G d8 d9e(          Z- G d: d;e(          Z. G d< d=e(          Z/ G d> d?e(          Z0 G d@ dAe(          Z1 G dB dCe(          Z2 G dD dEe(          Z3 G dF dGe	j        e	j                  Z4 G dH dIe	j        e	j                  Z5 G dJ dKe	j        e	j                  Z6 G dL dMe	j7        e	j                  Z8dNZ G dO dPe	j        e	j                  Z9 G dQ dRe	j        e	j                  Z: G dS dTe:          Z; G dU dVe:          Z< G dW dXe:          Z= G dY dZe:          Z> G d[ d\e	j        e	j                  Z? G d] d^e?          Z@ G d_ d`e?          ZA G da dbe	j        e	j                  ZB G dc ddeB          ZC G de dfe	j        e	j                  ZDdg ZEeFdhk    rEd dlGZG e	jH        eGjI                    e	jJ                     e	j        K                    dij           dS dS )k    N)Path)common
   )`            c                       e Zd Z ej        ddd          Z ej        dd          Z ej        dd          Z	 ej
        dd          Zd	S )
TDescr          )itemsizedfltposr      )r   r   r	   N)__name__
__module____qualname__tb	StringColvar1BoolColvar2IntColvar3FloatColvar4 r   9lib/python3.11/site-packages/tables/tests/test_indexes.pyr   r      sh        2<!444D2:1!$$$D29!###D2;A1%%%DDDr   r   c                        e Zd ZdZdZdZdZeZe	d         Z
 fdZd Zd Zd Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z  xZ!S )BasicTestCaser   zlibr   c                     t                                                       | j        j        | _        |                                  | j                                         d S N)supersetUph5fileroot	rootgrouppopulateFileclose)self	__class__s    r    r'   zBasicTestCase.setUp   sL    )r   c                    | j         }d}t          j        | j        | j        | j        | j                  | _        | j        	                    |dt          || j        | j                  }t          | j                  D ]~}t          |                              d          |j        d<   |dz  |j        d<   ||j        d<   t!          | j        |z
  d	z
            |j        d
<   |j                                         |                                 |j                                        D ]}|                    t,                    }t.          j        r%t3          d| j                   t3          d|           d S )NThis is the IndexArray title	complevelcomplibshuffle
fletcher32tableasciir   r   r   r   r   r   _blocksizeszNumber of written rows:zNumber of indexed rows:)r*   r   Filterscompressr3   r4   r5   filtersr(   create_tabler   nrowsrangestrencoderowfloatappendflushcolinstancesvaluescreate_indexsmall_blocksizesr   verboseprint)r-   grouptitler6   icol	indexrowss          r    r+   zBasicTestCase.populateFile&   sg   .zDM*.,*.,-1_> > > (()-tzC Ctz"" 	 	A #Ag 6 6EIf !AEIf !EIf %dj1nq&8 9 9EIfI%,,.. 	G 	GC((5E(FFII> 	8+TZ888+Y777r   c                 Z   t           j        r,t          dd           t          d| j        j        z             t          j        | j        d          | _        | j        j	        j
        }t          d          D ]E}t          |                              d          |j        d<   |j                                         F|                                 |j        j        j        }t           j        r_t          d	|j                   t          d
|j                   t          d|j        j                   t          d|j        d                    d |                    d          D             }|                     t7          |          d           |                     |dgdz             dS )z:Checking flushing an Index incrementing only the last row.
<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z!Running %s.test00_flushLastRow...amoder	   r7   r   Max rows in buf:Number of elements per slice:Chunk size:zElements in last row:c                     g | ]
}|d          S r   r   .0ps     r    
<listcomp>z5BasicTestCase.test00_flushLastRow.<locals>.<listcomp>Y       BBB1V9BBBr   var1 == b"1"r      1N)r   rJ   rK   r.   r   r   	open_fileh5fnamer(   r)   r6   r?   r@   rA   rB   rD   rE   colsr   index
nrowsinbuf	slicesizesorted	chunksize	indicesLRwhereassertEquallen)r-   r6   rN   idxcolresultss        r    test00_flushLastRowz!BasicTestCase.test00_flushLastRowA   s    > 	+$	"""5.)* + + + l4<c::: &q 	 	A #Ag 6 6EIfI&> 	A$e&6777163CDDD-!8999)6+;B+?@@@ CBekk.&A&ABBBWq)))4&(+++++r   c                 2   t           j        r,t          dd           t          d| j        j        z             t          j        | j        d          | _        | j        j	        j
        }t          |                    d                    D ]0\  }}t          |          |d<   ||d<   |                                 1|                                 |j        j        j        }|j        j        j        }t           j        r*t          d	|j                   t          d
|j                   |                     |j        d           |                     |j        d           d |                    d          D             }|                     t-          |          d           |                     |dgdz             d |                    d          D             }|                     t-          |          d           |                     |dgdz             dS )z9Checking automatic re-indexing after an update operation.rR   rS   zRunning %s.test00_update...rT   rU   z(var3>1) & (var3<5)r   r   zDirtyness of var1 col:zDirtyness of var3 col:Fc                     g | ]
}|d          S r\   r   r]   s     r    r`   z/BasicTestCase.test00_update.<locals>.<listcomp>v   ra   r   rb   r   rc   c                     g | ]
}|d          S r   r   r]   s     r    r`   z/BasicTestCase.test00_update.<locals>.<listcomp>y       ???1V9???r   z	var3 == 0r   N)r   rJ   rK   r.   r   r   rd   re   r(   r)   r6   	enumeraterm   r@   updaterE   rf   r   rg   r   dirtyrn   ro   )r-   r6   rN   rB   idxcol1idxcol3rq   s          r    test00_updatezBasicTestCase.test00_update]   s    > 	K$	"""/$.2IIJJJ l4<c::: &,A B BCC 	 	FAsa&&CKCKJJLLLL*/'*/'> 	;*GM:::*GM:::...... CBekk.&A&ABBBWq)))4&(+++??ekk+&>&>???Wq)))1#a%(((((r   c                 L   t           j        r,t          dd           t          d| j        j        z             t          j        | j        d          | _        | j        j	        j
        }|j        j        j        }t           j        rDt          d|j                   t          d|j                   t          d|j        j                   d	 |                    d
          D             }|                     t)          |          d           |                     |dg           dS )z)Checking reading an Index (string flavor)rR   rS   zRunning %s.test01_readIndex...rrU   rW   rX   rY   c                     g | ]
}|d          S r\   r   r]   s     r    r`   z2BasicTestCase.test01_readIndex.<locals>.<listcomp>   ra   r   rb   r   rc   N)r   rJ   rK   r.   r   r   rd   re   r(   r)   r6   rf   r   rg   rh   ri   rj   rk   rm   rn   ro   r-   r6   rp   rq   s       r    test01_readIndexzBasicTestCase.test01_readIndex}   s    > 	N$	"""2T^5LLMMM l4<c::: &&> 	:$e&6777163CDDD-!8999 CBekk.&A&ABBBWq)))4&)))))r   c                    t           j        r,t          dd           t          d| j        j        z             t          j        | j        d          | _        | j        j	        j
        }|j        j        j        }t           j        rYt          d|j                   t          d|j                   t          d|j                   t          d	|j        j                   d
 |                    d          D             }t           j        rt          d|           |                     t+          |          | j        dz             |                     |dg| j        dz  z             dS )z'Checking reading an Index (bool flavor)rR   rS   zRunning %s.test02_readIndex...r   rU   zRows in table:rW   rX   rY   c                     g | ]
}|d          S )r   r   r]   s     r    r`   z2BasicTestCase.test02_readIndex.<locals>.<listcomp>   ra   r   zvar2 == TrueSelected values:r   TN)r   rJ   rK   r.   r   r   rd   re   r(   r)   r6   rf   r   rg   r>   rh   ri   rj   rk   rm   rn   ro   r   s       r    test02_readIndexzBasicTestCase.test02_readIndex   sM    > 	N$	"""2T^5LLMMM l4<c::: &&> 	:"EK000$e&6777163CDDD-!8999 CBekk.&A&ABBB> 	/$g...WtzQ7774&$*/":;;;;;r   c                 
   t           j        r,t          dd           t          d| j        j        z             t          j        | j        d          | _        | j        j	        j
        }|j        j        j        }t           j        rDt          d|j                   t          d|j                   t          d|j        j                   d	 |                    d
          D             }t           j        rt          d|           |                     t)          |          t+          d|j                  dz
             |                     |t/          t1          dt+          d|j                                                 dS )z&Checking reading an Index (int flavor)rR   rS   zRunning %s.test03_readIndex...r   rU   rW   rX   rY   c                     g | ]
}|d          S rv   r   r]   s     r    r`   z2BasicTestCase.test03_readIndex.<locals>.<listcomp>   s    HHH1V9HHHr   z(1<var3)&(var3<10)r   r   r   N)r   rJ   rK   r.   r   r   rd   re   r(   r)   r6   rf   r   rg   rh   ri   rj   rk   rm   rn   ro   minr>   listr?   r   s       r    test03_readIndexzBasicTestCase.test03_readIndex   sW    > 	N$	"""2T^5LLMMM l4<c::: &&> 	:$e&6777163CDDD-!8999 IHekk2F&G&GHHH> 	/$g...Ws2u{';';a'?@@@$uQB0D0D'E'E"F"FGGGGGr   c                 Z   t           j        r,t          dd           t          d| j        j        z             t          j        | j        d          | _        | j        j	        j
        }|j        j        j        }t           j        rYt          d|j                   t          d|j                   t          d|j                   t          d	|j        j                   d
 |                    d          D             }t           j        rt          d|           |                     t+          |          t-          d|j                             |                     |d t/          t1          t3          t-          d|j                                                D                        dS )z(Checking reading an Index (float flavor)rR   rS   zRunning %s.test04_readIndex...r   rU   rW   zNumber of rows in table:rX   rY   c                     g | ]
}|d          S )r   r   r]   s     r    r`   z2BasicTestCase.test04_readIndex.<locals>.<listcomp>   rw   r   	var4 < 10r   r   c                 ,    g | ]}t          |          S r   )rC   )r^   rN   s     r    r`   z2BasicTestCase.test04_readIndex.<locals>.<listcomp>   s    KKK!U1XXKKKr   N)r   rJ   rK   r.   r   r   rd   re   r(   r)   r6   rf   r   rg   rh   r>   ri   rj   rk   rm   rn   ro   r   reversedr   r?   r   s       r    test04_readIndexzBasicTestCase.test04_readIndex   s    > 	N$	"""2T^5LLMMM l4<c::: &&> 	:$e&6777,ek:::163CDDD-!8999 @?ekk+&>&>???> 	/$g...Ws2u{';';<<<KKxU3r5;3G3G-H-H(I(IJJKKK	M 	M 	M 	M 	Mr   c                    t           j        r,t          dd           t          d| j        j        z             t          j        | j        d          | _        | j        j	        j
        }|j        j        j        }t           j        rDt          d|j                   t          d|j                   t          d|j        j                   d	|_        |                    d
          }d |D             }t           j        r t          d|           t          d|           |                     t+          |          t+          |                     |                     ||           dS )z=Checking reading an Index with get_where_list (string flavor)rR   rS   z!Running %s.test05_getWhereList...rT   rU   rW   rX   rY   pythonvar1 < b"10"c                 4    g | ]}|d          dk     |j         S r   s   10nrowr]   s     r    r`   z5BasicTestCase.test05_getWhereList.<locals>.<listcomp>   (    ???qQvY->->AF->->->r   r   Should look like:Nr   rJ   rK   r.   r   r   rd   re   r(   r)   r6   rf   r   rg   rh   ri   rj   rk   flavorget_where_listrn   ro   r-   r6   rp   rowList1rowList2s        r    test05_getWhereListz!BasicTestCase.test05_getWhereList   sS    > 	+$	"""5.)* + + + l4<c::: &&> 	:$e&6777163CDDD-!8999  ''77??E???> 	1$h///%x000XH6668,,,,,r   c                 ^   t           j        r,t          dd           t          d| j        j        z             t          j        | j        d          | _        | j        j	        j
        }|j        j        j        }t           j        rYt          d|j                   t          d|j                   t          d|j                   t          d	|j        j                   d
|_        |                    dd          }d |D             }t+          j        |t*          j                  }t           j        r t          d|           t          d|           |                     t3          |          t3          |                     |                     t          j        ||                     dS )z;Checking reading an Index with get_where_list (bool flavor)rR   rS   z!Running %s.test06_getWhereList...rT   rU   rW   zRows in tables:rX   rY   numpyzvar2 == FalseTsortc                 0    g | ]}|d          du |j         S )r   Fr   r]   s     r    r`   z5BasicTestCase.test06_getWhereList.<locals>.<listcomp>  s(    @@@qQvY%-?-?AF-?-?-?r   r   r   N)r   rJ   rK   r.   r   r   rd   re   r(   r)   r6   rf   r   rg   rh   r>   ri   rj   rk   r   r   nparrayint64rn   ro   
assertTrueallequalr   s        r    test06_getWhereListz!BasicTestCase.test06_getWhereList   s    > 	+$	"""5.)* + + + l4<c::: &&> 	:$e&6777#U[111163CDDD-!8999 ''d'CC@@E@@@8Hbh//> 	1$h///%x000XH666(;;<<<<<r   c                    t           j        r,t          dd           t          d| j        j        z             t          j        | j        d          | _        | j        j	        j
        }|j        j        j        }t           j        rDt          d|j                   t          d|j                   t          d|j        j                   d	|_        |                    d
d          }d |D             }t           j        r t          d|           t          d|           |                     t+          |          t+          |                     |                     ||           dS )z:Checking reading an Index with get_where_list (int flavor)rR   rS   z!Running %s.test07_getWhereList...rT   rU   rW   rX   rY   r   z	var3 < 15Tr   c                 4    g | ]}|d          dk     |j         S )r      r   r]   s     r    r`   z5BasicTestCase.test07_getWhereList.<locals>.<listcomp>)  #    <<<qQvY^^AF^^^r   r   r   Nr   r   s        r    test07_getWhereListz!BasicTestCase.test07_getWhereList  X    > 	+$	"""5.)* + + + l4<c::: &&> 	:$e&6777163CDDD-!8999  ''$'??<<E<<<> 	1$h///%x000XH6668,,,,,r   c                    t           j        r,t          dd           t          d| j        j        z             t          j        | j        d          | _        | j        j	        j
        }|j        j        j        }t           j        rDt          d|j                   t          d|j                   t          d|j        j                   d	|_        |                    d
d          }d |D             }t           j        r t          d|           t          d|           |                     t+          |          t+          |                     |                     ||           dS )z<Checking reading an Index with get_where_list (float flavor)rR   rS   z!Running %s.test08_getWhereList...rT   rU   rW   rX   rY   r   r   Tr   c                 4    g | ]}|d          dk     |j         S )r   r   r   r]   s     r    r`   z5BasicTestCase.test08_getWhereList.<locals>.<listcomp>D  r   r   r   r   Nr   r   s        r    test08_getWhereListz!BasicTestCase.test08_getWhereList0  r   r   c                 l   t           j        r,t          dd           t          d| j        j        z             t          j        | j        d          | _        | j        j	        j
        }|j        j        j        }t           j        r)t          d           t          d|j        j                   |                     |j        d         d	           |                     |           |j        j                                         t           j        r)t          d
           t          d|j        j                   |                     |j        j        j                   |                     |j        d         d           |j        j                            t(                    }|                     |           |j        j        j        }t           j        r)t          d           t          d|j        j                   |                     |           |                     |j        d         d	           dS )zChecking removing an index.rR   rS   z!Running %s.test09a_removeIndex...rT   rU   Before deletionvar1 column:r   r   After deletionr   r8   After re-creationN)r   rJ   rK   r.   r   r   rd   re   r(   r)   r6   rf   r   rg   rn   
colindexedassertIsNotNoneremove_indexassertIsNonerH   rI   r-   r6   rp   rP   s       r    test09a_removeIndexz!BasicTestCase.test09a_removeIndexK  s    > 	+$	"""5.)* + + + l4<c::: &&> 	3#$$$.%*/222)&11555V$$$ 	
$$&&&> 	3"###.%*/222%*//000)&11555 JO00=M0NN	Y'''&> 	3%&&&.%*/222V$$$)&1155555r   c                    t           j        r,t          dd           t          d| j        j        z             t          j        | j        d          | _        | j        j	        j
        }|j        j        j        }t           j        r)t          d           t          d|j        j                   |                     |           |                     |j        d         d	           |j        j                                         |                     d           | j        j	        j
        }|j        j        j        }t           j        r)t          d
           t          d|j        j                   |                     |j        j        j                   |                     |j        d         d           |j        j                            t*                    }|                     |           |j        j        j        }t           j        r)t          d           t          d|j        j                   |                     |           |                     |j        d         d	           dS )z/Checking removing an index (persistent version)rR   rS   z!Running %s.test09b_removeIndex...rT   rU   r   var1 index column:r   r   r   r   r   r8   r   N)r   rJ   rK   r.   r   r   rd   re   r(   r)   r6   rf   r   rg   r   rn   r   r   _reopenr   rH   rI   r   s       r    test09b_removeIndexz!BasicTestCase.test09b_removeIndexo  s     > 	+$	"""5.)* + + + l4<c::: &&> 	9#$$$&
888V$$$)&11555
$$&&& 	# &&> 	3"###.%*/222%*//000)&11555 JO00=M0NN	Y'''&> 	3%&&&.%*/222V$$$)&1155555r   c                 2   t           j        r,t          dd           t          d| j        j        z             t          j        | j        d          | _        | j        j	        j
        }|j        j        j        }t           j        rt          d           t          d|           |                     |j        d         d	           |                     |           | j                            d
d          }|                    |d           t           j        rt          d           t          d|           |                     |j        j        j                   |                     |j        d         d	           d|_        |                    d          }d |D             }t           j        r t          d|           t          d|           |                     t+          |          t+          |                     |                     ||           dS )z&Checking moving a table with an index.rR   rS   zRunning %s.test10a_moveIndex...rT   rU   Before mover   r   r   /agrouptable2
After mover   r   c                 4    g | ]}|d          dk     |j         S r   r   r]   s     r    r`   z3BasicTestCase.test10a_moveIndex.<locals>.<listcomp>  r   r   r   r   Nr   rJ   rK   r.   r   r   rd   re   r(   r)   r6   rf   r   rg   rn   r   r   create_groupmover   r   ro   r-   r6   rp   r   r   r   s         r    test10a_moveIndexzBasicTestCase.test10a_moveIndex  s    > 	O$	"""3dn6MMNNN l4<c::: &&> 	*-   .&))))&11555V$$$ ))#x88 	

68$$$> 	*,.&)))UZ_2333)&11555  ''77??E???> 	1$h///%x000XH6668,,,,,r   c                    t           j        r,t          dd           t          d| j        j        z             t          j        | j        d          | _        | j        j	        j
        }|j        j        j        }t           j        rt          d           t          d|           |                     |           |                     |j        d         d	           | j                            d
d          }|                    |d           |                     d           | j        j	        j        j        }|j        j        j        }t           j        rt          d           t          d|           |                     |j        j        j                   |                     |j        d         d	           d|_        |                    d          }d |D             }t           j        r<t          d|t1          |                     t          d|t1          |                     |                     t3          |          t3          |                     |                     ||           dS )z:Checking moving a table with an index (persistent version)rR   rS   zRunning %s.test10b_moveIndex...rT   rU   r   r   r   r   r   r   r   r   r   r   r   c                 4    g | ]}|d          dk     |j         S r   r   r]   s     r    r`   z3BasicTestCase.test10b_moveIndex.<locals>.<listcomp>  r   r   r   r   N)r   rJ   rK   r.   r   r   rd   re   r(   r)   r6   rf   r   rg   r   rn   r   r   r   r   r   r   r   r   typero   r   s         r    test10b_moveIndexzBasicTestCase.test10b_moveIndex  s0    > 	O$	"""3dn6MMNNN l4<c::: &&> 	0-   &///V$$$)&11555))#x88 	

68$$$ 	# '.&> 	*,.&)))UZ_2333)&11555  ''77??E???> 	A$hX???%xh@@@XH6668,,,,,r   c                 4   t           j        r,t          dd           t          d| j        j        z             t          j        | j        dd          | _        | j        j	        j
        }|j        j        j        }t           j        rt          d           t          d|           |                     |j        d	         d
           |                     |           | j                            dd          }|                    |d           t           j        rt          d           t          d|           |                     |j        j        j                   |                     |j        d	         d
           d|_        |                    d          }d |D             }t           j        r t          d|           t          d|           |                     t+          |          t+          |                     |                     ||           dS )z9Checking moving a table with an index (small node cache).rR   rS   zRunning %s.test10c_moveIndex...rT   r   rV   node_cache_slotsr   r   r   r   r   r   r   r   r   r   c                 4    g | ]}|d          dk     |j         S r   r   r]   s     r    r`   z3BasicTestCase.test10c_moveIndex.<locals>.<listcomp>  r   r   r   r   Nr   r   s         r    test10c_moveIndexzBasicTestCase.test10c_moveIndex  s    > 	O$	"""3dn6MMNNN l4<cBOOO &&> 	*-   .&))))&11555V$$$ ))#x88 	

68$$$> 	*,.&)))UZ_2333)&11555  ''77??E???> 	1$h///%x000XH6668,,,,,r   c                 4   t           j        r,t          dd           t          d| j        j        z             t          j        | j        dd          | _        | j        j	        j
        }|j        j        j        }t           j        rt          d           t          d|           |                     |j        d	         d
           |                     |           | j                            dd          }|                    |d           t           j        rt          d           t          d|           |                     |j        j        j                   |                     |j        d	         d
           d|_        |                    d          }d |D             }t           j        r t          d|           t          d|           |                     t+          |          t+          |                     |                     ||           dS )z6Checking moving a table with an index (no node cache).rR   rS   zRunning %s.test10d_moveIndex...rT   r   r   r   r   r   r   r   r   r   r   r   r   c                 4    g | ]}|d          dk     |j         S r   r   r]   s     r    r`   z3BasicTestCase.test10d_moveIndex.<locals>.<listcomp>.  r   r   r   r   Nr   r   s         r    test10d_moveIndexzBasicTestCase.test10d_moveIndex  s    > 	O$	"""3dn6MMNNN l4<cANNN &&> 	*-   .&))))&11555V$$$ ))#x88 	

68$$$> 	*,.&)))UZ_2333)&11555  ''77??E???> 	1$h///%x000XH6668,,,,,r   c                    t           j        r,t          dd           t          d| j        j        z             t          j        | j        d          | _        | j        j	        j
        }|j        j        j        }t           j        r)t          d           t          d|j        j                   |                     |j        d         d	           |                     |           | j                            d
           t           j        rt          d           |                     d| j        j	                   | j                            ddt(          d| j        | j                  }t/          | j                  D ]k}t1          |          |j        d<   |dz  |j        d<   ||j        d<   t5          | j        |z
  d	z
            |j        d<   |j                                         l|                                 |j                                        D ]2}|                    t@                    }|                     |           3|j        j        j        }t           j        r)t          d           t          d|j        j                   |                     |           |                     |j        d         d	           dS )z'Checking removing a table with indexes.rR   rS   z*Running %s.test11a_removeTableWithIndex...rT   rU   r   r   r   r   /tabler   r6   r   	New tabler   r   r   r   r8   r   N)!r   rJ   rK   r.   r   r   rd   re   r(   r)   r6   rf   r   rg   rn   r   r   remove_nodeassertNotInr=   r   r<   r>   r?   r@   rB   rC   rD   rE   rF   rG   rH   rI   r-   r6   rp   rN   rO   rP   s         r    test11a_removeTableWithIndexz*BasicTestCase.test11a_removeTableWithIndex5  s    > 	+$	""">.)* + + + l4<c::: &&> 	3#$$$.%*/222)&11555V$$$ 	)))> 	$"###$+"2333 ((gv{)-tzC Ctz"" 	 	A #AEIf !AEIf !EIf %dj1nq&8 9 9EIfI%,,.. 	, 	,C((5E(FFI  ++++&> 	3%&&&.%*/222V$$$)&1155555r   c                    t           j        r,t          dd           t          d| j        j        z             t          j        | j        d          | _        | j        j	        j
        }|j        j        j        }t           j        r)t          d           t          d|j        j                   |                     |j        d         d	           |                     |           | j                            d
           t           j        rt          d           |                     d| j        j	                   |                     d           | j                            ddt*          d| j        | j                  }t1          | j                  D ]k}t3          |          |j        d<   |dz  |j        d<   ||j        d<   t7          | j        |z
  d	z
            |j        d<   |j                                         l|                                 |j                                        D ]2}|                     tB                    }|                     |           3|j        j        j        }t           j        r)t          d           t          d|j        j                   |                     |           |                     |j        d         d	           dS )z=Checking removing a table with indexes (persistent version 2)rR   rS   z*Running %s.test11b_removeTableWithIndex...rT   rU   r   r   r   r   r   r   r6   r+r   r   r   r   r   r   r8   r   N)"r   rJ   rK   r.   r   r   rd   re   r(   r)   r6   rf   r   rg   rn   r   r   r   r   r   r=   r   r<   r>   r?   r@   rB   rC   rD   rE   rF   rG   rH   rI   r   s         r    test11b_removeTableWithIndexz*BasicTestCase.test11b_removeTableWithIndexb  s    > 	+$	""">.)* + + + l4<c::: &&> 	3#$$$.%*/222)&11555V$$$ 	)))> 	$"###$+"2333 	$ ((gv{)-tzC Ctz"" 	 	A #AEIf !AEIf !EIf %dj1nq&8 9 9EIfI%,,.. 	, 	,C((5E(FFI  ++++&> 	3%&&&.%*/222V$$$)&1155555r   c                 .   t           j        r,t          dd           t          d| j        j        z              G d dt
          j                  }t          | j                  	                                 t          j        d          | _        t          j        | j        d          | _        | j                            | j        j        d	|          }|j        j                            t&          
           |j        }t+          d          D ]0}||d<   t-          |dz            |d<   |                                 1|                                 |                     d           | j                            | j        j        j                   dS )z=Checking removing a table with indexes (persistent version 3)rR   rS   z*Running %s.test11c_removeTableWithIndex...c                   R    e Zd Z ej        d          Z ej        d          ZdS )<BasicTestCase.test11c_removeTableWithIndex.<locals>.Distancer   r   r   N)r   r   r   r   Int32Colframer   distancer   r   r    Distancer     s6        BKA&&&E"r{q)))HHHr   r   z.h5wrU   distance_tabler8   r   r   r   r   r   N)r   rJ   rK   r.   r   r   IsDescriptionr   re   unlinktempfilemktemprd   r(   r=   r)   rf   r   rH   rI   rB   r?   rC   rD   rE   r   r   r   )r-   r   r6   r   rN   s        r    test11c_removeTableWithIndexz*BasicTestCase.test11c_removeTableWithIndex  s    > 	+$	""">.)* + + +	* 	* 	* 	* 	*r' 	* 	* 	*
 	T\!!###u--l4<c:::((K.: :
%%2B%CCCIr 	 	AAgJ!!Q$KKAjMHHJJJJ$ 0 ?@@@@@r   c                 b   t          j        | j        d          | _        | j        j        j        }dd| j        g}| j        dk    r|                    | j        dz
             |D ]G}d|                    dt          |                    g}d|                    dt          |                    g}	 	 t          |d                    |dxx         dz  cc<   &# t          $ r9 |d         D ]}|dxx         dz  cc<   |d         D ]}|dxx         dz  cc<   Y nw xY w|                     |d         |           |                     |d         |           |                     t          t          |                    dt          |                                        |           Id S )	Nr   rU   r   r   i  r   z
(var3 < e))e)r   rd   re   r(   r)   r6   r>   rD   rm   dictnextStopIterationrn   ro   r   )r-   r6   testslimithandle_ahandle_b_s          r    test12_doubleIteratez"BasicTestCase.test12_doubleIterate  s   l4<c::: &Atz":LLc)*** 	L 	LE5;;|TE]]]CCDH5;;|TE]]]CCDH%%!%%%QKKK1$KKK% ! % % %!! % %AQKKK1$KKKK!! % %AQKKK1$KKKK% %% Xa[%000Xa[%000D\4%===AABBCCUL L L L!	L 	Ls   6'CA D D )"r   r   r   r;   r3   r4   r5   minRowIndexr>   rI   ssr'   r+   rr   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __classcell__r.   s   @r    r"   r"      s       HGGJE	!	B      6, , ,8) ) )@* * **< < <0H H H.M M M6- - -6= = =<- - -6- - -6"6 "6 "6H'6 '6 '6R$- $- $-L)- )- )-V$- $- $-L$- $- $-L+6 +6 +6Z-6 -6 -6`A A A>L L L L L L Lr   r"   r   c                   "    e Zd ZdZdZdZdZeZdS )BasicReadTestCaser   r#   N	r   r   r   r;   r3   r4   r5   small_ssr>   r   r   r    r  r    '        HGGJEEEr   r  c                   "    e Zd ZdZdZdZdZeZdS )ZlibReadTestCaser   r#   r   Nr  r   r   r    r  r    r	  r   r  z'BLOSC compression library not availablec                   "    e Zd ZdZdZdZdZeZdS )BloscReadTestCaser   bloscr   Nr  r   r   r    r  r    )         HGGJEEEr   r  z%LZO compression library not availablec                   "    e Zd ZdZdZdZdZeZdS )LZOReadTestCaser   lzor   Nr  r   r   r    r  r    s)         HGGJEEEr   r  z'BZIP2 compression library not availablec                   "    e Zd ZdZdZdZdZeZdS )Bzip2ReadTestCaser   bzip2r   Nr  r   r   r    r  r    r  r   r  c                   "    e Zd ZdZdZdZdZeZdS )ShuffleReadTestCaser   r#   r   Nr  r   r   r    r  r    r	  r   r  c                   "    e Zd ZdZdZdZdZeZdS )Fletcher32ReadTestCaser   r#   r   Nr  r   r   r    r  r    r	  r   r  c                   "    e Zd ZdZdZdZdZeZdS )ShuffleFletcher32ReadTestCaser   r#   Nr  r   r   r    r  r    r	  r   r  c                       e Zd Zeedz  z   ZdS )OneHalfTestCaser   Nr   r   r   r  r>   r   r   r    r  r    s        x{"EEEr   r  c                       e Zd Zedz   ZdS )UpperBoundTestCaser   Nr  r   r   r    r   r     s        qLEEEr   r   c                       e Zd Zedz  dz
  ZdS )LowerBoundTestCaser   r   Nr  r   r   r    r"  r"    s        qLNEEEr   r"  c                   0    e Zd ZeZd Zd Zd Zd Zd Z	dS )DeepTableIndexTestCasec                 b   | j                             | j         j        d          }d}| j                             |dt          |d| j                  }t          | j                  D ]}|j                                         |	                                 |j
        j                                        }|                     |           |j
        j        j        }|                     |j        d         d           |                     |           |                     |j        | j                   dS )z9Checking the indexing of a table in a 2nd level hierarchyr   r0   r6   Nr   r   r(   r   r)   r=   r   r>   r?   rB   rD   rE   rf   r   rH   r   rg   rn   r   	nelementsr-   rL   rM   r6   rN   rP   rp   s          r    test01zDeepTableIndexTestCase.test01#  s    (()98DD.(()-tz; ;tz"" 	 	AIJO0022	Y'''&)&11555V$$$)4:66666r   c                    | j                             | j         j        d          }d}| j                             |dt          |d| j                  }t          | j                  D ]}|j                                         |	                                 |j
        j                                        }|                     |           |j
        j        j        }|                     d           | j         j        j        j        }|j
        j        j        }|                     |j        d         d           |                     |           |                     |j        | j                   dS )	zJChecking the indexing of a table in 2nd level
        (persistent version)r   r0   r6   NrT   rU   r   r   r(   r   r)   r=   r   r>   r?   rB   rD   rE   rf   r   rH   r   rg   r   r   r6   rn   r   r'  r(  s          r    test01bzDeepTableIndexTestCase.test01b9  sF   
 (()98DD /(()-tz; ;tz"" 	 	AI JO0022	Y'''& 	# '-&)&11555V$$$)4:66666r   c                    | j                             | j         j        d          }| j                             |d          }| j                             |d          }d}| j                             |dt          |d| j                  }t          | j                  D ]}|j                                         |	                                 |j
        j                                        }|                     |           |j
        j        j        }|                     |j        d         d           |                     |           |                     |j        | j                   dS )z9Checking the indexing of a table in a 4th level hierarchyr   r0   r6   Nr   r   r&  r(  s          r    test02zDeepTableIndexTestCase.test02X  sD    (()98DD((99((99 /(()-tz; ;tz"" 	 	AI JO0022	Y'''& 	)&11555V$$$)4:66666r   c                 \   | j                             | j         j        d          }| j                             |d          }| j                             |d          }d}| j                             |dt          |d| j                  }t          | j                  D ]}|j                                         |	                                 |j
        j                                        }|                     |           |j
        j        j        }|                     d           | j         j        j        j        j        j        }|j
        j        j        }|                     |j        d         d           |                     |           |                     |j        | j                   dS )	zLChecking the indexing of a table in a 4th level
        (persistent version)r   r0   r6   NrT   rU   r   r   r+  r(  s          r    test02bzDeepTableIndexTestCase.test02bs  s|   
 (()98DD((99((99 /(()-tz; ;tz"" 	 	AI JO0022	Y'''& 	# '.5;& 	)&11555V$$$)4:66666r   c                    | j         j        }t          d          D ]}| j                             |d          }d}| j                             |dt
          |d| j                  }t          | j                  D ]}|j                                         |	                                 |j
        j                                        }|                     |           |j
        j        j        }|                     |j        d         d           |                     |           |                     |j        | j                   dS )z;Checking the indexing of a table in a 100th level hierarchyd   r   r0   r6   Nr   r   )r(   r)   r?   r   r=   r   r>   rB   rD   rE   rf   r   rH   r   rg   rn   r   r'  )r-   rL   rN   rM   r6   rP   rp   s          r    test03zDeepTableIndexTestCase.test03  s2     s 	> 	>AK,,UH==EE /(()-tz; ;tz"" 	 	AI JO0022	Y'''& 	)&11555V$$$)4:66666r   N)
r   r   r   r  r>   r)  r,  r.  r0  r3  r   r   r    r$  r$     se        E7 7 7,7 7 7>7 7 76 7  7  7D7 7 7 7 7r   r$  c                   B    e Zd Zej        j        ej        j        fdZdS )
IndexPropsc                 "    || _         || _        d S r%   autor<   )r-   r8  r<   s      r    __init__zIndexProps.__init__  s    	r   N)r   r   r   r   rg   default_auto_indexdefault_index_filtersr9  r   r   r    r5  r5    s8        H77     r   r5  F)r8  r   r#   r1   )r<   c                        e Zd ZdZeZg dZdZ fdZd Z	d Z
d Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Z xZS )AutomaticIndexingTestCaser   r   r   r   )      r   r   c           	      d   t                                                       d}| j        j        }d}| j                            |dt
          |d | j        |          | _        | j        j	        | j        _
        | j        D ]-}| j        j        |                             | j                   .t          | j                  D ] }| j        j                                         !| j                                         | j        r.|                     d           | j        j        j        | _        d S d S )Nr0   )r   r6   )
chunkshaper8   rT   rU   )r&   r'   r(   r)   r=   r   r>   r6   ipropsr8  	autoindexcolsToIndexrF   rH   rI   r?   rB   rD   rE   reopenr   )r-   rM   r)   rB  colnamerN   r.   s         r    r'   zAutomaticIndexingTestCase.setUp  s4    /{ 
[--dGVU.2DJ9C . E E
  ${/
' 	3 	3GJ#G,99 1 : 3 3 3 3tz"" 	$ 	$AJN!!####
; 	0LLcL""")/DJJJ	0 	0r   c                    t           j        r,t          dd           t          d| j        j        z             | j        }| j        t          u r|                     |j	        d           n|                     |j	        d           | j        t          u r|                     |j
        d         d           |                     |j        j        j                   |                     |j
        d         d           |                     |j        j        j                   |                     |j
        d         d           |                     |j        j        j                   |                     |j
        d	         d           |                     |j        j        j                   d
S |                     |j
        d         d           |                     |j        j        j                   |                     |j
        d         d           |                     |j        j        j                   |                     |j
        d         d           |                     |j        j        j                   |                     |j
        d	         d           |                     |j        j        j                   d
S )z$Checking indexing attributes (part1)rR   rS   zRunning %s.test01_attrs...r   r   r   r   r   r   N)r   rJ   rK   r.   r   r6   rC  DefaultPropsrn   indexedr   r   rf   r   rg   r   r   r   r   r-   r6   s     r    test01_attrsz&AutomaticIndexingTestCase.test01_attrs  sb    > 	J$	""".1HHIII
;,&&U]A....U]A...;,&&U-f5q999ejo3444U-f5q999ejo3444U-f5q999ejo3444U-f5q999ejo344444 U-f5q999  !6777U-f5q999  !6777U-f5q999  !6777U-f5q999ejo344444r   c                 `   t           j        r,t          dd           t          d| j        j        z             | j        }t           j        r,|j        rt          d|j                   nt          d           | j        t          u r| 
                    |j                   n(| j        t          u r|                     |j                   | j        t          u r|                     |j        j        j        d           |                     |j        j        j        d           |                     |j        j        j        d           |                     |j        j        j        d           dS |                     |j        j        j        t,          j        j                   |                     |j        j        j        t,          j        j                   |                     |j        j        j        t,          j        j                   |                     |j        j        j        d           dS )z$Checking indexing attributes (part2)rR   rS   zRunning %s.test02_attrs...zindex props:Table is not indexedN)r   rJ   rK   r.   r   r6   rJ  rD  rC  NoAutoPropsassertFalseChangeFiltersPropsr   rI  rn   rf   r   rg   r   r   r   assertIsInstancer   IndexrK  s     r    test02_attrsz&AutomaticIndexingTestCase.test02_attrs  s    > 	J$	""".1HHIII
 > 	.} .neo6666,--- ;+%%U_----[...OOEO,,, ;,&&UZ_2D999UZ_2D999UZ_2D999UZ_2D99999!!%*/"7HHH!!%*/"7HHH!!%*/"7HHHUZ_2D99999r   c                 ~   t           j        r,t          dd           t          d| j        j        z             | j        }t           j        r|j        rnt          d|j                   t          d|j                   |j	        j
        j        }t          d|j                   t          d|j        |j        z             nt          d           | j        t          ur_|j	        j
        j        }|j        }|                     |j        |           |j        }|                     |j        | j        |z
             d	S d	S )
zChecking indexing countersrR   rS   zRunning %s.test03_counters...indexedrows:unsavedindexedrows:ztable rows:computed indexed rows:rN  N)r   rJ   rK   r.   r   r6   rJ  _indexedrows_unsaved_indexedrowsrf   r   rg   r>   ri   rC  rI  r'  rn   r-   r6   rg   indexedrowss       r    test03_countersz)AutomaticIndexingTestCase.test03_counters   s?    > 	M$	"""1DN4KKLLL
 > 	.} .ne&8999+U-GHHH
-mU[111.eo0MNNNN,---;l**JO)E/KU/===/KU7!Z+57 7 7 7 7 +*r   c                 8   t           j        r,t          dd           t          d| j        j        z             | j        }|                                 t           j        rg|j        rQt          d|j                   t          d|j	                   |j
        j        j        }t          d|j                   nt          d           |j
        j        j        }| j        t          u r|                     |           nJ|j        }|                     |j        |j                   |                     |j	        | j        |z
             | j        t&          u r|                     |j                   dS | j        t,          u r|                     |j                   dS dS )	z/Checking indexing counters (non-automatic mode)rR   rS   zRunning %s.test04_noauto...rV  rW  rX  rN  N)r   rJ   rK   r.   r   r6   flush_rows_to_indexrJ  rY  rZ  rf   r   rg   r'  rC  rI  r   rn   r>   rO  rP  rD  rQ  r   r[  s       r    test04_noautoz'AutomaticIndexingTestCase.test04_noauto:  s    > 	K$	"""/$.2IIJJJ
 	!!### > 	.} .ne&8999+U-GHHH
-.@@@@,--- 
%;,&&e$$$$/KU/AAAU7!Z+57 7 7 ;+%%U_-----[...OOEO,,,,, /.r   c                    t           j        r,t          dd           t          d| j        j        z             | j        }|                                 | j        t          ur|j	        }|j
        }|                    dd           | j        r'|                     d           | j        j        j        }t           j        r|j        rot          d|j	                   t          d	|           t          d
|j
                   t          d|           t          d|j        j        j        j                   nt          d           |                     |j        | j        dz
             | j        t.          u r)|                     |j        j        j        j                   | j        t.          u r|                     |j                   dS | j        t6          u r|                     |j                   dS dS )z(Checking indexing counters (remove_rows)rR   rS   zRunning %s.test05_icounters...r   r   rT   rU   rV  original indexedrows:rW  original unsavedindexedrows:zindex dirty:rN  N)r   rJ   rK   r.   r   r6   r_  rC  rI  rY  rZ  remove_rowsrF  r   r(   r)   rJ  rf   r   rg   rz   rn   r>   rO  r   rP  rD  rQ  )r-   r6   r\  unsavedindexedrowss       r    test05_icountersz*AutomaticIndexingTestCase.test05_icounters_  s    > 	N$	"""2T^5LLMMM
 	!!### ;l**,K!&!; 	!Q; 	+LLcL"""K$*E > 		.} .ne&8999-{;;;+U-GHHH46HIIInejo&;&ABBBB,--- 	dj1n555;+%%OOEJO17888 ;+%%U_-----[...OOEO,,,,, /.r   c           	      x   t           j        r,t          dd           t          d| j        j        z             | j        }|                                 |                    dd           | j        r'| 	                    d           | j
        j        j        }t           j        rut          d|j                   |j        D ]X}|j                            |          j        r7t          d	|d
|j                            |          j        j                   Y|j        D ]}|j                            |          j        rx|j        s9|                     |j                            |          j        j        d           a|                     |j                            |          j        j        d           dS )z)Checking dirty flags (remove_rows action)rR   rS   zRunning %s.test06_dirty...r	      rT   rU   z
auto flag:dirty flag col : TFN)r   rJ   rK   r.   r   r6   r_  rd  rF  r   r(   r)   rD  colnamesrf   _f_colrg   rz   rn   )r-   r6   rG  s      r    test06_dirtyz&AutomaticIndexingTestCase.test06_dirty  s    > 	J$	""".1HHIII
 	!!### 	!Q; 	+LLcL"""K$*E > 	M,000 > M M:$$W--3 ME"77EJ$5$5g$>$>$D$J$JL M M M ~ 	, 	,Gz  ))/ , ,$$UZ%6%6w%?%?%E%K%)+ + + + $$UZ%6%6w%?%?%E%K%*, , ,	, 	,r   c           	      `   t           j        r,t          dd           t          d| j        j        z             | j        }|                                 | j        t          ur|j	        }|j
        }|                    ddddg           | j        r'|                     d	           | j        j        j        }t           j        r|j        rqt          d
|j	                   t          d|           t          d|j
                   t          d|           |j        j        j        }t          d|j                   nt          d           |                     |j        | j                   | j        t.          u r)|                     |j        j        j        j                   t           j        r`|j        D ]X}|j                            |          j        r7t          d|d|j                            |          j        j                   Y|j        D ]}|j                            |          j        rx|j        s9|                     |j                            |          j        j        d           a|                     |j                            |          j        j        d           dS )z6Checking indexing counters (modify_rows, no-auto mode)rR   rS   zRunning %s.test07_noauto...r	   Nr   )asar   r	   @rT   rU   rV  rb  rW  rc  rX  rN  ri  rj  TF)r   rJ   rK   r.   r   r6   r_  rC  rI  rY  rZ  modify_rowsrF  r   r(   r)   rJ  rf   r   rg   r'  rn   r>   rO  r   rz   rk  rl  rD  )r-   r6   r\  re  rg   rG  s         r    test07_noautoz'AutomaticIndexingTestCase.test07_noauto  s    > 	K$	"""/$.2IIJJJ
 	!!### ;l**,K!&!; 	!T1'9&:;;;; 	+LLcL"""K$*E > 		.} .ne&8999-{;;;+U-GHHH46HIII
-.@@@@,--- 	dj111;+%%OOEJO17888 > 	M > M M:$$W--3 ME"77EJ$5$5g$>$>$D$J$JL M M M~ 	, 	,Gz  ))/ , ,$$UZ%6%6w%?%?%E%K%)+ + + + $$UZ%6%6w%?%?%E%K%*, , ,	, 	,r   c                    t           j        r,t          dd           t          d| j        j        z             | j        }|                                 d |                    d          D             }|D ]5}|j        dk    r(d|d<   d	|d
<   d|d<   d|d<   |	                                 6|
                                 | j        r'|                     d           | j        j        j        }d |                    d          D             }|dgz   }t           j        rEt          d|j                   t          d|           t          d|           t          d|           |                     ||           dS )z<Checking indexing queries (modify in iterator, no-auto mode)rR   rS   zRunning %s.test07b_noauto...c                     g | ]	}|j         
S r   r   r^   rB   s     r    r`   z<AutomaticIndexingTestCase.test07b_noauto.<locals>.<listcomp>      NNNCsxNNNr   (var2 == True) & (var3 > 0)r	   ro  r   Tr   r   rp  r   rT   rU   c                     g | ]	}|j         
S r   r   ru  s     r    r`   z<AutomaticIndexingTestCase.test07b_noauto.<locals>.<listcomp>       OOOSOOOr   AutoIndex?:Query results (original):&Query results (after modifying table):r   N)r   rJ   rK   r.   r   r6   r_  rm   r   ry   rE   rF  r   r(   r)   rD  rn   )r-   r6   resrB   resqres_s         r    test07b_noautoz(AutomaticIndexingTestCase.test07b_noauto  s    > 	L$	"""04>3JJKKK
 	!!### ON5;;/L#M#MNNN  	 	Cx1}}#F"FF!F

; 	+LLcL"""K$*E POEKK0M$N$NOOOaSy> 	--111-s333:DAAA%t,,,t$$$$$r   c                 >   t           j        r,t          dd           t          d| j        j        z             | j        }|                                 d |                    d          D             }|                    dg           |                    dg           |                    dg           |	                                 | j
        r'|                     d	
           | j        j        j        }d |                    d          D             }||j        dz
  |j        dz
  |j        dz
  gz   }t           j        rEt          d|j                   t          d|           t          d|           t          d|           |                     ||           dS )z0Checking indexing queries (append, no-auto mode)rR   rS   zRunning %s.test07c_noauto...c                     g | ]	}|j         
S r   r   ru  s     r    r`   z<AutomaticIndexingTestCase.test07c_noauto.<locals>.<listcomp>  rv  r   rw  )ro  Tr   rp  )asbTr   rp  )ascTr	   rp  rT   rU   c                     g | ]	}|j         
S r   r   ru  s     r    r`   z<AutomaticIndexingTestCase.test07c_noauto.<locals>.<listcomp>!  ry  r   r	   r   r   rz  r{  r|  r   N)r   rJ   rK   r.   r   r6   r_  rm   rD   rE   rF  r   r(   r)   r>   rD  rn   )r-   r6   r}  r~  r  s        r    test07c_noautoz(AutomaticIndexingTestCase.test07c_noauto	  s    > 	L$	"""04>3JJKKK
 	!!### ON5;;/L#M#MNNN 	+,---+,---+,---; 	+LLcL"""K$*E POEKK0M$N$NOOOek!mU[]EKMBB> 	--111-s333:DAAA%t,,,t$$$$$r   c           	         t           j        r,t          dd           t          d| j        j        z             | j        }|                                 | j        t          ur8|j	        }| 
                    |           |j        }| 
                    |           |                    dddgddggd	d
g           | j        r'|                     d           | j        j        j        }|                     |j        | j                   | j        t&          u r)|                     |j        j        j        j                   t           j        r`|j        D ]X}|j                            |          j        r7t          d|d|j                            |          j        j                   Y|j        D ]}|j                            |          j        r|j        sv|dv r9|                     |j                            |          j        j        d           e|                     |j                            |          j        j        d           |                     |j                            |          j        j        d           dS )z%Checking dirty flags (modify_columns)rR   rS   zRunning %s.test08_dirty...r   ro  r        ?       @r   r   columnsnamesrT   rU   ri  rj  r\   TFN)r   rJ   rK   r.   r   r6   r_  rC  rI  rY  r   rZ  modify_columnsrF  r   r(   r)   rn   r>   rO  r   rf   r   rg   rz   rk  rl  rD  )r-   r6   r\  re  rG  s        r    test08_dirtyz&AutomaticIndexingTestCase.test08_dirty*  s    > 	J$	""".1HHIII
 	!!### ;l**,K  ---!&!;  !3444 	Q%"b(B$*F#3 	 	5 	5 	5; 	+LLcL"""K$*E 	dj111;+%%OOEJO17888 > 	M > M M:$$W--3 ME"77EJ$5$5g$>$>$D$J$JL M M M~ 	, 	,Gz  ))/ 
, 	,(**((!J--g66<BDJ J J J ((!J--g66<BEK K K K $$UZ%6%6w%?%?%E%K%*, , ,	, 	,r   c           	         t           j        r,t          dd           t          d| j        j        z             | j        }| j        t          ur8|j        }| 	                    |           |j
        }| 	                    |           |                    ddd          }| j        r8|                     d	           | j        j        j        }| j        j        j        }|j        j        j        }|j        j        j        }t           j        rLt          d
|           t          d|           |r*t          d|j                   t          d|j                   |                     |j        |j                   |j        r|                     |j                   | j        t          u r+|                     |           |                     |           n#| j        t4          u r| 	                    |           t           j        r`|j        D ]X}|j                            |          j        r7t          d|d|j                            |          j        j                   Y|j        D ]Y}|j                            |          j        r8|                     |j                            |          j        j        d           ZdS )z8Checking propagate Index feature in Table.copy() (attrs)rR   rS   zRunning %s.test09a_propIndex...r   r   TpropindexesrT   rU   Copied index:Original index:Elements in copied index:Elements in original index:ri  rj  FN)r   rJ   rK   r.   r   r6   rC  rI  rY  r   rZ  copyrF  r   r(   r)   r   rf   r   rg   r'  rn   r>   rJ  r   r   rO  rk  rl  rz   r-   r6   r\  re  r   index1index2rG  s           r    test09a_propIndexz+AutomaticIndexingTestCase.test09a_propIndex[  s    > 	O$	"""3dn6MMNNN

 ;l**,K  ---!&!;  !3444
 Ct<<; 	-LLcL"""K$*E[%,F&!'> 	G/6***#V,,, G163CDDD3V5EFFF 	fl333= 	,OOFN+++;,&&f%%%f%%%%[K''  ((( > 	N!? N N;%%g..4 NE"77FK$6$6w$?$?$E$K$KM N N N 	( 	(G{!!'**0 (  !3!3G!<!<!B!H!&( ( (	( 	(r   c                    t           j        r,t          dd           t          d| j        j        z             | j        }| j        t          ur8|j        }| 	                    |           |j
        }| 	                    |           |                    ddd          }| j        r8|                     d	           | j        j        j        }| j        j        j        }t           j        rXt          d
| j        j                   t          d|j        j        j                   t          d|j        j        j                   | j        t          u rJ|                     |j        j        j                   |                     |j        j        j                   dS | j        t,          u rJ|                     |j        j        j                   |                     |j        j        j                   dS dS )z%Checking that propindexes=False worksrR   rS   zRunning %s.test09b_propIndex...r   r   Fr  rT   rU   zautoindex?:zCopied index indexed?:zOriginal index indexed?:N)r   rJ   rK   r.   r   r6   rC  rI  rY  r   rZ  r  rF  r   r(   r)   r   r8  rf   r   
is_indexedrP  rO  r   )r-   r6   r\  re  r   s        r    test09b_propIndexz+AutomaticIndexingTestCase.test09b_propIndex  s    > 	O$	"""3dn6MMNNN

 ;l**,K  ---!&!;  !3444
 Cu==; 	-LLcL"""K$*E[%,F> 	J-!1222*FK,<,GHHH,ejo.HIII;,&&V[-8999UZ_788888[K''V[-8999OOEJO677777 ('r   c                    t           j        r,t          dd           t          d| j        j        z             | j        }| j        t          ur8|j        }| 	                    |           |j
        }| 	                    |           |                    ddd          }| j        r8|                     d	           | j        j        j        }| j        j        j        }|j        j        j        }|j        j        j        }t           j        rNt          d
|           t          d|           |r.t          d|j                   t          d|j                   dS dS dS )z9Checking propagate Index feature in Table.copy() (values)rR   rS   zRunning %s.test10_propIndex...r   r   Tr  rT   rU   r  r  r  r  N)r   rJ   rK   r.   r   r6   rC  rI  rY  r   rZ  r  rF  r   r(   r)   r   rf   r   rg   r'  )r-   r6   r\  re  r   r  r  s          r    test10_propIndexz*AutomaticIndexingTestCase.test10_propIndex  sm    > 	N$	"""2T^5LLMMM

 ;l**,K  ---!&!;  !3444
 Ct<<; 	-LLcL"""K$*E[%,F&!'> 	G/6***#V,,, G163CDDD3V5EFFFFF	G 	GG Gr   c           	         t           j        r,t          dd           t          d| j        j        z             | j        }|                                 | j        t          ur8|j	        }| 
                    |           |j        }| 
                    |           |                    dddgddggd	d
g           |                    ddd          }| j        r8|                     d           | j        j        j        }| j        j        j        }|j        j        j        }|j        j        j        }t           j        rLt          d|           t          d|           |r*t          d|j                   t          d|j                   t           j        r`|j        D ]X}|j                            |          j        r7t          d|d|j                            |          j        j                   Y|j        D ]`}|j                            |          j        r?|j        r8|                     |j                            |          j        j        d           adS )z>Checking propagate Index feature in Table.copy() (dirty flags)rR   rS   zRunning %s.test11_propIndex...r   ro  r  r  r  r   r   r  r   r   Tr  rT   rU   r  r  r  r  ri  rj  FN)r   rJ   rK   r.   r   r6   r_  rC  rI  rY  r   rZ  r  r  rF  r   r(   r)   r   rf   r   rg   r'  rk  rl  rz   rD  rn   r  s           r    test11_propIndexz*AutomaticIndexingTestCase.test11_propIndex  s    > 	N$	"""2T^5LLMMM
 	!!### ;l**,K  ---!&!;  !3444 	Q%"b(B$*F#3 	 	5 	5 	5 Ct<<; 	-LLcL"""K$*E[%,F&!'> 	G/6***#V,,, G163CDDD3V5EFFF > 	N!? N N;%%g..4 NE"77FK$6$6w$?$?$E$K$KM N N N 	, 	,G{!!'**0 ,# , $$V[%7%7%@%@%F%L%*, , ,	, 	,r   )r   r   r   rF  rO  rC  rE  rI   r'   rL  rT  r]  r`  rf  rm  rr  r  r  r  r  r  r  r  r  r  s   @r    r=  r=    s4       FF***K$0 0 0 0 005 5 5B :  :  :D7 7 74#- #- #-J+- +- +-Z ,  ,  ,D4, 4, 4,l#% #% #%J% % %B/, /, /,b7( 7( 7(r$8 $8 $8L!G !G !GF4, 4, 4, 4, 4, 4, 4,r   r=  c                   "    e Zd ZdZdZeZg dZdS )AI1TestCasef   r   r>  Nr   r   r   r>   rF  rO  rC  rE  r   r   r    r  r    (        EFF***KKKr   r  c                   "    e Zd ZdZdZeZg dZdS )AI2TestCaser  r   r>  Nr  r   r   r    r  r    r  r   r  c                   "    e Zd ZdZdZeZg dZdS )AI4bTestCasep   r   r>  Nr  r   r   r    r  r  %  r  r   r  c                   p    e Zd Zej                            ed          \  ZZZ	Z
e	dz  dz
  ZdZeZg dZdS )AI5TestCaser   memlevel   r   r>  Nr   r   r   r   idxutilscalc_chunksizer  sbsbsr  csr>   rF  rO  rC  rE  r   r   r    r  r  -  sR        k00q0IIOCRGAIEFF***KKKr   r  c                   p    e Zd Zej                            ed          \  ZZZ	Z
e	dz  dz   ZdZeZg dZdS )AI6TestCaser   r     r>  Nr  r   r   r    r  r  5  sR        k00q0IIOCRGaKEFF***KKKr   r  c                   p    e Zd Zej                            ed          \  ZZZ	Z
e	dz  dz
  ZdZeZg dZdS )AI7TestCaser   r     r   r>  Nr  r   r   r    r  r  =  sR        k00q0IIOCRGAIEFF***KKKr   r  c                   p    e Zd Zej                            ed          \  ZZZ	Z
e	dz  dz   ZdZeZg dZdS )AI8TestCaser   r  r   r2  r>  Nr  r   r   r    r  r  F  sR        k00q0IIOCRGcMEFF***KKKr   r  c                   `    e Zd Zej                            ed          \  ZZZ	Z
e	ZdZeZg ZdS )AI9TestCaser   r  r   N)r   r   r   r   r  r  r  r  r  r  r  r>   rF  rI  rC  rE  r   r   r    r  r  O  sD        k00q0IIOCREFFKKKr   r  c                       e Zd ZdZdZeZg ZdS )AI10TestCaser  r   N)r   r   r   r>   rF  rI  rC  rE  r   r   r    r  r  W  s"        EFFKKKr   r  c                   "    e Zd ZdZdZeZg dZdS )AI11TestCaser  r   r>  Nr   r   r   r>   rF  rQ  rC  rE  r   r   r    r  r  _  (        EFF***KKKr   r  c                   "    e Zd ZdZdZeZg dZdS )AI12TestCaser  r   r>  Nr  r   r   r    r  r  g  r  r   r  c                   ,    e Zd Z ed          Zd ZdS )ManyNodesTestCase@   )r   c                 \   t          j                    t          j                    t          j                    d}t          d          D ]}t          d          D ]}dt          |          z   }dt          |          z   }d|z  }| j                            |||d          }|j        j                                         |j        j	                                         |j        j
                                         |j                                         |                                 ьdS )z<Indexing many nodes in one single session (based on bug #26))f0f1f2rh  chrz	/at/%s/ptr   )createparentsN)r   Int8Colr?   r@   r(   r=   rf   r  rH   r  r  rB   rD   rE   )r-   	IdxRecordqnsnqchrnamepathr6   s           r    test00zManyNodesTestCase.test00r  s    *,,*,,*,,
 
	 (( 	 	BAhh 
 
s2wws2ww"d+00$	 1 < <
**,,,
**,,,
**,,,	  """
	 	r   N)r   r   r   r   opem_kwargsr  r   r   r    r  r  o  s5        $+++K    r   r  c                        e Zd ZdZ G d dej                  Z e            Z ed ej	        d                    Z
 fdZd	 Zd
 Z xZS )IndexPropsChangeTestCasez3Test case for changing index properties in a table.c                   ,    e Zd Z ej                    ZdS )&IndexPropsChangeTestCase.MyDescriptionN)r   r   r   r   r   icolr   r   r    MyDescriptionr    s        ry{{r   r  F	   r2   r7  c                 L   t                                                       | j                            dd| j                  }| j        j        |_        |j        }t          d          D ]}|dz  |d<   |
                                 |                                 || _        d S )Nr   testr2     r  )r&   r'   r(   r=   r  oldIndexPropsr8  rD  rB   r?   rD   rE   r6   )r-   r6   rB   rN   r.   s       r    r'   zIndexPropsChangeTestCase.setUp  s    ((fd6HII,1is 	 	Ab&CKJJLLLL


r   c                     | j         | j        fD ]=}|                     | j        j        |j                   | j        j        | j        _        >dS )z-Storing index properties as table attributes.N)r  newIndexPropsrn   r6   rD  r8  )r-   refpropss     r    test_attributesz(IndexPropsChangeTestCase.test_attributes  sV    +T-?@ 	; 	;HTZ18=AAA#'#5#:DJ  	; 	;r   c                     | j         }|                    dd          }|                     |j        |j                   dS )z$Copying index properties attributes.r   test2N)r6   r  rn   rD  )r-   oldtablenewtables      r    test_copyattrsz'IndexPropsChangeTestCase.test_copyattrs  s>    :==g..+X-?@@@@@r   )r   r   r   __doc__r   r   r  r5  r  r:   r  r'   r  r  r  r  s   @r    r  r    s        ==    (   JLLMJE:2:3J3J3JKKKM
 
 
 
 
; ; ;A A A A A A Ar   r  c                   .     e Zd ZdZ fdZd Zd Z xZS )IndexFiltersTestCasez$Test case for setting index filters.c                     t                                                       dt          j                    i}| j                            dd|          | _        d S )Nr  r   r  )r&   r'   r   r   r(   r=   r6   )r-   descriptionr.   s     r    r'   zIndexFiltersTestCase.setUp  sC    ry{{+[--c6;GG


r   c                    t          j         t          j        j                  }t          j        j        j         |_        t          j         t          j        j                  }t          j        j        j         |_        t          j        j        j         |_        | j        j        j        }|	                    dd           | 
                    |j        j        d           | 
                    |j        j        d           | 
                    |j        j        t          j        j                   |                                 |	                    dd|           | 
                    |j        j        d           | 
                    |j        j        d           | 
                    |j        j        |           |                                 dS )z)Checking input parameters in new indexes.
ultralightr   kindoptlevelmediumr	   r  r  r<   N)r  r   rg   r;  r4   r5   r6   rf   r  rH   rn   r  r  r<   r   )r-   
argfilters
idxfiltersr  s       r    test_createIndexz%IndexFiltersTestCase.test_createIndex  sz    Yrx=>>
!#!?!GG
 Yrx=>>
!#!?!GG
$&H$B$M M
z# 	|a888,777,a000+RX-KLLL 	x!ZHHH(333,a000+Z888r   c                 L   | j         j        j        }|                    ddt	          j        d                     |j        j        }|j        j        }|j        j	        }|
                                 |j        }t          j        rKt          d| d| d|            t          d                    |j        |j        |j	                             |                     |j        |           |                     |j        |           |                     |j	        |           d	S )
z0Checking input parameters in recomputed indexes.fullrh  r	   r  r  zOld parameters: z, zNew parameters: {}, {}, {}N)r6   rf   r  rH   r   r:   rg   r  r  r<   reindexr   rJ   rK   formatrn   )r-   r  r  r  r<   nis         r    test_reindexz!IndexFiltersTestCase.test_reindex  s$   z#!RZ!-D-D-D 	 	F 	F 	Fz:&*$Z> 	3BTBBXBBBBCCC.55bj2 2 3 3 3$'''h///W-----r   )r   r   r   r  r'   r  r  r  r  s   @r    r  r    sa        ..H H H H H
  6. . . . . . .r   r  c                   4    e Zd Z ej        d          Zd ZdS )OldIndexTestCasezidx-std-1.x.h5c                 f    |                      t          j        j        | j        j        d           dS )z<Check that files with 1.x indexes are recognized and warned.r   N)assertWarnsr   
exceptionsOldIndexWarningr(   get_noder-   s    r    test1_xzOldIndexTestCase.test1_x  s7     	6-x	9 	9 	9 	9 	9r   N)r   r   r   r   test_filenamere   r  r   r   r    r  r    s6        "f"#344G9 9 9 9 9r   r  )i          r@  c                   ^    e Zd ZdZdZdZ G d dej                  Z fdZ	d Z
d Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d Z"d  Z#d! Z$d" Z%d# Z&d$ Z'd% Z(d& Z)d' Z*d( Z+d) Z,d* Z-d+ Z.d, Z/d- Z0d. Z1d/ Z2d0 Z3d1 Z4d2 Z5d3 Z6 xZ7S )4CompletelySortedIndexTestCasez1Test case for testing a complete sort in a table.r2  r  c                   R    e Zd Z ej        d          Z ej        d          ZdS )+CompletelySortedIndexTestCase.MyDescriptionr   r   r   Nr   r   r   r   r   rcolr  r   r   r    r  r    6        ryQryQr   r  c                    t                                                       | j                            dd| j                  }|j        }| j        }t          |          D ]#}||d<   ||z
  |d<   |                                 $|	                                 || _
        | j
        j        j        | _        | j                            t                     d S )Nr   r6   r  r  r8   )r&   r'   r(   r=   r  rB   r>   r?   rD   rE   r6   rf   r  create_csindexrI   r-   r6   rB   r>   rN   r.   s        r    r'   z#CompletelySortedIndexTestCase.setUp  s    ((gt7IJJi
u 	 	ACK!)CKJJLLLL
JO(		  -= >>>>>r   c                    | j         }|                     |j        j        d           |                                 |                    dd           |                     |j        j        d           |                                 |                    dd           |                     |j        j        d           | j                            dd	d
d           |                     |j        j        d           dS )z#Testing the Column.is_csi property.Tr  r  r  Fr   r   r   r   r  sortbycheckCSIN)r  rn   rg   is_csir   rH   r6   r  )r-   r  s     r    test00_isCompletelySortedIndexz<CompletelySortedIndexTestCase.test00_isCompletelySortedIndex  s     y*D111x!444*E222 	v222*D111
XftDDD*D11111r   c                 &   | j         }t          j        |dd                   }|j                                        }t
          j        r t          d|           t          d|           |                     t          j	        ||                     dS )z9Testing the Index.read_sorted() method with no arguments.NOriginal sorted column:The values from the index:
r  r   r   rg   read_sortedr   rJ   rK   r   r   r-   r  	sortedcol
sortedcol2s       r    test01_readSorted1z0CompletelySortedIndexTestCase.test01_readSorted1  s     yGDG$$	Z++--
> 	<+Y777.
;;;	:>>?????r   c                 :   | j         }t          j        |dd                   dd         }|j                            dd          }t
          j        r t          d|           t          d|           |                     t          j	        ||                     dS )z:Testing the Index.read_sorted() method with arguments (I).N   7   r"  r#  r$  r&  s       r    test01_readSorted2z0CompletelySortedIndexTestCase.test01_readSorted2%       yGDG$$RU+	Z++B33
> 	<+Y777.
;;;	:>>?????r   c                 :   | j         }t          j        |dd                   dd         }|j                            dd          }t
          j        r t          d|           t          d|           |                     t          j	        ||                     dS )z;Testing the Index.read_sorted() method with arguments (II).N!   a   r"  r#  r$  r&  s       r    test01_readSorted3z0CompletelySortedIndexTestCase.test01_readSorted30  r.  r   c                 L   | j         }t          j        |dd                                       d          }|j                                        }t          j        r t          d|           t          d|           | 	                    t          j
        ||                     dS )z:Testing the Index.read_indices() method with no arguments.Nuint64Original indices column:r#  r  r   argsortastyperg   read_indicesr   rJ   rK   r   r   r-   r  
indicescolindicescol2s       r    test02_readIndices1z1CompletelySortedIndexTestCase.test02_readIndices1;  s     yZQQQ((//99
j--//> 	=,j999.<<<
K@@AAAAAr   c                 `   | j         }t          j        |dd                   dd                             d          }|j                            dd          }t          j        r t          d|           t          d|           | 	                    t          j
        ||                     dS )z;Testing the Index.read_indices() method with arguments (I).Nr+  r,  r4  r5  r#  r6  r:  s       r    test02_readIndices2z1CompletelySortedIndexTestCase.test02_readIndices2F       yZQQQ((B/66x@@
j--b"55> 	=,j999.<<<
K@@AAAAAr   c                 `   | j         }t          j        |dd                   dd                             d          }|j                            dd          }t          j        r t          d|           t          d|           | 	                    t          j
        ||                     dS )z<Testing the Index.read_indices() method with arguments (II).Nr0  r1  r4  r5  r#  r6  r:  s       r    test02_readIndices3z1CompletelySortedIndexTestCase.test02_readIndices3Q  r@  r   c                 d   | j         }t          j        |dd                   ddd                             d          }|j                            ddd          }t          j        r t          d|           t          d|           | 	                    t          j
        ||                     dS )z=Testing the Index.read_indices() method with arguments (III).Nr0  r1  r   r4  r5  r#  r6  r:  s       r    test02_readIndices4z1CompletelySortedIndexTestCase.test02_readIndices4\       yZQQQ((Bq188BB
j--b"a88> 	=,j999.<<<
K@@AAAAAr   c                 d   | j         }t          j        |dd                   ddd                             d          }|j                            ddd          }t          j        r t          d|           t          d|           | 	                    t          j
        ||                     dS )z<Testing the Index.read_indices() method with arguments (IV).Nr0  r,  rh  r4  r5  r#  r6  r:  s       r    test02_readIndices5z1CompletelySortedIndexTestCase.test02_readIndices5g  rE  r   c                 b   | j         }t          j        |dd                   ddd                             d          }|j                            d          }t          j        r t          d|           t          d|           | 	                    t          j
        ||                     dS )z7Testing the Index.read_indices() method with step only.Nr	   r4  stepr5  r#  r6  r:  s       r    test02_readIndices6z1CompletelySortedIndexTestCase.test02_readIndices6r  s     yZQQQ((1-44X>>
j--1-55> 	=,j999.<<<
K@@AAAAAr   c                 8   | j         }t          j        |dd                                       d          }|j        dd         }t
          j        r t          d|           t          d|           |                     t          j	        ||                     dS )z9Testing the Index.__getitem__() method with no arguments.Nr4  r5  r#  
r  r   r7  r8  rg   r   rJ   rK   r   r   r:  s       r    test03_getitem1z-CompletelySortedIndexTestCase.test03_getitem1}  s     yZQQQ((//99
jm> 	=,j999.<<<
K@@AAAAAr   c                 @   | j         }t          j        |dd                   d                             d          }|j        d         }t
          j        r t          d|           t          d|           |                     t          j	        ||                     dS )z2Testing the Index.__getitem__() method with start.N   r4  r5  r#  rM  r:  s       r    test03_getitem2z-CompletelySortedIndexTestCase.test03_getitem2  s     yZQQQ((,33H==
jn> 	=,j999.<<<
K@@AAAAAr   c                 H   | j         }t          j        |dd                   dd                             d          }|j        dd         }t
          j        r t          d|           t          d|           |                     t          j	        ||                     dS )z8Testing the Index.__getitem__() method with start, stop.Nr   r?  r4  r5  r#  rM  r:  s       r    test03_getitem3z-CompletelySortedIndexTestCase.test03_getitem3  s     yZQQQ((2.55h??
j2&> 	=,j999.<<<
K@@AAAAAr   c                 h   | j         }t          j        |dd         d          }t          j        d |                    d          D             |j                  }t          j        r t          d|           t          d|           | 	                    t          j
        ||                     dS )z8Testing the Table.itersorted() method with no arguments.Nr  orderc                 6    g | ]}|                                 S r   fetch_all_fieldsru  s     r    r`   zDCompletelySortedIndexTestCase.test04_itersorted1.<locals>.<listcomp>  s0       S!!##   r   dtypeOriginal sorted table:The values from the iterator:r6   r   r   r   
itersorted_v_dtyper   rJ   rK   r   r   r-   r6   sortedtablesortedtable2s       r    test04_itersorted1z0CompletelySortedIndexTestCase.test04_itersorted1  s     
geAAAhf555x u/?/?0 0   "^- - - > 	A*K8881<@@@\BBCCCCCr   c                 |   | j         }t          j        |dd         d          dd         }t          j        d |                    dd          D             |j                  }t          j        r t          d|           t          d	|           | 	                    t          j
        ||                     dS )
z3Testing the Table.itersorted() method with a start.Nr  rU  r   c                 6    g | ]}|                                 S r   rX  ru  s     r    r`   zDCompletelySortedIndexTestCase.test04_itersorted2.<locals>.<listcomp>  s0          S!!##      r   startrZ  r\  r]  r^  ra  s       r    test04_itersorted2z0CompletelySortedIndexTestCase.test04_itersorted2  s     
geAAAhf555bcc:x   u/?/?2 0@ 0 0      ',~7 7 7 > 	A*K8881<@@@\BBCCCCCr   c                 |   | j         }t          j        |dd         d          dd         }t          j        d |                    dd          D             |j                  }t          j        r t          d|           t          d	|           | 	                    t          j
        ||                     dS )
z2Testing the Table.itersorted() method with a stop.Nr  rU     c                 6    g | ]}|                                 S r   rX  ru  s     r    r`   zDCompletelySortedIndexTestCase.test04_itersorted3.<locals>.<listcomp>  0       S!!##   r   )stoprZ  r\  r]  r^  ra  s       r    test04_itersorted3z0CompletelySortedIndexTestCase.test04_itersorted3  s     
geAAAhf555crc:x u/?/?" 0@ 0 0   &+n6 6 6 > 	A*K8881<@@@\BBCCCCCr   c                 ~   | j         }t          j        |dd         d          dd         }t          j        d |                    ddd          D             |j                  }t          j        r t          d	|           t          d
|           | 	                    t          j
        ||                     dS )z<Testing the Table.itersorted() method with a start and stop.Nr  rU  r   rk  c                 6    g | ]}|                                 S r   rX  ru  s     r    r`   zDCompletelySortedIndexTestCase.test04_itersorted4.<locals>.<listcomp>  s0     ) ) )S!!## ) ) )r   rh  rn  rZ  r\  r]  r^  ra  s       r    test04_itersorted4z0CompletelySortedIndexTestCase.test04_itersorted4  s     
geAAAhf555be<x) )u/?/?2B 0@ 0( 0( ) ) )05@ @ @ > 	A*K8881<@@@\BBCCCCCr   c           	         | j         }t          j        |dd         d          ddd         }t          j        d |                    dddd          D             |j        	          }t          j        r t          d
|           t          d|           | 	                    t          j
        ||                     dS )JTesting the Table.itersorted() method with a start, stop and
        step.Nr  rU  r   -   r   c                 6    g | ]}|                                 S r   rX  ru  s     r    r`   zDCompletelySortedIndexTestCase.test04_itersorted5.<locals>.<listcomp>  0     1 1 1S!!## 1 1 1r   rh  rn  rJ  rZ  r\  r]  r^  ra  s       r    test04_itersorted5z0CompletelySortedIndexTestCase.test04_itersorted5       
geAAAhf555bAg>x1 1u/?/?2BQ 0@ 00 00 1 1 18=H H H > 	A*K8881<@@@\BBCCCCCr   c           	         | j         }t          j        |dd         d          ddd         }t          j        d |                    dddd          D             |j        	          }t          j        r t          d
|           t          d|           | 	                    t          j
        ||                     dS )ru  Nr  rU  r0  r,  rh  c                 6    g | ]}|                                 S r   rX  ru  s     r    r`   zDCompletelySortedIndexTestCase.test04_itersorted6.<locals>.<listcomp>  rx  r   ry  rZ  r\  r]  r^  ra  s       r    test04_itersorted6z0CompletelySortedIndexTestCase.test04_itersorted6  r{  r   c                 l   | j         }t          j        |dd         d          }t          j        d |                    dd          D             |j                  }t          j        r t          d|           t          d	|           | 	                    t          j
        ||                     dS )
z9Testing the Table.itersorted() method with checkCSI=True.Nr  rU  c                 6    g | ]}|                                 S r   rX  ru  s     r    r`   zDCompletelySortedIndexTestCase.test04_itersorted7.<locals>.<listcomp>  s0     % % %S!!## % % %r   Tr  rZ  r\  r]  r^  ra  s       r    test04_itersorted7z0CompletelySortedIndexTestCase.test04_itersorted7  s     
geAAAhf555x% %u/?/?d 0@ 0$ 0$ % % %,1N< < < > 	A*K8881<@@@\BBCCCCCr   c           	         | j         }t          j        |dd         d          ddd         }t          j        d |                    dddd          D             |j        	          }t          j        r t          d
|           t          d|           | 	                    t          j
        ||                     dS )zSTesting the Table.itersorted() method with a start, stop and
        negative step.Nr  rU  r,  r0  c                 6    g | ]}|                                 S r   rX  ru  s     r    r`   zDCompletelySortedIndexTestCase.test04_itersorted8.<locals>.<listcomp>  s0     2 2 2S!!## 2 2 2r   ry  rZ  r\  r]  r^  ra  s       r    test04_itersorted8z0CompletelySortedIndexTestCase.test04_itersorted8  s    
 
geAAAhf555bBh?x2 2u/?/?2BR 0@ 01 01 2 2 29>I I I > 	A*K8881<@@@\BBCCCCCr   c                 ~   | j         }t          j        |dd         d          ddd         }t          j        d |                    dd          D             |j                  }t          j        r t          d|           t          d	|           | 	                    t          j
        ||                     dS )
z>Testing the Table.itersorted() method with a negative step -5.Nr  rU  r  c                 6    g | ]}|                                 S r   rX  ru  s     r    r`   zDCompletelySortedIndexTestCase.test04_itersorted9.<locals>.<listcomp>  rm  r   rI  rZ  r\  r]  r^  ra  s       r    test04_itersorted9z0CompletelySortedIndexTestCase.test04_itersorted9
  s     
geAAAhf555ddd;x u/?/?" 0@ 0 0   &+n6 6 6 > 	A*K8881<@@@\BBCCCCCr   c                 ~   | j         }t          j        |dd         d          ddd         }t          j        d |                    dd          D             |j                  }t          j        r t          d|           t          d	|           | 	                    t          j
        ||                     dS )
z>Testing the Table.itersorted() method with a negative step -1.Nr  rU  rZ   c                 6    g | ]}|                                 S r   rX  ru  s     r    r`   zECompletelySortedIndexTestCase.test04_itersorted10.<locals>.<listcomp>  s0     " " "S!!## " " "r   rI  rZ  r\  r]  r^  ra  s       r    test04_itersorted10z1CompletelySortedIndexTestCase.test04_itersorted10  s     
geAAAhf555ddd;x" "u/?/?R 0@ 0! 0! " " ").9 9 9 > 	A*K8881<@@@\BBCCCCCr   c                 "   | j         }t          j        |dd         d          }|                    d          }t          j        r t          d|           t          d|           |                     t	          j        ||                     dS )9Testing the Table.read_sorted() method with no arguments.Nr  rU  r\  The values from read_sorted:	r6   r   r   r%  r   rJ   rK   r   r   ra  s       r    test05_readSorted1z0CompletelySortedIndexTestCase.test05_readSorted1&  s     
geAAAhf555((00> 	@*K8880,???\BBCCCCCr   c                 6   | j         }t          j        |dd         d          dd         }|                    dd          }t          j        r t          d|           t          d|           |                     t	          j        ||                     dS )	z4Testing the Table.read_sorted() method with a start.Nr  rU  r?     rg  r\  r  r  ra  s       r    test05_readSorted2z0CompletelySortedIndexTestCase.test05_readSorted21  s     
geAAAhf555be<((r(::> 	@*K8880,???\BBCCCCCr   c                 8   | j         }t          j        |dd         d          dd         }|                    ddd          }t          j        r t          d|           t          d|           |                     t	          j        ||                     dS )	z=Testing the Table.read_sorted() method with a start and stop.Nr  rU  r?  r0  rr  r\  r  r  ra  s       r    test05_readSorted3z0CompletelySortedIndexTestCase.test05_readSorted3<  s     
geAAAhf555be<((r(CC> 	@*K8880,???\BBCCCCCr   c                 <   | j         }t          j        |dd         d          ddd         }|                    dddd          }t          j        r t          d|           t          d	|           |                     t	          j        ||                     dS )
zKTesting the Table.read_sorted() method with a start, stop and
        step.Nr  rU  r0  r,  rh  ry  r\  r  r  ra  s       r    test05_readSorted4z0CompletelySortedIndexTestCase.test05_readSorted4G  s     
geAAAhf555bAg>((r(KK> 	@*K8880,???\BBCCCCCr   c                 8   | j         }t          j        |dd         d          ddd         }|                    dd          }t          j        r t          d|           t          d|           |                     t	          j        ||                     dS )z8Testing the Table.read_sorted() method with only a step.Nr  rU  r	   rI  r\  r  r  ra  s       r    test05_readSorted5z0CompletelySortedIndexTestCase.test05_readSorted5S  s     
geAAAhf555ccc:((a(88> 	@*K8880,???\BBCCCCCr   c                 8   | j         }t          j        |dd         d          ddd         }|                    dd          }t          j        r t          d|           t          d|           |                     t	          j        ||                     dS )z:Testing the Table.read_sorted() method with negative step.Nr  rU  rZ   rI  r\  r  r  ra  s       r    test05_readSorted6z0CompletelySortedIndexTestCase.test05_readSorted6^       
geAAAhf555ddd;((b(99> 	@*K8880,???\BBCCCCCr   c                 8   | j         }t          j        |dd         d          ddd         }|                    dd          }t          j        r t          d|           t          d|           |                     t	          j        ||                     dS )z?Testing the Table.read_sorted() method with negative step (II).Nr  rU  rI  r\  r  r  ra  s       r    test05_readSorted7z0CompletelySortedIndexTestCase.test05_readSorted7i  r  r   c                 D   | j         }d}d}t          j        |dd         d          ||d         }|                    dddd	          }t          j        r t          d
|           t          d|           |                     t	          j        ||                     dS )zATesting the Table.read_sorted() method with negative step (III)).K   rv  Nr  rU  rZ   r   6   ry  r\  r  r  r-   r6   sstartsstoprb  rc  s         r    test05_readSorted8z0CompletelySortedIndexTestCase.test05_readSorted8t       
geAAAhf555fU2oF((r(LL> 	@*K8880,???\BBCCCCCr   c                 D   | j         }d}d}t          j        |dd         d          ||d         }|                    dddd	          }t          j        r t          d
|           t          d|           |                     t	          j        ||                     dS )z@Testing the Table.read_sorted() method with negative step (IV)).U   rv  Nr  rU     r  ry  r\  r  r  r  s         r    test05_readSorted9z0CompletelySortedIndexTestCase.test05_readSorted9  r  r   c                 D   | j         }d}d}t          j        |dd         d          ||d         }|                    dddd	          }t          j        r t          d
|           t          d|           |                     t	          j        ||                     dS )z?Testing the Table.read_sorted() method with negative step (V)).r  J   Nr  rU  r  r   r  ry  r\  r  r  r  s         r    test05_readSorted10z1CompletelySortedIndexTestCase.test05_readSorted10  r  r   c                 D   | j         }d}d}t          j        |dd         d          ||d         }|                    dddd	          }t          j        r t          d
|           t          d|           |                     t	          j        ||                     dS )z9Testing the Table.read_sorted() method with start > stop.ir  Nr  rU  r     r  ry  r\  r  r  r  s         r    test05_readSorted11z1CompletelySortedIndexTestCase.test05_readSorted11  s     
geAAAhf555fU2oF((s"(MM> 	@*K8880,???\BBCCCCCr   c                 &   | j         }t          j        |dd         d          }|                    dd          }t          j        r t          d|           t          d|           |                     t	          j        ||                     dS )z9Testing the Table.read_sorted() method with checkCSI (I).Nr  rU  Tr  r\  r  r  ra  s       r    test05a_readSorted12z2CompletelySortedIndexTestCase.test05a_readSorted12  s     
geAAAhf555(($(??> 	@*K8880,???\BBCCCCCr   c                 Z    | j         }|                     t          |j        dd           dS )z:Testing the Table.read_sorted() method with checkCSI (II).r  Fr  N)r6   assertRaises
ValueErrorr%  rK  s     r    test05b_readSorted12z2CompletelySortedIndexTestCase.test05b_readSorted12  sC     
*+Ve 	 	E 	E 	E 	E 	Er   c                 T   | j         }| j        |_        |                    ddd          }t          j        |dd         d          }|dd         }t
          j        r t          d|           t          d|           |                     t          j	        ||                     dS )	z8Testing the Table.copy(sortby) method with no arguments.r   r   r  r  NrU  r\  The values from copy:
r6   rh   r  r   r   r   rJ   rK   r   r   r-   r6   r   rb  rc  s        r    test06_copy_sorted1z1CompletelySortedIndexTestCase.test06_copy_sorted1  s     
?C&99geAAAhf555aaay> 	9*K888)<888\BBCCCCCr   c                 h   | j         }| j        |_        |                    dddd          }t          j        |dd         d          ddd         }|dd         }t
          j        r t          d|           t          d	|           |                     t          j	        ||                     dS )
z3Testing the Table.copy(sortby) method with step=-1.r   r   r  rZ   )r  rJ  NrU  r\  r  r  r  s        r    test06_copy_sorted2z1CompletelySortedIndexTestCase.test06_copy_sorted2  s     
?C&rBBgeAAAhf555ddd;aaay> 	9*K888)<888\BBCCCCCr   c                 f   | j         }| j        |_        |                    dddd          }t          j        |dd         d          dd         }|dd         }t
          j        r t          d	|           t          d
|           |                     t          j	        ||                     dS )z8Testing the Table.copy(sortby) method with only a start.r   r   r  r	   )r  rh  NrU  r   r\  r  r  r  s        r    test06_copy_sorted3z1CompletelySortedIndexTestCase.test06_copy_sorted3  s     
?C&BBgeAAAhf555ac:aaay> 	9*K888)<888\BBCCCCCr   c                 h   | j         }| j        |_        |                    ddddd          }t          j        |dd         d          dd         }|dd         }t
          j        r t          d	|           t          d
|           |                     t          j	        ||                     dS )z7Testing the Table.copy(sortby) method with start, stop.r   r   r  r	   (   )r  rh  rn  NrU  r\  r  r  r  s        r    test06_copy_sorted4z1CompletelySortedIndexTestCase.test06_copy_sorted4  s     
?C&KKgeAAAhf555ad;aaay> 	9*K888)<888\BBCCCCCr   c                 l   | j         }| j        |_        |                    dddddd          }t          j        |dd         d	          ddd         }|dd         }t
          j        r t          d
|           t          d|           |                     t          j	        ||                     dS )z=Testing the Table.copy(sortby) method with start, stop, step.r   r   r  r	   r0  rh  )r  rh  rn  rJ  NrU  r\  r  r  r  s        r    test06_copy_sorted5z1CompletelySortedIndexTestCase.test06_copy_sorted5  s     
?C&"#"1  6 6geAAAhf555a1f=aaay> 	9*K888)<888\BBCCCCCr   c                    |                      d           | j        j        j        }| j        |_        |                    ddd          }t          j        |dd         d          }|dd         }t          j	        r t          d	|           t          d
|           |                     t          j        ||                     dS )=Testing the Table.copy(sortby) method after table re-opening.rT   rU   r   r   r  r  NrU  r\  r  r   r(   r)   r6   rh   r  r   r   r   rJ   rK   r   r   r  s        r    test06_copy_sorted6z1CompletelySortedIndexTestCase.test06_copy_sorted6	  s     	# &?C&99geAAAhf555aaay> 	9*K888)<888\BBCCCCCr   c                     | j         }| j        |_        |                    ddd          }|                     t          |j        dddd           d	S )
z5Testing the `checkCSI` parameter of Table.copy() (I).r   r   r  r  table3r  Fr  Nr6   rh   r  r  r  r-   r6   r   s      r    test06_copy_sorted7z1CompletelySortedIndexTestCase.test06_copy_sorted7	  se     
  ?C&99* +sH!'% 	 	9 	9 	9 	9 	9r   c                     | j         }| j        |_        |                    ddd          }|                     t          |j        dddd           d	S )
z6Testing the `checkCSI` parameter of Table.copy() (II).r   r   r  r  r  r  Tr  Nr  r  s      r    test06_copy_sorted8z1CompletelySortedIndexTestCase.test06_copy_sorted8	  se     
  ?C&99* +sH!'$ 	 	8 	8 	8 	8 	8r   c                 N   | j                             dd| j                  }|j        j                                        }t          j        rt          dt          |                     | 
                    |d           | 
                    |j        d         j        d           dS )z8Testing the representation of an index with no elements.r   t2zrepr(t2)-->
r   r  FN)r(   r=   r  rf   r  r  r   rJ   rK   reprrn   
colindexesr  )r-   r  irowss      r    test07_isCSI_noelementsz5CompletelySortedIndexTestCase.test07_isCSI_noelements(	  s     [%%c41CDD++--> 	-/488,,,"""v.5u=====r   )8r   r   r   r  r>   rh   r   r   r  r'   r   r)  r-  r2  r=  r?  rB  rD  rG  rK  rN  rQ  rS  rd  ri  ro  rs  rz  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  s   @r    r  r    s       ;;EJ         (      ? ? ? ? ?2 2 2$	@ 	@ 	@	@ 	@ 	@	@ 	@ 	@	B 	B 	B	B 	B 	B	B 	B 	B	B 	B 	B	B 	B 	B	B 	B 	B	B 	B 	B	B 	B 	B	B 	B 	BD D DD D DD D DD D DD D DD D DD D DD D DD D DD D D	D 	D 	D	D 	D 	D	D 	D 	D
D 
D 
D	D 	D 	D	D 	D 	D	D 	D 	DD D DD D DD D DD D D	D 	D 	DE E ED D DD D DD D DD D DD D DD D D
9 
9 
9
8 
8 
8> > > > > > >r   r  c                   h     e Zd ZdZdZdZ G d dej                  Z fdZ	d Z
d Zd	 Zd
 Z xZS )ReadSortedIndexTestCasez?Test case for testing sorted reading in a "full" sorted column.r2  r  c                   R    e Zd Z ej        d          Z ej        d          ZdS )%ReadSortedIndexTestCase.MyDescriptionr   r   r   Nr  r   r   r    r  r  9	  r  r   r  c                    t                                                       | j                            dd| j                  }|j        }| j        }t          |          D ]#}||d<   ||z
  |d<   |                                 $|	                                 || _
        | j
        j        j        | _        | j                            | j        dt                     d S )Nr   r6   r  r  r   )r  r  r9   )r&   r'   r(   r=   r  rB   r>   r?   rD   rE   r6   rf   r  rH   r  rI   r  s        r    r'   zReadSortedIndexTestCase.setUp=	  s    ((gt7IJJi
u 	 	ACK!)CKJJLLLL
JO(		F+; 	 	= 	= 	= 	= 	=r   c           	      J   | j         }t          j        |dd         d          }|                    d          }t          j        r t          d|           t          d|           |                     t	          j        |t          j        |d                               dS )r  Nr  rU  Sorted table:r  r  ra  s       r    r)  z*ReadSortedIndexTestCase.test01_readSorted1N	  s     
geAAAhf555((00> 	@/;///0,??? 	V<<<> > 	? 	? 	? 	? 	?r   c           	         |                                   | j        j        j        }t	          j        |dd         d          }|                    d          }t          j        r t          d|           t          d|           | 
                    t          j        |t	          j        |d                               dS )zKTesting the Table.read_sorted() method with no arguments
        (re-open).Nr  rU  r  r  )r   r(   r)   r6   r   r   r%  r   rJ   rK   r   r   ra  s       r    r-  z*ReadSortedIndexTestCase.test01_readSorted2\	  s     	 &geAAAhf555((00> 	@/;///0,??? 	V<<<> > 	? 	? 	? 	? 	?r   c                    | j         }| j        |_        |                    ddd          }t          j        |dd         d          }t          j        |dd         d          }t
          j        r(t          d|dd                    t          d|           |                     t          j	        ||                     dS )	z&Testing the Table.copy(sortby) method.r   r   r  r  NrU  Original table:The sorted values from copy:r  r  s        r    test02_copy_sorted1z+ReadSortedIndexTestCase.test02_copy_sorted1l	  s     
?C&99geAAAhf555wvaaay777> 	@#VAAAY///0,???\BBCCCCCr   c                    |                      d           | j        j        j        }| j        |_        |                    ddd          }t          j        |dd         d          }t          j        |dd         d          }t          j	        r(t          d	|dd                    t          d
|           |                     t          j        ||                     dS )r  rT   rU   r   r   r  r  NrU  r  r  r  r  s        r    test02_copy_sorted2z+ReadSortedIndexTestCase.test02_copy_sorted2z	  s     	# &?C&99geAAAhf555wvaaay777> 	@#VAAAY///0,???\BBCCCCCr   )r   r   r   r  r>   rh   r   r   r  r'   r)  r-  r  r  r  r  s   @r    r  r  3	  s        IIEJ         (      = = = = ="? ? ?? ? ? D D DD D D D D D Dr   r  c                       e Zd ZdZdS )ReadSortedIndex0r   Nr   r   r   r  r   r   r    r  r  	          HHHr   r  c                       e Zd ZdZdS )ReadSortedIndex3r	   Nr  r   r   r    r  r  	  r  r   r  c                       e Zd ZdZdS )ReadSortedIndex6r   Nr  r   r   r    r  r  	  r  r   r  c                       e Zd ZdZdS )ReadSortedIndex9r  Nr  r   r   r    r  r  	  r  r   r  c                   (     e Zd ZdZ fdZd Z xZS )Issue156TestBaseNc           	      &   t                                                        G d dt          j                  }| j                            dd|t          j        dd          d          }| j                                         t          d	          D ]c}|j	        }t          j                            d
d          |d<   t          j                            d
d          |d<   |                                 d| j                                         d S )Nc                   R    e Zd Z ej                    Z G d dej                  ZdS )#Issue156TestBase.setUp.<locals>.Fooc                   ,    e Zd Z ej                    ZdS )'Issue156TestBase.setUp.<locals>.Foo.BarN)r   r   r   r   	UInt16Colcoder   r   r    Barr  	  s        #r|~~r   r  N)r   r   r   r   r  r   r   r  r   r   r    Foor  	  sN         BLNNE& & & & &b& & & & & &r   r  r   foor	   r#   T)r<   r  r   r   i  r   Bar/code)r&   r'   r   r   r(   r=   r:   rE   r?   rB   r   randomrandintrD   )r-   r  r6   krB   r.   s        r    r'   zIssue156TestBase.setUp	  s
   	& 	& 	& 	& 	&"" 	& 	& 	& ((eS13Av1F1F7; ) = = 	 r 	 	A)C9,,Q88CL i//7;;C
OJJLLLLr   c           
      $   | j                             d          }|j        | j                                                  |                    dd| j        dd          }|                     t          j        |	                    | j                  t          |	                    | j                            k                         |                     | j        |j                   |                     |j        | j                 j                   d S )Nz/foofoo2T)newname	overwriter  r  r  )r(   r  rF   
sort_fieldr  r  r   r   allrO   rj   assertInr  r  )r-   oldNodenew_nodes      r    test_copysortzIssue156TestBase.test_copysort	  s    +&&v.. 	T_-<<>>> <<$'+,0   2 2
 	LL))7;;t//0012 2 	3 	3 	3 	dox':;;;+DO<CDDDDDr   )r   r   r   r  r'   r  r  r  s   @r    r  r  	  sS        J    2E E E E E E Er   r  c                       e Zd ZdZdS )Issue156TestCase01r   Nr   r   r   r  r   r   r    r  r  	  s        JJJr   r  c                       e Zd ZdZdS )Issue156TestCase02r  Nr  r   r   r    r  r  	  s        JJJr   r  c                   >     e Zd ZdZej        Zg dZ fdZd Z	 xZ
S )Issue119Time32ColTestCasezTimeCol not properly indexing.)
gmA?gv9Tl?g|^?g?f3?gȍL?g?:v?gTyL?gL\0Z?g}g?gt
?c                 t    t                                                        G  fddt          j                  } j                            dd|           _        d _         fdt           j	                  D             } j        
                    |            j                                         d S )Nc                   ^    e Zd Z                     d          Z ej        d          ZdS ).Issue119Time32ColTestCase.setUp.<locals>.Descrr   r   r   N)r   r   r   col_typwhenr   
Float32Colvaluer  s   r    Descrr  	  s6        <<A<&&D!BMa(((EEEr   r  r   r  g  UAc                 .    g | ]\  }}j         |z   |fS r   )t)r^   rN   itemr-   s      r    r`   z3Issue119Time32ColTestCase.setUp.<locals>.<listcomp>	  s(    IIIwq$!T"IIIr   )r&   r'   r   r   r(   r=   r6   r  rx   rG   rD   rE   )r-   r  datar.   s   `  r    r'   zIssue119Time32ColTestCase.setUp	  s    	) 	) 	) 	) 	) 	) 	)B$ 	) 	) 	) [--c65AA
IIII)DK2H2HIII
$r   c                     | j         }| j        }d||dz   fz  }|                    |          }|j        j                            d           |                    |          }|                     ||k                                               d S )Nz(when >= %d) & (when < %d)rh  F)_verbose)r6   r  
read_whererf   r  rH   r   r  )r-   tblr  wherestrno_index
with_indexs         r    test_timecol_issuez,Issue119Time32ColTestCase.test_timecol_issue	  s    jF/1a!e*<>>(++""E"222^^H--
Z/446677777r   )r   r   r   r  r   	Time32Colr  rG   r'   r&  r  r  s   @r    r  r  	  se        ((lG  F    8 8 8 8 8 8 8r   r  c                       e Zd Zej        ZdS )Issue119Time64ColTestCaseN)r   r   r   r   	Time64Colr  r   r   r    r)  r)  
  s        lGGGr   r)  c                   &    e Zd Zd Zd Zd Zd ZdS )TestIndexingNansc                    t          j                    t          j                    d}| j                            dd|          }|j        }t          d          D ]2}||d<   |dk    rt          j        n||d<   |	                                 3|
                                 |j        j                                         |                    d          }|                     t!          |          d	           d S )
N)rg   rG   r   r6   rh  rg   r   rG   z(values >= 0)r   )r   Int64Colr   r(   r=   rB   r?   r   nanrD   rE   rf   rG   rH   r!  rn   ro   )r-   trMapr6   r   rN   results         r    test_issue_282zTestIndexingNans.test_issue_282

  s    +--2;==AA((gu==Iq 	 	AAgJ$%FF"&&AhKHHJJJJ
&&((( !!/22Va(((((r   c                    | j                             ddt          t          j                    t          j        d          t          j        d                              }|j        }t          d          D ]=}||d<   |dk    s|d	k    rt          j	        n||d
<   ||d<   |
                                 >|                                 |j        j                                         |j        j                                         |                    d          }|                     t%          |          d           |                    d          }|                     t%          |          d           d S )Nr   r6   r   shaperg   rG   values2rh  rg   r   r	   rG   r7  (values2 > 0)r   (values > 0))r(   r=   r   r   r.  r   rB   r?   r   r/  rD   rE   rf   rG   rH   r7  r!  rn   ro   )r-   r6   r   rN   results2rq   s         r    test_issue_327zTestIndexingNans.test_issue_327
  sT   ((gt+--;R(((Kb)))8
 8
 8
   Iq 	 	AAgJ$%FFa1ff"&&!AhKAiLHHJJJJ
&&(((
'')))##O44X***"">22Wq)))))r   c                 4   | j                             ddt          t          j                    t          j        d          t          j        d                              }|j        }t          d          D ]O}t          d          D ]=}||d<   |d	k    s|d
k    rt          j	        n||d<   ||d<   |
                                 >P|                                 |j        j                            t                     |j        j                            t                     |                    d          }|                     t'          |          d           |                    d          }|                     t'          |          d           d S Nr   r6   r   r4  r6  r2  rh  rg   r   r	   rG   r7  r8   r8  i  r9     )r(   r=   r   r   r.  r   rB   r?   r   r/  rD   rE   rf   rG   rH   rI   r7  r!  rn   ro   )r-   r6   r   r   rN   r:  rq   s          r    test_issue_327_bz!TestIndexingNans.test_issue_327_b3
  s|   ((gt+--;R(((Kb)))8
 8
 8
   Is 	 	A1XX  '
()Q!q&&bffa( )



	
 	
&&3C&DDD
''4D'EEE##O44X,,,"">22Ws+++++r   c                 4   | j                             ddt          t          j                    t          j        d          t          j        d                              }|j        }t          d          D ]O}t          d          D ]=}||d<   |d	k    s|d
k    rt          j	        n||d<   ||d<   |
                                 >P|                                 |j        j                            t                     |j        j                            t                     |                    d          }|                     t'          |          d           |                    d          }|                     t'          |          d           d S r=  )r(   r=   r   r   r.  r   rB   r?   r   r/  rD   rE   rf   rG   r  rI   r7  r!  rn   ro   )r-   r6   r   xrN   r:  rq   s          r    test_csindex_nansz"TestIndexingNans.test_csindex_nansL
  s|   ((gt+--;R(((Kb)))8
 8
 8
   Is 	 	A1XX  '
()Q!q&&bffa( )



	
 	
((5E(FFF
))6F)GGG##O44X..."">22Wu-----r   N)r   r   r   r2  r;  r?  rB  r   r   r    r,  r,  	
  sP        ) ) )"* * *0, , ,2. . . . .r   r,  c                  n   t           j                                        } d}t          |          D ]>}|                     t           j                            t                               |                     t           j                            t                               |                     t           j                            t                               |                     t           j                            t                               |                     t           j                            t                               |                     t           j                            t                               |                     t           j                            t                               |                     t           j                            t                               |                     t           j                            t                               |                     t           j                            t                               |                     t           j                            t                                |                     t           j                            t"                               |                     t           j                            t$                               |                     t           j                            t&                               |                     t           j                            t(                               |                     t           j                            t*                               |                     t           j                            t,                               |                     t           j                            t.                               |                     t           j                            t0                               |                     t           j                            t2                               |                     t           j                            t4                               |                     t           j                            t6                               |                     t           j                            t8                               |                     t           j                            t:                               |                     t           j                            t<                               |                     t           j                            t>                               |                     t           j                            t@                               |                     t           j                            tB                               |                     t           j                            tD                               @t           j#        r|                     t           j                            tH                               |                     t           j                            tJ                               |                     t           j                            tL                               |                     t           j                            tN                               |                     t           j                            tP                               |                     t           j                            tR                               |                     t           j                            tT                               |                     t           j                            tV                               | S )Nr   ),r   unittest	TestSuiter?   addTest	makeSuiter  r  r  r  r  r  r  r  r  r   r"  r  r  r  r$  r  r  r  r  r  r  r  r  r  r  r  r  r)  r,  heavyr  r  r  r  r  r  r  r  )theSuiteniterns      r    suiterL  f
  s   ((**HE 5\\ F F223DEEFFF223CDDEEE223DEEFFF22?CCDDD223DEEFFF223FGGHHH223IJJKKKO%%&CDD	F 	F 	F22?CCDDD223EFFGGG223EFFGGG22;??@@@22;??@@@22;??@@@223IJJKKK223KLLMMM223GHHIII223CDDEEEO%%&CDD	F 	F 	F223DEEFFF223CDDEEE223CDDEEE223CDDEEE223CDDEEE223EFFGGG223EFFGGG223LMMNNN223LMMNNN223CDDEEEE| 	B22<@@AAA22;??@@@22;??@@@22;??@@@22;??@@@22<@@AAA22<@@AAA22<@@AAAOr   __main__rL  )defaultTest)Lr  r   pathlibr   r   r   tablesr   tables.testsr   r  rI   r   r   TempFileMixinPyTablesTestCaser"   r  r  r  rD  skipIfblosc_availr  	lzo_availr  bzip2_availr  r  r  r  r  r   r"  r$  r5  rI  rO  r:   rQ  r=  r  r  r  r  r  r  r  r  r  r  r  r  r  r  TestFileMixinr  r  r  r  r  r  r  r  r  r  r  r)  r,  rL  r   sys
parse_argvargvprint_versionsmainr   r   r    <module>r^     s	                         ! & & & & &R & & &r
L r
L r
L r
L r
LF(&*A r
L r
L r
Lj A           }    F..AC C      C C F,,?A A    m  A A F..AC C      C C    -       ]       M   # # # # #m # # #              N7 N7 N7 N7 N7V163J N7 N7 N7b        z||je$$$ZBJF$8 8 89 9 9 
R	, R	, R	, R	, R	, 4f6M R	, R	, R	,l+ + + + ++ + + ++ + + + ++ + + ++ + + + +, + + ++ + + + ++ + + ++ + + + ++ + + ++ + + + ++ + + ++ + + + ++ + + +    +       ,   + + + + +, + + ++ + + + +, + + +    ,f.E   4A A A A Av3V5L A A AB3. 3. 3. 3. 3.6/1H 3. 3. 3.l9 9 9 9 9v+V-D 9 9 9 % B	> B	> B	> B	> B	>F$8$*$;B	> B	> B	>JTD TD TD TD TDf2F4K TD TD TDn    .       .       .       .   1E 1E 1E 1E 1Ev+V-D 1E 1E 1Eh    )   
    )   
*8 *8 *8 *8 *8 4f6M *8 *8 *8Z     9   Z. Z. Z. Z. Z.v+V-D Z. Z. Z.z1 1 1h zJJJFchF
OW-----	 r   