B
    \o                @   s  d dl mZ d dl mZ d dlZd dlZd dlmZ d dlZd dlm	Z	m
Z
mZmZmZmZmZmZmZ d dlmZ d dlmZ d dlmZmZmZ d dlmZ d d	lmZ d d
lmZ G dd dZG dd dej eZ!G dd de!Z"G dd de!Z#G dd de!Z$e%ej& dG dd de!Z'e%ej& dG dd de!Z(e%ej& de%eej)k dej) G dd de!Z*e%ej& dG dd de!Z+e%ej& de%de, kd G d!d" d"e!Z-e%ej& de%de, kd G d#d$ d$e!Z.e%ej& de%d%e, kd&G d'd( d(e!Z/e%ej& de%d)e, kd*G d+d, d,e!Z0e%ej& de%d-e, kd.G d/d0 d0e!Z1e%ej2 d1G d2d3 d3e!Z3e%ej4 d4G d5d6 d6e!Z5G d7d8 d8e!Z6G d9d: d:e!Z7G d;d< d<e!Z8G d=d> d>ej eZ9G d?d@ d@e9Z:G dAdB dBe9Z;G dCdD dDej eZ<G dEdF dFe<Z=G dGdH dHej eZ>G dIdJ dJe>Z?G dKdL dLe>Z@G dMdN dNej eZAG dOdP dPeAZBG dQdR dReAZCG dSdT dTej eZDG dUdV dVej eZEG dWdX dXej eZFG dYdZ dZej eZGG d[d\ d\eGZHG d]d^ d^eGZIG d_d` d`ej eZJG dadb dbeJZKG dcdd ddeJZLG dedf dfeJZMG dgdh dheJZNG didj djeJZOG dkdl dleJZPG dmdn dneJZQG dodp dpeJZRG dqdr dreJZSG dsdt dteJZTG dudv dveJZUG dwdx dxeJZVG dydz dzej eZWG d{d| d|eZXG d}d~ d~ej eZYG dd deYZZG dd deYZ[G dd dej eZ\G dd dej eZ]G dd dej eZ^G dd dej eZ_G dd dej eZ`dd Zaebdkrecejd ee  ejfdd dS )    )print_function)absolute_importN)	Atom
StringAtomBoolAtomIntAtom	Int16Atom	Int32Atom
ObjectAtomVLStringAtomVLUnicodeAtom)common)allequal)unittesttest_filenameblosc_version)PyTablesTestCase)
byteorders)rangec               @   s   e Zd ZdZdS )C)   g      @N)__name__
__module____qualname__c r   r   8lib/python3.7/site-packages/tables/tests/test_vlarray.pyr      s   r   c                   sl   e Zd ZdZdZdZdZdZdZ fddZ	dd Z
dd	 Zd
d Zdd Zdd Zdd Zdd Z  ZS )BasicTestCaser   zlibnumpyc                s.   t t|   | jj| _|   | j  d S )N)superr   setUph5fileroot	rootgrouppopulateFileclose)self)	__class__r   r   r!   #   s    
zBasicTestCase.setUpc             C   s   | j }tj| j| j| j| j| jd}| jj	|dt
 d|dd}| j|_|ddg | jdkr|tjd	d
dgdd |tjg dd n| jdkr|d |d |ddddg |dddddg d S )N)	complevelcomplibshuffle
bitshuffle
fletcher32Zvlarray1zragged array if intsi  )atomtitlefiltersexpectedrows      r   r         int32)dtypepython)r   r4   r5   r            	   
               )r$   tablesFilterscompressr*   r+   r,   r-   r"   create_vlarrayr	   flavorappendr   array)r'   groupr0   vlarrayr   r   r   r%   +   s*    





zBasicTestCase.populateFilec             C   sj   t | jd| _| jd}| |j| j | |jd | |jd | |j	d | |j
jd d S )Nrz	/vlarray1)r5   r2   r5   r6   )rB   	open_fileh5fnamer"   get_nodeassertEqualrF   shapendimnrowsr.   type)r'   objr   r   r   test00_attributesD   s    zBasicTestCase.test00_attributesc             C   s  t jr tdd td| jj  t| jd| _| j	d}d|_
|dd }|dd }t jrtd	|j td
|jd|j td| d}| ||j | jdkr| t|tj | t|tjddgdd| j | t|tjg dd| j n(| jdkr$| |ddg | |g  | t|d | j|jjkrlt jrltd| jj td| j|jj | |jj| j | jdkrt| jr| |jj| j | j|jjkrt jrtd| jj td| j|jj | | j|jj | j|jjkr,t jr,td| jj td| j|jj | | j|jj | j|jjkrvt jrvtd| jj td| j|jj | | j|jj dS )zChecking vlarray read.
z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test01_read...rK   z	/vlarray1r   r   r3   zFlavor:zNrows in:zFirst row in vlarray ==>r5   r   r2   r6   )r7   r8   zError in compress. Class:zself, vlarray:zError in shuffle. Class:zError in fletcher32. Class:N)r   verboseprintr(   r   rB   rL   rM   r"   rN   
nrowsinbufreadrF   _v_pathnamerR   rO   rS   r   Zndarray
assertTruer   rH   lenrD   r0   r)   Zwhich_lib_versionr*   r+   r,   r-   )r'   rJ   rowrow2rR   r   r   r   test01_readN   sV    



zBasicTestCase.test01_readc       
      C   s  t jr tdd td| jj  t| jd| _| j	d}ddgdd	d
gg ddddgdddddgg}t
dddt
dddt
dddt
dddt
dddt
dddt
dddt
dddt
dddt
dddt
dddt
dddg}x|D ]}|| }|| }g }t jr:td|j td|jd|j td| td| | jdkrx"|D ]}|tj|dd qLW xJtt|D ]"}	| t||	 ||	 | j qxW q| jdkr| || qW dS ) z%Checking vlarray __getitem__ (slices)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test02a_getitem...rK   z	/vlarray1r2   r3   r   r4   r5   r9   r:   r;   r<   r=   r>   r?   r@   rA   N   r   zFlavor:zNrows inrW   zOriginal rows ==>zRows read in vlarray ==>r   r6   )r7   r8   )r   rX   rY   r(   r   rB   rL   rM   r"   rN   slicerF   r\   rR   rG   r   rH   r   r^   r]   r   rO   )
r'   rJ   rowsZslicesslcrows2rows1Zrows1fvalir   r   r   test02a_getitem   s4    
*"



$
zBasicTestCase.test02a_getitemc             C   s  t jr tdd td| jj  | jdkr.dS t| jd| _	| j	
d}tj|dd tjd}xd	td
dtdgdggD ]~}|| }|| }t jrtd|j td|jd|j td| td| x0tt|D ] }| t|| || | j qW qW dS )z&Checking vlarray __getitem__ (scalars)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test02b_getitem...r   NrK   z	/vlarray1)r7   r   r2   r3   r   r4   zFlavor:zNrows inrW   zOriginal rows ==>zRows read in vlarray ==>)r   rX   rY   r(   r   rF   rB   rL   rM   r"   rN   r   rH   objectr\   rR   r   r^   r]   r   )r'   rJ   rd   re   rf   rg   ri   r   r   r   test02b_getitem   s$    

$

zBasicTestCase.test02b_getitemc          	   C   s  t jr tdd td| jj  t| jd| _| j	d}|
dddd	g d
|_|d }|d }|d }t jrtd|j td|jd|j td| d}| ||j | jdkr>| t|ttddg | t|tjddgdd| j | t|tjg dd| j | t|tjdddd	gdd| j n<| jdkrz| |ddg | |g  | |dddd	g | t|d dS )zChecking vlarray append.rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test03_append...az	/vlarray1r:   r;   r<   r=   r   r   r3   zFlavor:zNrows inrW   zFirst row in vlarray ==>r9   r   r2   r6   )r7   r8   r4   N)r   rX   rY   r(   r   rB   rL   rM   r"   rN   rG   rZ   rF   r\   rR   rO   rS   r   rH   r]   r   r^   )r'   rJ   Zrow1r`   Zrow3rR   r   r   r   test03_append   s>    


zBasicTestCase.test03_appendc             C   s   t | jd| _| jd}| |dd|jj  | |dd|jj  | |dd|jj  | |dd|jj  | |dd|jj  d	S )
zChecking get_row_size method.rm   z	/vlarray1r   r3   r2   r   r4   r5   N)	rB   rL   rM   r"   rN   rO   Zget_row_sizer.   size)r'   rJ   r   r   r   test04_get_row_size   s    z!BasicTestCase.test04_get_row_size)r   r   r   rD   r*   r+   r,   r-   rF   r!   r%   rU   ra   rj   rl   ro   rq   __classcell__r   r   )r(   r   r      s   
7&,r   c               @   s   e Zd ZdZdS )BasicNumPyTestCaser   N)r   r   r   rF   r   r   r   r   rs     s   rs   c               @   s   e Zd ZdZdS )BasicPythonTestCaser8   N)r   r   r   rF   r   r   r   r   rt     s   rt   c               @   s   e Zd ZdZdZdS )ZlibComprTestCaser2   r   N)r   r   r   rD   r*   r   r   r   r   ru     s   ru   z'BLOSC compression library not availablec               @   s   e Zd ZdZdZdZdS )BloscComprTestCaser<   r   bloscN)r   r   r   rD   r+   r*   r   r   r   r   rv     s   rv   c               @   s   e Zd ZdZdZdZdS )BloscShuffleComprTestCaser9   r2   rw   N)r   r   r   rD   r+   r*   r   r   r   r   rx     s   rx   zBLOSC >= %s requiredc               @   s   e Zd ZdZdZdZdS )BloscBitShuffleComprTestCaser<   r2   rw   N)r   r   r   rD   r,   r*   r   r   r   r   ry     s   ry   c               @   s   e Zd ZdZdZdZdS )BloscBloscLZComprTestCaser<   r2   zblosc:blosclzN)r   r   r   rD   r+   r*   r   r   r   r   rz   (  s   rz   Zlz4zlz4 requiredc               @   s   e Zd ZdZdZdZdS )BloscLZ4ComprTestCaser<   r2   z	blosc:lz4N)r   r   r   rD   r+   r*   r   r   r   r   r{   0  s   r{   c               @   s   e Zd ZdZdZdZdS )BloscLZ4HCComprTestCaser<   r2   zblosc:lz4hcN)r   r   r   rD   r+   r*   r   r   r   r   r|   9  s   r|   Zsnappyzsnappy requiredc               @   s   e Zd ZdZdZdZdS )BloscSnappyComprTestCaser<   r2   zblosc:snappyN)r   r   r   rD   r+   r*   r   r   r   r   r}   B  s   r}   r   zzlib requiredc               @   s   e Zd ZdZdZdZdS )BloscZlibComprTestCaser<   r2   z
blosc:zlibN)r   r   r   rD   r+   r*   r   r   r   r   r~   L  s   r~   Zzstdzzstd requiredc               @   s   e Zd ZdZdZdZdS )BloscZstdComprTestCaser<   r2   z
blosc:zstdN)r   r   r   rD   r+   r*   r   r   r   r   r   T  s   r   z%LZO compression library not availablec               @   s   e Zd ZdZdZdS )LZOComprTestCaser2   ZlzoN)r   r   r   rD   r*   r   r   r   r   r   ]  s   r   z'BZIP2 compression library not availablec               @   s   e Zd ZdZdZdS )Bzip2ComprTestCaser2   Zbzip2N)r   r   r   rD   r*   r   r   r   r   r   c  s   r   c               @   s   e Zd ZdZdZdS )ShuffleComprTestCaser2   N)r   r   r   rD   r+   r   r   r   r   r   j  s   r   c               @   s   e Zd ZdZdS )Fletcher32TestCaser2   N)r   r   r   r-   r   r   r   r   r   o  s   r   c               @   s   e Zd ZdZdZdZdS )AllFiltersTestCaser2   N)r   r   r   rD   r+   r-   r   r   r   r   r   s  s   r   c               @   s   e Zd ZdZdZdZdd Zdd Zdd	 Zd
d Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zd d! Zd"d# Zd$d% Zd&d' Zd(d) Zd*d+ Zd,d- Zd.d/ Zd0d1 Zd2d3 Zd4d5 Zd6d7 Zd8d9 Z d:d; Z!d<S )=TypesTestCasewr   r   c          
   C   s>  t jr tdd td| jj  | jjddtdddd	}d
|_|	t
dddddg |	t
ddg | jr|j}|   | j|}| }t jrtd| td|jd|j td|d  | |jd t|d t
dddddgd t|d t
ddgd | t|d d | t|d d dS )z9Checking vlarray with NumPy string atoms ('numpy' flavor)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test01_StringAtom.../
stringAtomr   )itemsizezRagged array of strings)r.   r/   r   112123123412345zObject read:zNrows inrW   zFirst row in vlarray ==>r   r3   Sr2   r5   N)r   rX   rY   r(   r   r"   rE   r   rF   rG   r   rH   reopenr\   _reopenrN   r[   rR   rO   nptassert_array_equalr^   )r'   rJ   namer_   r   r   r   test01_StringAtom~  s0    


zTypesTestCase.test01_StringAtomc          	   C   sR  t jr tdd td| jj  | jjddtdddd	}d
|_|	t
dddddgddd  |	t
ddddgddd  | jr|j}|   | j|}| }t jrtd| td|jd|j td|d  | |jd t|d t
dddgd t|d t
ddgd | t|d d | t|d d dS )zJChecking vlarray with NumPy string atoms ('numpy' flavor,
        strided)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z Running %s.test01a_StringAtom...r   r   r   )r   zRagged array of strings)r.   r/   r   r   r   r   r   r   Nr3   2321zObject read:zNrows inrW   zFirst row in vlarray ==>r   r   r2   )r   rX   rY   r(   r   r"   rE   r   rF   rG   r   rH   r   r\   r   rN   r[   rR   rO   r   r   r^   )r'   rJ   r   r_   r   r   r   test01a_StringAtom  s.    

$"
z TypesTestCase.test01a_StringAtomc          	   C   s>  t jr tdd td| jj  | jjddtdddd	}d
|_|	t
ddddg |	t
dddg | jr|j}|   | j|}| }t jrtd| td|jd|j td|d  | |jd t|d t
ddddgd t|d t
dddgd | t|d d | t|d d dS )z@Checking vlarray with NumPy string atoms (NumPy flavor, no conv)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z"Running %s.test01a_2_StringAtom...r   r   r   )r   zRagged array of strings)r.   r/   r   r   r   r   r   r   zObject read:zNrows inrW   zFirst row in vlarray ==>r   r3   r   r2   r4   N)r   rX   rY   r(   r   r"   rE   r   rF   rG   r   rH   r   r\   r   rN   r[   rR   rO   r   r   r^   )r'   rJ   r   r_   r   r   r   test01a_2_StringAtom  s2    


z"TypesTestCase.test01a_2_StringAtomc             C   s*  t jr tdd td| jj  | jjddtdddd	}d
|_|	dddddg |	ddg | j
r|j}|   | j|}| }t jrtd td| td|jd|j td|d  | |jd | |d dddddg | |d ddg | t|d d | t|d d dS )z8Checking vlarray with NumPy string atoms (python flavor)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z Running %s.test01b_StringAtom...r   stringAtom2r   )r   zRagged array of strings)r.   r/   r8   r   r   r   r   r   zTesting String flavorzObject read:zNrows inrW   zFirst row in vlarray ==>r   r3      1s   12s   123r2   r5   N)r   rX   rY   r(   r   r"   rE   r   rF   rG   r   r\   r   rN   r[   rR   rO   r^   )r'   rJ   r   r_   r   r   r   test01b_StringAtom  s0    


z TypesTestCase.test01b_StringAtomc             C   sp  t jr tdd td| jj  | jjddtdddd	}d
|_|	t
dddddg |	t
ddg t
dddddg|d< t
ddg|d< | jr|j}|   | j|}| }t jrtd| td|jd|j td|d  | |jd | t|d t
dddddg | t|d t
jddgdd | t|d d  | t|d d d!S )"zJChecking updating vlarray with NumPy string atoms
        ('numpy' flavor)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z Running %s.test01c_StringAtom...r   r   r   )r   zRagged array of strings)r.   r/   r   r   r   r   r   r    r   444r2   zObject read:zNrows inrW   zFirst row in vlarray ==>r3   r   s   123s   12    S3)r7   r5   N)r   rX   rY   r(   r   r"   rE   r   rF   rG   r   rH   r   r\   r   rN   r[   rR   rO   r]   r   r^   )r'   rJ   r   r_   r   r   r   test01c_StringAtom  s4    


 "z TypesTestCase.test01c_StringAtomc             C   sH  t jr tdd td| jj  | jjddtdddd	}d
|_|	dddddg |	ddg dddddg|d< ddg|d< | j
r|j}|   | j|}| }t jrtd td| td|jd|j td|d  | |jd | |d dddddg | |d dd g | t|d d! | t|d d d"S )#z;Checking updating vlarray with string atoms (String flavor)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z Running %s.test01d_StringAtom...r   r   r   )r   zRagged array of strings)r.   r/   r8   r   r   r   r   r   r   r   r   r   r2   zTesting String flavorzObject read:zNrows inrW   zFirst row in vlarray ==>r3   r   s   123s   12r   s   44   4r5   N)r   rX   rY   r(   r   r"   rE   r   rF   rG   r   r\   r   rN   r[   rR   rO   r^   )r'   rJ   r   r_   r   r   r   test01d_StringAtom)  s4    


z TypesTestCase.test01d_StringAtomc             C   s,  t jr tdd td| jj  | jjddt dd}|dd	d
g |dd	g | j	rt|j
}|   | j|}| }t jrtd| td|j
d|j td|d	  | |jd | t|d	 tjdd	dgdd | t|d tjdd	gdd | t|d	 d
 | t|d d dS )z$Checking vlarray with boolean atoms.rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test02_BoolAtom...r   r   zRagged array of Booleans)r.   r/   r2   r   r   rn   zObject read:zNrows inrW   zFirst row in vlarray ==>r3   bool)r7   N)r   rX   rY   r(   r   r"   rE   r   rG   r   r\   r   rN   r[   rR   rO   r]   r   r   rH   r^   )r'   rJ   r   r_   r   r   r   test02_BoolAtomN  s*    

$"zTypesTestCase.test02_BoolAtomc             C   s<  t jr tdd td| jj  | jjddt dd}|dd	d
g |dd	g d|d	< d|d< | j	r|j
}|   | j|}| }t jrtd| td|j
d|j td|d	  | |jd | t|d	 tjd	ddgdd | t|d tjd	dgdd | t|d	 d
 | t|d d dS )z,Checking setting vlarray with boolean atoms.rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test02b_BoolAtom...r   r   zRagged array of Booleans)r.   r/   r2   r   r   rn   )r   r2   r   )r   rn   zObject read:zNrows inrW   zFirst row in vlarray ==>r3   r   )r7   N)r   rX   rY   r(   r   r"   rE   r   rG   r   r\   r   rN   r[   rR   rO   r]   r   r   rH   r^   )r'   rJ   r   r_   r   r   r   test02b_BoolAtoml  s.    

$"zTypesTestCase.test02b_BoolAtomc          	   C   s`  dddddddg}t jr2tdd	 td
| jj  x&|D ]}| jjd|t|d}|	dddg |	ddg | j
r|j}| jdd | j|}| }t jrtd| td| td|jd|j td|d  | |jd | t|d tjdddg|d | t|d tjddg|d | t|d d | t|d d q:W dS )z$Checking vlarray with integer atoms.int8uint8int16uint16r6   uint32int64rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test03_IntAtom...r   )r.   r2   r3   r   rn   r   rm   )modezTesting type:zObject read:zNrows inrW   zFirst row in vlarray ==>)r7   N)r   rX   rY   r(   r   r"   rE   r   from_sctyperG   r   r\   r   rN   r[   rR   rO   r]   r   r   rH   r^   )r'   ttypesatyperJ   r   r_   r   r   r   test03_IntAtom  s@    



zTypesTestCase.test03_IntAtomc          	   C   s  t jt jt jt jt jt jt jd}tj	rBt
dd t
d| jj  xp|D ]f}| jjd|t|| d}t jddd	g|d
}| }| }|| t jddg|d
}| }| }|| | jr|j}| jdd | j|}| }tj	r.t
d| t
d| t
d|jd|j t
d|d  | |jd | t|d t jddd	g|| d
 | t|d t jddg|| d
 | t|d d	 | t|d d qJW dS )z7Checking vlarray with integer atoms (byteorder swapped))r   r   r   r   r6   r   r   rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test03a_IntAtom...r   )r.   r2   r3   r   )r7   rn   r   rm   )r   zTesting type:zObject read:zNrows inrW   zFirst row in vlarray ==>N)r   r   r   r   r   r6   r   r   r   rX   rY   r(   r   r"   rE   r   r   rH   byteswapnewbyteorderrG   r   r\   r   rN   r[   rR   rO   r]   r   r^   )r'   r   r   rJ   a0a1r   r_   r   r   r   test03a_IntAtom  sL    





$"zTypesTestCase.test03a_IntAtomc          	   C   sp  dddddddg}t jr2tdd	 td
| jj  x6|D ],}| jjd|t|d}|	dddg |	ddg d|d< d|d< | j
r|j}| jdd | j|}| }t jrtd| td| td|jd|j td|d  | |jd | t|d tjdddg|d | t|d tjddg|d | t|d d | t|d d q:W dS )z-Checking updating vlarray with integer atoms.r   r   r   r   r6   r   r   rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test03_IntAtom...r   )r.   r2   r3   r   rn   r   )r   r3   r2   )r   rn   rm   )r   zTesting type:zObject read:zNrows inrW   zFirst row in vlarray ==>)r7   N)r   rX   rY   r(   r   r"   rE   r   r   rG   r   r\   r   rN   r[   rR   rO   r]   r   r   rH   r^   )r'   r   r   rJ   r   r_   r   r   r   test03b_IntAtom  sD    


zTypesTestCase.test03b_IntAtomc          	   C   s  t jt jt jt jt jt jt jd}tj	rBt
dd t
d| jj  x|D ]}| jjd|t|| d}t jddd	g|d
}|| t jddg|d
}|| t jd	ddg|d
}| }| }||d< t jddg|d
}| }| }||d< | jr"|j}| jdd | j|}| }tj	rft
d| t
d| t
d|jd|j t
d|d  | |jd | t|d t jd	ddg|| d
 | t|d t jddg|| d
 | t|d d	 | t|d d qJW dS )z@Checking updating vlarray with integer atoms (byteorder swapped))r   r   r   r   r6   r   r   rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test03c_IntAtom...r   )r.   r2   r3   r   )r7   rn   r   rm   )r   zTesting type:zObject read:zNrows inrW   zFirst row in vlarray ==>N)r   r   r   r   r   r6   r   r   r   rX   rY   r(   r   r"   rE   r   r   rH   rG   r   r   r   r\   r   rN   r[   rR   rO   r]   r   r^   )r'   r   r   rJ   r   r   r   r_   r   r   r   test03c_IntAtom  sT    





$"zTypesTestCase.test03c_IntAtomc       
   	   C   sF  t jt jt jt jt jt jt jd}tj	rBt
dd t
d| jj  dddtj }x|D ]}| jjd|t|| |d	}t jd
ddg|d}|| t jddg|d}|| t jddd
g|d}| }| }||d< t jddg|d}| }| }||d
< | jr4|j}| jdd | j|}| }tj	rxt
d| t
d| t
d|jd|j t
d|d  t|d jj }	|	dkr| t|d jj tj | |j| | |jd |  t!|d t jddd
g|| d |  t!|d
 t jddg|| d | t"|d d | t"|d
 d qZW dS )z@Checking updating vlarray with integer atoms (another byteorder))r   r   r   r   r6   r   r   rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test03d_IntAtom...biglittle)r   r   r   )r.   	byteorderr2   r3   r   )r7   rn   r   rm   )r   zTesting type:zObject read:zNrows inrW   zFirst row in vlarray ==>Z
irrelevantN)#r   r   r   r   r   r6   r   r   r   rX   rY   r(   r   sysr   r"   rE   r   r   rH   rG   r   r   r   r\   r   rN   r[   rR   r   r7   rO   r]   r   r^   )
r'   r   r   r   rJ   r   r   r   r_   Z
byteorder2r   r   r   test03d_IntAtomT  sb    






$"zTypesTestCase.test03d_IntAtomc          
   C   s  ddg}x,dD ]$}|  d }tt|r|| qW tjrVtdd td| jj  x$|D ]}| j	j
d|t|d	}|d
ddg |ddg | jr|j}| jdd | j	|}| }tjrtd| td| td|jd|j td|d  | |jd | t|d td
ddg| | t|d tddg| | t|d d | t|d d q^W dS )z+Checking vlarray with floating point atoms.float32float64)float16float96float128r   rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test04_FloatAtom...r   )r.   g?g@gffffff
@gσًg3#I9rm   )r   zTesting type:zObject read:zNrows inrW   zFirst row in vlarray ==>r   r3   r2   r   N)
capitalizehasattrrB   rG   r   rX   rY   r(   r   r"   rE   r   r   r   r\   r   rN   r[   rR   rO   r]   r   r   rH   r^   )r'   r   r   atomnamer   rJ   r_   r   r   r   test04_FloatAtom  s>    




zTypesTestCase.test04_FloatAtomc          	   C   s  t jt jd}ttdr"t j|d< ttdr6t j|d< ttdrJt j|d< tj	rjt
dd	 t
d
| jj  xr|D ]h}| jjd|t|| d}t jdddg|d}| }| }|| t jddg|d}| }| }|| | jr|j}| jdd | j|}| }tj	rXt
d| t
d| t
d|jd|j t
d|d  | |jd | t|d t jdddg|| d | t|d t jddg|| d | t|d d | t|d d qrW dS )z5Checking vlarray with float atoms (byteorder swapped))r   r   Float16Atomr   Float96Atomr   Float128Atomr   rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test04a_FloatAtom...r   )r.   g?g@gffffff
@)r7   gσًg3#I9rm   )r   zTesting type:zObject read:zNrows inrW   zFirst row in vlarray ==>r   r3   r2   r   N)r   r   r   r   rB   r   r   r   r   rX   rY   r(   r   r"   rE   r   r   rH   r   r   rG   r   r\   r   rN   r[   rR   rO   r]   r   r^   )r'   r   r   rJ   r   r   r   r_   r   r   r   test04a_FloatAtom  sN    











zTypesTestCase.test04a_FloatAtomc          
   C   s  ddg}x,dD ]$}|  d }tt|r|| qW tjrVtdd td| jj  x4|D ]*}| j	j
d|t|d	}|d
ddg |ddg d|d< d|d< | jr|j}| jdd | j	|}| }tjrtd| td| td|jd|j td|d  | |jd | t|d tdddg| | t|d tddg| | t|d d | t|d d q^W dS ) z4Checking updating vlarray with floating point atoms.r   r   )r   r   r   r   rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test04b_FloatAtom...r   )r.   g?g@gffffff
@gσًg3#I9)g333333@g@g333333@r   )g' gz9GP9r2   rm   )r   zTesting type:zObject read:zNrows inrW   zFirst row in vlarray ==>r3   g333333@g' gz9GP9r   N)r   r   rB   rG   r   rX   rY   r(   r   r"   rE   r   r   r   r\   r   rN   r[   rR   rO   r]   r   r   rH   r^   )r'   r   r   r   r   rJ   r_   r   r   r   test04b_FloatAtom  sB    




zTypesTestCase.test04b_FloatAtomc          	   C   s  t jt jd}ttdr"t j|d< ttdr6t j|d< ttdrJt j|d< tj	rjt
dd	 t
d
| jj  x|D ]}| jjd|t|| d}t jdddg|d}|| t jddg|d}|| t jdddg|d}| }| }||d< t jddg|d}| }| }||d< | jrJ|j}| jdd | j|}| }tj	rt
d| t
d| t
d|jd|j t
d|d  | |jd | t|d t jdddg|| d | t|d t jddg|| d | t|d d | t|d d qrW d S )!z>Checking updating vlarray with float atoms (byteorder swapped))r   r   r   r   r   r   r   r   rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test04c_FloatAtom...r   )r.   g?g@gffffff
@)r7   rn   r   g333333@g' gz9GP9r2   rm   )r   zTesting type:zObject read:zNrows inrW   zFirst row in vlarray ==>r3   r   N)r   r   r   r   rB   r   r   r   r   rX   rY   r(   r   r"   rE   r   r   rH   rG   r   r   r   r\   r   rN   r[   rR   rO   r]   r   r^   )r'   r   r   rJ   r   r   r   r_   r   r   r   test04c_FloatAtom   sV    











zTypesTestCase.test04c_FloatAtomc       	   	   C   sT  t jt jd}ttdr"t j|d< ttdr6t j|d< ttdrJt j|d< tj	rjt
dd	 t
d
| jj  dddtj }x|D ]}| jjd|t|| |d}t jdddg|d}|| t jddg|d}|| t jdddg|d}| }| }||d< t jddg|d}| }| }||d< | jr\|j}| jdd | j|}| }tj	rt
d| t
d| t
d|jd|j t
d |d  | |j| | t|d j j tj | |jd! | t!|d t jdddg|| d | t!|d t jddg|| d | t"|d d" | t"|d d! qW d#S )$z>Checking updating vlarray with float atoms (another byteorder))r   r   r   r   r   r   r   r   rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test04d_FloatAtom...r   r   )r   r   r   )r.   r   g?g@gffffff
@)r7   rn   r   g333333@g' gz9GP9r2   rm   )r   zTesting type:zObject read:zNrows inrW   zFirst row in vlarray ==>r3   r   N)#r   r   r   r   rB   r   r   r   r   rX   rY   r(   r   r   r   r"   rE   r   r   rH   rG   r   r   r   r\   r   rN   r[   rR   rO   r]   r   r7   r   r^   )	r'   r   r   r   rJ   r   r   r   r_   r   r   r   test04d_FloatAtomY  s^    











zTypesTestCase.test04d_FloatAtomc          
   C   sz  ddg}t tdr|d t tdr0|d tjrPtdd td	| jj  x"|D ]}| jj	d
|t
|d}|dddg |ddg | jr|j}| jdd | j|}| }tjrtd| td| td|jd|j td|d  | |jd | t|d tdddg| | t|d tddg| | t|d d | t|d d qXW dS )z.Checking vlarray with numerical complex atoms.	complex64
complex128Complex192Atom
complex192Complex256Atom
complex256rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z Running %s.test04_ComplexAtom...r   )r.   y?        y        @yffffff
@ffffff
@y        σًy3#I9        rm   )r   zTesting type:zObject read:zNrows inrW   zFirst row in vlarray ==>r   r3   r2   r   N)r   rB   rG   r   rX   rY   r(   r   r"   rE   r   r   r   r\   r   rN   r[   rR   rO   r]   r   r   rH   r^   )r'   r   r   rJ   r   r_   r   r   r   test04_ComplexAtom  sD    







z TypesTestCase.test04_ComplexAtomc          
   C   s  ddg}t tdr|d t tdr0|d tjrPtdd td	| jj  x4|D ]*}| jj	d
|t
|d}|dddg |ddg d|d< d|d< | jr|j}| jdd | j|}| }tjrtd| td| td|jd|j td|d  | |jd | t|d tdddg| | t|d td d!g| | t|d d" | t|d d qXW d#S )$z8Checking modifying vlarray with numerical complex atoms.r   r   r   r   r   r   rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z!Running %s.test04b_ComplexAtom...r   )r.   y?        y        @yffffff
@ffffff
@y        σًy3#I9        )yffffff?        y        @yffffff
@333333@r   )y      @σًy3#I9      @r2   rm   )r   zTesting type:zObject read:zNrows inrW   zFirst row in vlarray ==>r3   yffffff?        y        @yffffff
@333333@y      @σًy3#I9      @r   N)r   rB   rG   r   rX   rY   r(   r   r"   rE   r   r   r   r\   r   rN   r[   rR   rO   r]   r   r   rH   r^   )r'   r   r   rJ   r   r_   r   r   r   test04b_ComplexAtom  sJ    







z!TypesTestCase.test04b_ComplexAtomc             C   s  t  dkrdS tjr0tdd td| jj  | jjddt	 d}|
d	 |
d
 |
d |
d | t|j
ddg | t|j
d | jr|j}|   | j|}| }tjrtd| td|jd|j td|d  | |jd | |d d	 | |d d
 | |d d | |d d | t|d d | t|d d | t|d d | t|d d dS )z.Checking vlarray with variable length strings.asciiNrV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z!Running %s.test05_VLStringAtom...r   r   )r.   s   asds   asds   aaanar   s   foos   baru   asdäzObject read:zNrows inrW   zFirst row in vlarray ==>r   r4   r2   r3   r   r5   )r   getdefaultencodingr   rX   rY   r(   r   r"   rE   r   rG   assertRaises	TypeErrorUnicodeEncodeErrorr   r\   r   rN   r[   rR   rO   r^   )r'   rJ   r   r_   r   r   r   test05_VLStringAtom  s@    





z!TypesTestCase.test05_VLStringAtomc             C   sD  t jr tdd td| jj  | jjddt d}|d |d d	|d
< d|d< | 	t
|jdd | 	t
|jdd | jr|j}|   | j|}| }t jrtd| td|jd|j tdt|d
  tdt|d  | |jd | |d
 d	 | |d d | t|d
 d | t|d d dS )z7Checking updating vlarray with variable length strings.rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z"Running %s.test05b_VLStringAtom...r   r   )r.   s   asds   aaanas   as4r   s   aaancr2   s   shrts   toolongzObject read:zNrows inrW   zFirst row in vlarray ==>zSecond row in vlarray ==>r3   r   r5   N)r   rX   rY   r(   r   r"   rE   r   rG   r   
ValueError__setitem__r   r\   r   rN   r[   rR   reprrO   r^   )r'   rJ   r   r_   r   r   r   test05b_VLStringAtom&  s6    



z"TypesTestCase.test05b_VLStringAtomc             C   sl  t jr tdd td| jj  | jjddt d}|ddd	gd
dg |d	dt	 g |d | j
r|j}|   | j|}| }t jrtd| td|jd|j td|d  | |jd	 | |d ddd	gd
dg t|d }| }| |d	dg | |jt	 j | |d d | t|d d	 | t|d d	 | tt|d  dS )z#Checking vlarray with object atoms.rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test06a_Object...r   Object)r.   r2   r3   r   aaau	   aaaçççr4   *   zObject read:zNrows inrW   zFirst row in vlarray ==>r   N)r   rX   rY   r(   r   r"   rE   r
   rG   r   r   r\   r   rN   r[   rR   rO   listpopr   r^   r   r   )r'   rJ   r   r_   list1rT   r   r   r   test06a_ObjectL  s6    


zTypesTestCase.test06a_Objectc             C   s`  t jr tdd td| jj  | jjddt d}|ddd	gd
df |d	ddgg dddgddf|d< dddgg|d< | j	r|j
}|   | j|}| }t jrtd| td|j
d|j td|d  | |jd | |d dddgddf t|d }| }| |ddg | |dg | t|d d	 | t|d d	 dS )z,Checking updating vlarray with object atoms.rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test06b_Object...r   r   )r.   r2   r3   r   r   u   çç4r4      Zaa4u   çç5r   zObject read:zNrows inrW   zFirst row in vlarray ==>N)r   rX   rY   r(   r   r"   rE   r
   rG   r   r\   r   rN   r[   rR   rO   r   r   r^   )r'   rJ   r   r_   r   rT   r   r   r   test06b_Objectp  s2    

zTypesTestCase.test06b_Objectc          
   C   sP  t jr tdd td| jj  | jjddt d}|t	
ddgd	d
ggd |t	
d	dddgd |t	
dd | jr|j}|   | j|}| }t jrtd| td|jd|j td|d	  | |jd | t|d	 t	
ddgd	d
ggd | t|d t	
d	dddgd | t|d t	
dd dS )z;Checking vlarray with object atoms (numpy arrays as values)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test06c_Object...r   r   )r.   r2   r3   r   r4   i4r   i8r   i1zObject read:zNrows inrW   zFirst row in vlarray ==>N)r   rX   rY   r(   r   r"   rE   r
   rG   r   rH   r   r\   r   rN   r[   rR   rO   r]   r   )r'   rJ   r   r_   r   r   r   test06c_Object  s(    

($zTypesTestCase.test06c_Objectc          
   C   s  t jr tdd td| jj  | jjddt d}|t	
ddgd	d
ggd |t	
d	dddgd |t	
dd t	
dd	gd	d
ggd|d	< t	
d	dd	dgd|d< t	
dd|d< | jr|j}|   | j|}| }t jrtd| td|jd|j td|d	  | |jd | t|d	 t	
dd	gd	d
ggd | t|d t	
d	dd	dgd | t|d t	
dd dS )z:Checking updating vlarray with object atoms (numpy arrays)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test06d_Object...r   r   )r.   r2   r3   r   r4   r   r   r   r   r      zObject read:zNrows inrW   zFirst row in vlarray ==>N)r   rX   rY   r(   r   r"   rE   r
   rG   r   rH   r   r\   r   rN   r[   rR   rO   r]   r   )r'   rJ   r   r_   r   r   r   test06d_Object  s.    

($zTypesTestCase.test06d_Objectc             C   s  t  dkrdS tjr0tdd td| jj  | jjddt	 d}|
d	 |
d
 |
d |
d | t|j
ddg | t|j
d | jr|j}|   | j|}| }tjrtd| td|jd|j td|d  | |jd | |d d	 | |d d
 | |d d | |d d | t|d d | t|d d | t|d d | t|d d dS )z6Checking vlarray with variable length Unicode strings.r   NrV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z"Running %s.test07_VLUnicodeAtom...r   r   )r.   asdu   asdŀZaaanar   ZfooZbaru   asdäzObject read:zNrows inrW   zFirst row in vlarray ==>r   r4   r2   r3   r   r5   )r   r   r   rX   rY   r(   r   r"   rE   r   rG   r   r   UnicodeDecodeErrorr   r\   r   rN   r[   rR   rO   r^   )r'   rJ   r   r_   r   r   r   test07_VLUnicodeAtom  s@    





z"TypesTestCase.test07_VLUnicodeAtomc             C   sD  t jr tdd td| jj  | jjddt d}|d |d d	|d
< d|d< | 	t
|jdd | 	t
|jdd | jr|j}|   | j|}| }t jrtd| td|jd|j tdt|d
  tdt|d  | |jd | |d
 d	 | |d d | t|d
 d | t|d d dS )z?Checking updating vlarray with variable length Unicode strings.rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z#Running %s.test07b_VLUnicodeAtom...r   r   )r.   r   u   aaanäu   asär   u   aaanŀr2   ZshrtZtoolongzObject read:zNrows inrW   zFirst row in vlarray ==>zSecond row in vlarray ==>r3   r   r5   N)r   rX   rY   r(   r   r"   rE   r   rG   r   r   r   r   r\   r   rN   r[   rR   r   rO   r^   )r'   rJ   r   r_   r   r   r   test07b_VLUnicodeAtom
  s6    



z#TypesTestCase.test07b_VLUnicodeAtomN)"r   r   r   	open_moderD   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   r   r   r   r   r   y  s>   !!"!&%",208?+3/9=/4-&$,$-r   c               @   s   e Zd ZdZdZdS )TypesReopenTestCaseZReopenTN)r   r   r   r/   r   r   r   r   r   r   1  s   r   c               @   s   e Zd ZdZdZdS )TypesNoReopenTestCasez	No reopenFN)r   r   r   r/   r   r   r   r   r   r   6  s   r   c                   sp   e Zd ZdZdZdZ fddZdd Zdd	 Zd
d Z	dd Z
dd Zdd Zdd Zdd Zdd Z  ZS )MDTypesTestCaser   r   r   c                s   t t|   | jj| _d S )N)r    r   r!   r"   r#   r$   )r'   )r(   r   r   r!   @  s    zMDTypesTestCase.setUpc          
   C   s>  | j }tjr&tdd td| jj  | j|dtdddd}|	d	d
gd
d	gg |	ddgddgddgddgg |
 }tjrtd| td|jd|j td|d  | |jd t|d td	d
gd
d	ggd t|d tddgddgddgddggd | t|d d | t|d d dS )z,Checking vlarray with MD NumPy string atoms.rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test01_StringAtom...r   r   )r3   )r   rP   zRagged array of stringsr   45sabcfabzObject read:zNrows inrW   zSecond row in vlarray ==>r2   r3   r   r   r4   N)r$   r   rX   rY   r(   r   r"   rE   r   rG   r[   r\   rR   rO   r   r   r   rH   r^   )r'   r#   rJ   r_   r   r   r   r   D  s.    

 z!MDTypesTestCase.test01_StringAtomc             C   s4  | j }tjr&tdd td| jj  | j|dtdddd}d	|_	|
d
dgdd
gg |
ddgddgddgddgg | }tjrtd| td|jd|j td|d  | |jd | |d ddgddgg | |d ddgddgddgddgg | t|d d | t|d d dS )z=Checking vlarray with MD NumPy string atoms ('python' flavor)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z Running %s.test01b_StringAtom...r   r   )r3   )r   rP   zRagged array of stringsr8   r   r   r   r   r   r   zObject read:zNrows inrW   zSecond row in vlarray ==>r2   r3   r   s   123s   45   ss   abc   fs   abr4   N)r$   r   rX   rY   r(   r   r"   rE   r   rF   rG   r[   r\   rR   rO   r^   )r'   r#   rJ   r_   r   r   r   r   d  s,    

z"MDTypesTestCase.test01b_StringAtomc          	   C   sn  | j }tjr&tdd td| jj  | j|dtdddd}d	|_	t
jd
dgddgddggdd}||dd  t
dd
gddgddgddgddgddgg}||dd  | }tjrtd| td|jd|j td|d  | |jd | |d ddgddgg | |d ddgdd gdd!gd!d gg | t|d d | t|d d" dS )#z9Checking vlarray with MD NumPy string atoms (with offset)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z Running %s.test01c_StringAtom...r   r   )r3   )r   rP   zRagged array of stringsr8   rm   br   r   r   )r7   r2   Nr   r   r   r   r3   zObject read:zNrows inrW   zSecond row in vlarray ==>r   s   123s   45r   s   abcr   s   abr4   )r$   r   rX   rY   r(   r   r"   rE   r   rF   r   rH   rG   r[   r\   rR   rO   r^   )r'   r#   rJ   rm   r_   r   r   r   r     s2    
 
z"MDTypesTestCase.test01c_StringAtomc          	   C   s`  | j }tjr&tdd td| jj  | j|dtdddd}d	|_	t
jd
dgddgddggdd}||ddd  t
dd
gddgddgddgddgddgg}||ddd  | }tjrtd| td|jd|j td|d  | |jd | |d ddgg | |d ddgd d!gg | t|d d | t|d d dS )"z9Checking vlarray with MD NumPy string atoms (with stride)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z Running %s.test01d_StringAtom...r   r   )r3   )r   rP   zRagged array of stringsr8   rm   r   r   r   r   )r7   r2   Nr3   r   r   r   r   zObject read:zNrows inrW   zSecond row in vlarray ==>r   s   123s   45r      as   abcr   )r$   r   rX   rY   r(   r   r"   rE   r   rF   r   rH   rG   r[   r\   rR   rO   r^   )r'   r#   rJ   rm   r_   r   r   r   r     s0    
 
z"MDTypesTestCase.test01d_StringAtomc          
   C   s(  | j }tjr&tdd td| jj  | j|dtddd}|	dd	d
g |	dg |
 }tjrtd| td|jd|j td|d  | |jd | t|d tjdddgdddgdddggdd | t|d tjdddggdd | t|d d | t|d d dS )z'Checking vlarray with MD boolean atoms.rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test02_BoolAtom...r   )r   )rP   zRagged array of Booleans)r2   r   r   )r2   r2   r2   )r   r   r   )rn   r   r   zObject read:zNrows inrW   zSecond row in vlarray ==>r2   r3   r   r   )r7   r   N)r$   r   rX   rY   r(   r   r"   rE   r   rG   r[   r\   rR   rO   r]   r   r   rH   r^   )r'   r#   rJ   r_   r   r   r   r     s,    


&"zMDTypesTestCase.test02_BoolAtomc          
   C   sX  | j }tjr&tdd td| jj  | j|dtddd}t	j
dd	d
dgdd}||dd  t	j
d
dgdd}||dd  | }tjrtd| td|jd|j td|d  | |jd | t|d t	j
dddgdddgdddggdd | t|d t	j
dddggdd | t|d d | t|d d dS )z4Checking vlarray with MD boolean atoms (with offset)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test02b_BoolAtom...r   )r   )rP   zRagged array of Booleans)r   r   r   )r2   r   r   )r2   r2   r2   r   )r7   r2   N)rn   r   r   zObject read:zNrows inrW   zSecond row in vlarray ==>r3   r   r   )r$   r   rX   rY   r(   r   r"   rE   r   r   rH   rG   r[   r\   rR   rO   r]   r   r^   )r'   r#   rJ   rm   r_   r   r   r   r     s2    


&z MDTypesTestCase.test02b_BoolAtomc          	   C   s^  | j }tjr&tdd td| jj  | j|dtddd}t	j
dd	d
dgdd}||ddd  t	j
d
ddgdd}||ddd  | }tjrtd| td|jd|j td|d  | |jd | t|d t	j
dddgdddggdd | t|d t	j
dddgdddggdd | t|d d | t|d d dS )z5Checking vlarray with MD boolean atoms (with strides)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test02c_BoolAtom...r   )r   )rP   zRagged array of Booleans)r   r   r   )r2   r   r   )r2   r2   r2   r   )r7   r2   Nr3   )rn   r   r   zObject read:zNrows inrW   zSecond row in vlarray ==>r   )r$   r   rX   rY   r(   r   r"   rE   r   r   rH   rG   r[   r\   rR   rO   r]   r   r^   )r'   r#   rJ   rm   r_   r   r   r   test02c_BoolAtom  s4    


""z MDTypesTestCase.test02c_BoolAtomc             C   sd  dddddddg}| j }tjr8tdd	 td
| jj  x$|D ]}| jj||t	|dd}|
td|td|g |
td|d g | }tjrtd| td|jd|j tdt|d  | |jd | t|d ttdtdg| | t|d ttdd g| | t|d d | t|d d q@W dS )z'Checking vlarray with MD integer atoms.r   r   r   r   r6   r   r   rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test03_IntAtom...)r3   r   )r.   d   zTesting type:zNrows inrW   zSecond row in vlarray ==>r2   r3   r   N)r$   r   rX   rY   r(   r   r"   rE   r   r   rG   r   oneszerosr[   r\   rR   r   rO   r]   r   rH   r^   )r'   r   r#   r   rJ   r_   r   r   r   r   *  s>    



$zMDTypesTestCase.test03_IntAtomc       	      C   s  ddddg}x,dD ]$}|  d }tt|r|| qW x,dD ]$}d| }tt|r@|d	|  q@W | j}tjrtd
d td| jj	  x*|D ] }| j
j||t|dd}|td|d td|g |td|d g | }tjr*td| td|jd|j td|d  | |jd | t|d ttdd tdg| | t|d ttdd g| | t|d d | t|d d qW dS )z.Checking vlarray with MD floating point atoms.r   r   r   r   )r   r   r   r   )      zComplex%dAtomz	complex%drV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test04_FloatAtom...)r5   r3   r9   )r.   g?g     @zTesting type:zNrows inrW   zSecond row in vlarray ==>r2   r3   r   N)r   r   rB   rG   r$   r   rX   rY   r(   r   r"   rE   r   r   r   r  r  r[   r\   rR   rO   r]   r   rH   r^   )	r'   r   r   r   r   r#   r   rJ   r_   r   r   r   r   U  sJ    








z MDTypesTestCase.test04_FloatAtom)r   r   r   r   rD   r*   r!   r   r   r   r   r   r   r  r   r   rr   r   r   )r(   r   r   ;  s    "!"#+r   c               @   s   e Zd ZdZdS )MDTypesNumPyTestCaseZMDTypesN)r   r   r   r/   r   r   r   r   r    s   r  c                   sH   e Zd ZdZ fddZdd Zdd Zdd	 Zd
d Zdd Z	  Z
S )AppendShapeTestCaser   c                s   t t|   | jj| _d S )N)r    r  r!   r"   r#   r$   )r'   )r(   r   r   r!     s    zAppendShapeTestCase.setUpc             C   s&  | j }tjr&tdd td| jj  | j|dt d}d|_	|
d |
dd	d
g |
tjdd	d
gdd | jrtjrtd |   | jjj}| }tjrtd| td|jd|j td|d  | |jd
 | |d dd	d
g | |d dd	d
g | |d	 dd	d
g dS )z0Checking vlarray.append() with different inputs.rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test00_difinputs...rJ   zRagged array of intsr8   )r2   r3   r   r2   r3   r   r6   )r7   z(closing file version)zObject read:zNrows inrW   zFirst row in vlarray ==>r   N)r$   r   rX   rY   r(   r   r"   rE   r	   rF   rG   r   rH   r&   r   r#   rJ   r[   r\   rR   rO   )r'   r#   rJ   r_   r   r   r   test00_difinputs  s2    




z$AppendShapeTestCase.test00_difinputsc          	   C   s   | j }tjr&tdd td| jj  | j|dtddd}| 	t
 |dd	d
gg W dQ R X | jrtjrztd |   | jjj}| }tjrtd| td|jd|j | |jd dS )z3Checking vlarray.append() with too many dimensions.rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z Running %s.test01_toomanydims...rJ   r   )r   zRagged array of stringsr   Z4563Nz(closing file version)zObject read:zNrows inrW   r   )r$   r   rX   rY   r(   r   r"   rE   r   r   r   rG   r&   r   r#   rJ   r[   r\   rR   rO   )r'   r#   rJ   r_   r   r   r   test01_toomanydims  s&    



z&AppendShapeTestCase.test01_toomanydimsc             C   s   | j }tjr&tdd td| jj  | j|dt d}|	t
jddd | jrttjrbtd	 |   | jjj}|d
d
 }tjrtd| td|jd|j tdt| | |jd | t|t
jddd | t|d
 dS )z7Checking vlarray.append() with a zero-dimensional arrayrV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test02_zerodims...rJ   zRagged array of intsr6   )r9   r   )r7   rP   z(closing file version)r   zObject read:zNrows inrW   zFirst row in vlarray ==>r2   )r   N)r$   r   rX   rY   r(   r   r"   rE   r	   rG   r   r  r&   r   r#   rJ   r[   r\   rR   r   rO   r]   r   r^   )r'   r#   rJ   r_   r   r   r   test02_zerodims  s*    



z#AppendShapeTestCase.test02_zerodimsc             C   s   | j }tjr&tdd td| jj  | j|dt d}|	t
jddgdd	 | jrxtjrftd
 |   | jjj}|dd }tjrtd| td|jd|j tdt| | |jd | t|t
jddgdd	 | t|d dS )z>Checking vlarray.append() with a casted array (upgrading case)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test03a_cast...rJ   zRagged array of intsr2   r3   r   )r7   z(closing file version)r   zObject read:zNrows inrW   zFirst row in vlarray ==>r6   N)r$   r   rX   rY   r(   r   r"   rE   r	   rG   r   rH   r&   r   r#   rJ   r[   r\   rR   r   rO   r]   r   r^   )r'   r#   rJ   r_   r   r   r   test03a_cast  s*    



z AppendShapeTestCase.test03a_castc             C   s   | j }tjr&tdd td| jj  | j|dt d}|	t
jddgdd	 | jrxtjrftd
 |   | jjj}|dd }tjrtd| td|jd|j tdt| | |jd | t|t
jddgdd	 | t|d dS )z@Checking vlarray.append() with a casted array (downgrading case)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test03b_cast...rJ   zRagged array of intsr2   r3   r   )r7   z(closing file version)r   zObject read:zNrows inrW   zFirst row in vlarray ==>r6   N)r$   r   rX   rY   r(   r   r"   rE   r	   rG   r   rH   r&   r   r#   rJ   r[   r\   rR   r   rO   r]   r   r^   )r'   r#   rJ   r_   r   r   r   test03b_cast  s*    



z AppendShapeTestCase.test03b_cast)r   r   r   r   r!   r	  r  r  r  r  rr   r   r   )r(   r   r    s   & r  c               @   s   e Zd ZdZdS )OpenAppendShapeTestCaser   N)r   r   r   r&   r   r   r   r   r  7  s   r  c               @   s   e Zd ZdZdS )CloseAppendShapeTestCaser2   N)r   r   r   r&   r   r   r   r   r  ;  s   r  c                   sX   e Zd ZdZdZdZ fddZdd Zdd	 Zd
d Z	dd Z
dd Zdd Z  ZS )FlavorTestCaser   r   r   c                s   t t|   | jj| _d S )N)r    r  r!   r"   r#   r$   )r'   )r(   r   r   r!   D  s    zFlavorTestCase.setUpc             C   s   | j }tjr&tdd td| jj  | j|dtj	ddd}| j
|_
| j  t| jd| _| jjj}| }tjrtd	| j
 td
|t| td|jd|j | |jd | |g  dS )zAChecking empty vlarrays with different flavors (closing the file)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z!Running %s.test01_EmptyVLArray...rJ   intr4   )r   rK   zTesting flavor:zObject read:zNrows inrW   r   N)r$   r   rX   rY   r(   r   r"   rE   r   	from_kindrF   r&   rB   rL   rM   r#   rJ   r[   r   r\   rR   rO   )r'   r#   rJ   r_   r   r   r   test01a_EmptyVLArrayH  s$    



z#FlavorTestCase.test01a_EmptyVLArrayc             C   s   | j }tjr&tdd td| jj  | j|dtj	ddd}| j
|_
| }tjr~td| j
 td	| td
|jd|j | |jd | |g  dS )z@Checking empty vlarrays with different flavors (no closing file)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z!Running %s.test01_EmptyVLArray...rJ   r  r4   )r   zTesting flavor:zObject read:zNrows inrW   r   N)r$   r   rX   rY   r(   r   r"   rE   r   r  rF   r[   r\   rR   rO   )r'   r#   rJ   r_   r   r   r   test01b_EmptyVLArrayd  s    


z#FlavorTestCase.test01b_EmptyVLArrayc             C   s  | j }tjr&tdd td| jj  | j|dt }| j	|_	|
dddg |
d |
d	d
g | }tjrtd| j	 td| td|jd|j td|d
  | |jd | t|d
 d | t|d d
 | t|d d | j	dkrdddg}g }dd
g}n@| j	dkrZtjdddgdd}tjg dd}tjdd
gdd}| j	dkr| t|d
 || j	 | t|d || j	 | t|d || j	 n0| |d
 | | |d | | |d | dS )z:Checking vlarray with different flavors (boolean versions)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test02_BoolAtom...ZBoolr2   r3   r   r   r  r   zTesting flavor:zObject read:zNrows inrW   zFirst row in vlarray ==>r8   r   r   )r7   N)r$   r   rX   rY   r(   r   r"   rE   r   rF   rG   r[   r\   rR   rO   r^   r   rH   r]   r   )r'   r#   rJ   r_   arr1arr2arr3r   r   r   test02_BooleanAtom}  sD    




z!FlavorTestCase.test02_BooleanAtomc       	      C   s  dddddddg}| j }tjr8tdd	 td
| jj  x|D ]}| j||t	|}| j
|_
|dddg |d |ddg | }tjrtd| j
 td| td|jd|j td|d  | |jd | t|d d | t|d d | t|d d | j
dkr>dddg}g }ddg}n@| j
dkr~tjdddg|d}tjg |d}tjddg|d}| j
dkr| t|d || j
 | t|d || j
 | t|d || j
 q@| |d | | |d | | |d | q@W dS )z:Checking vlarray with different flavors (integer versions)r   r   r   r   r6   r   r   rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test03_IntAtom...r2   r3   r   r   r  r   zTesting flavor:zObject read:zNrows inrW   zFirst row in vlarray ==>r8   r   )r7   N)r$   r   rX   rY   r(   r   r"   rE   r   r   rF   rG   r[   r\   rR   rO   r^   r   rH   r]   r   )	r'   r   r#   r   rJ   r_   r  r  r  r   r   r   r     sV    





zFlavorTestCase.test03_IntAtomc       	      C   s2  dddddddg}| j }tjr8tdd	 td
| jj  x|D ]}| j||t	|}| j
|_
|dddg |d |ddg | jdd | jj}| j|t|}| }tjrtd| j
 td| td|jd|j td|d  | |jd | t|d d | t|d d | t|d d | j
dkrddddg}g }ddg}n@| j
dkrtjdddg|d}tjg |d}tjddg|d}| j
dkr| t|d || j
 | t|d || j
 | t|d || j
 q@| |d | | |d | | |d | q@W dS )z;Checking vlarray flavors (integer versions and closed file)r   r   r   r   r6   r   r   rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test03_IntAtom...r2   r3   r   r   r  r   rm   )r   zTesting flavor:zObject read:zNrows inrW   zFirst row in vlarray ==>r8   r   )r7   N)r$   r   rX   rY   r(   r   r"   rE   r   r   rF   rG   r   r#   rN   strr[   r\   rR   rO   r^   r   rH   r]   r   )	r'   r   r#   r   rJ   r_   r  r  r  r   r   r   r     s\    





zFlavorTestCase.test03b_IntAtomc             C   s  ddddg}x,dD ]$}|  d }tt|r|| qW x,dD ]$}d| }tt|r@|d	|  q@W | j}tjrtd
d td| jj	  x|D ]}| j
||t|}| j|_|dddg |d |ddg | }tjr(td| j td| td|jd|j td|d  | |jd | t|d d | t|d d | t|d d | jdkrttdddg|}	ttg |}
ttddg|}n@| jdkrtjdddg|d}	tjg |d}
tjddg|d}| jdkrP| t|d |	| j | t|d |
| j | t|d || j q| |d |	 | |d |
 | |d | qW dS ) zAChecking vlarray with different flavors (floating point versions)r   r   r   r   )r   r   r   r   )r  r  zComplex%dAtomz	complex%drV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test04_FloatAtom...g?g@gffffff
@r   gσًg3#I9zTesting flavor:zObject read:zNrows inrW   zFirst row in vlarray ==>r   r   r2   r3   r8   r   )r7   N)r   r   rB   rG   r$   r   rX   rY   r(   r   r"   rE   r   r   rF   r[   r\   rR   rO   r^   r   r   rH   r]   r   )r'   r   r   r   r   r#   r   rJ   r_   r  r  r  r   r   r   r   &	  s`    







zFlavorTestCase.test04_FloatAtom)r   r   r   r   rD   r*   r!   r  r  r  r   r   r   rr   r   r   )r(   r   r  ?  s   .<?r  c               @   s   e Zd ZdZdS )NumPyFlavorTestCaser   N)r   r   r   rF   r   r   r   r   r  h	  s   r  c               @   s   e Zd ZdZdS )PythonFlavorTestCaser8   N)r   r   r   rF   r   r   r   r   r  l	  s   r  c                   s   e Zd ZdZdZdZdZ fddZdd Zd	d
 Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd  Z  ZS )!ReadRangeTestCaser  r   r   r   c                s,   t t|   | jj| _|   |   d S )N)r    r  r!   r"   r#   r$   r%   r   )r'   )r(   r   r   r!   v	  s    
zReadRangeTestCase.setUpc             C   s\   | j }tj| j| jd}| jj|dt d|dd}x$t| j	D ]}|
tt| q>W d S )N)r)   r*   rJ   zragged array if intsi  )r0   r1   )r$   rB   rC   rD   r*   r"   rE   r	   r   rR   rG   r   )r'   rI   r0   rJ   ri   r   r   r   r%   |	  s    
zReadRangeTestCase.populateFilec             C   s:  t jr tdd td| jj  | jjj}g }||	dd  ||	dd  ||	dd  t jrtd|j
d|j td	|d
  | |j| j | t|d d | t|d
 d | t|d d | t|d tjddd | t|d
 tjddd | t|d tjddd dS )z&Checking reads with only a start valuerV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test01_start...r   r=   c   zNrows inrW   zSecond row in vlarray ==>r2   r3   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   rG   r[   r\   rR   rO   r^   r]   r   r   arange)r'   rJ   r_   r   r   r   test01_start	  s$    

zReadRangeTestCase.test01_startc             C   s(  t jr tdd td| jj  | jjj}g }||d  ||d  ||d  t jr~td|j	d|j
 td	|d
  | |j
| j
 | t|d d | t|d
 d | t|d d | t|d tjddd | t|d
 tjddd | t|d tjddd dS )z1Checking reads with only a start value in a slicerV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test01b_start...r   r=   r  zNrows inrW   zSecond row in vlarray ==>r2   r3   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   rG   r\   rR   rO   r^   r]   r   r   r  )r'   rJ   r_   r   r   r   test01b_start	  s$    

zReadRangeTestCase.test01b_startc             C   s:  t jr tdd td| jj  | jjj}g }||t	
d  ||t	d  ||t	d  t jrtd|jd|j td	|d
  | |j| j | t|d d | t|d
 d | t|d d | t|d t	jddd | t|d
 t	jddd | t|d t	jddd dS )zAChecking reads with only a start value in a slice (numpy indexes)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test01np_start...r   r=   r  zNrows inrW   zSecond row in vlarray ==>r2   r3   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   rG   r   r   r6   r   r\   rR   rO   r^   r]   r   r  )r'   rJ   r_   r   r   r   test01np_start	  s$    

z ReadRangeTestCase.test01np_startc          	   C   s|  t jr tdd td| jj  | jjj}d|_g }|	|j
dd |	|j
dd |	|j
dd t jrtd	|jd
|j td|d  td|d  | |j| j | t|d d | t|d d | t|d d | t|d d tjddd x4tdD ](}| t|d | tj|dd qW x4tdD ](}| t|d | tj|dd qLW dS )z%Checking reads with only a stop valuerV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test02_stop...r   r2   )stopr=   r  zNrows inrW   zFirst row in vlarray ==>r   zSecond row in vlarray ==>r3   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   _nrowsinbufrG   r[   r\   rR   rO   r^   r]   r   r   r  r   )r'   rJ   r_   xr   r   r   test02_stop	  s0    

"zReadRangeTestCase.test02_stopc          	   C   s  t jr tdd td| jj  | jjj}d|_g }|	|dd  |	|dd  |	|dd  t jrtd	|j
d
|j td|d  | |j| j | t|d d | t|d d | t|d d x2tdD ]&}| t|d | tjddd qW x4tdD ](}| t|d | tj|dd qW x4tdD ](}| t|d | tj|dd qPW dS )z0Checking reads with only a stop value in a slicerV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test02b_stop...r   Nr2   r=   r  zNrows inrW   zSecond row in vlarray ==>r   r3   r6   )r7   )r   rX   rY   r(   r   r"   r#   rJ   r$  rG   r\   rR   rO   r^   r   r]   r   r   r  )r'   rJ   r_   r%  r   r   r   test02b_stop	  s2    

zReadRangeTestCase.test02b_stopc          	   C   s  t jr tdd td| jj  | jjj}d|_g }|	|
dd |	|
dd |	|
dd	 t jrtd
|jd|j td|d  | |j| j | t|d d | t|d d | t|d d	 x4tddD ]&}| t|d | tj|dd qW x:tddD ],}| t|d |d  tj|dd qW x6tdd	D ](}| t|d | tj|dd qZW dS )z+Checking reads with a start and stop valuesrV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test03_startstop...r   r   r=   r5      r  zNrows inrW   zSecond row in vlarray ==>r2   r3   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   r$  rG   r[   r\   rR   rO   r^   r   r]   r   r   r  )r'   rJ   r_   r%  r   r   r   test03_startstop
  s2    

(z"ReadRangeTestCase.test03_startstopc          	   C   s  t jr tdd td| jj  | jjj}d|_g }|	|dd  |	|dd  |	|d	d	  t jrtd
|j
d|j td|d  | |j| j | t|d d | t|d d | t|d d x4tddD ]&}| t|d | tj|dd qW x:tddD ],}| t|d |d  tj|dd qW x6tddD ](}| t|d | tj|dd qZW d	S )z5Checking reads with a start and stop values in slicesrV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test03b_startstop...r   r   r=   r5   r(  NzNrows inrW   zSecond row in vlarray ==>r2   r3   r  r6   )r7   )r   rX   rY   r(   r   r"   r#   rJ   r$  rG   r\   rR   rO   r^   r   r]   r   r   r  )r'   rJ   r_   r%  r   r   r   test03b_startstop>
  s2    

(z#ReadRangeTestCase.test03b_startstopc          	   C   s  t jr tdd td| jj  | jjj}d|_g }|	|
ddd |	|
dd	d |	|
dd
d t jrtd|jd|j td|d  | |j| j | t|d d | t|d d | t|d d x:tdddD ]*}| t|d |d  tj|dd qW x@tdd	dD ]0}| t|d |d d  tj|dd q,W x<tdd
dD ],}| t|d |d  tj|dd qnW dS )z/Checking reads with a start, stop & step valuesrV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z"Running %s.test04_startstopstep...r   r   r=   r3   r5   r(  r     zNrows inrW   zSecond row in vlarray ==>r2   r4   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   r$  rG   r[   r\   rR   rO   r^   r]   r   r   r   r  )r'   rJ   r_   r%  r   r   r   test04_startstopstepa
  s4    

&,z&ReadRangeTestCase.test04_startstopstepc          	   C   s  t jr tdd td| jj  | jjj}d|_g }|	|
tdtdtd |	|
tdtd	td |	|
tdtd
td t jrtd|jd|j td|d  | |j| j | t|d d | t|d d | t|d d x<tdddD ],}| t|d |d  tj|dd q&W x@tdd	dD ]0}| t|d |d d  tj|dd qdW x<tdd
dD ],}| t|d |d  tj|dd qW dS )z?Checking reads with a start, stop & step values (numpy indices)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z$Running %s.test04np_startstopstep...r   r   r=   r3   r5   r(  r  r+  zNrows inrW   zSecond row in vlarray ==>r2   r4   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   r$  rG   r[   r   r   r\   rR   rO   r^   r   r]   r   r  )r'   rJ   r_   r%  r   r   r   test04np_startstopstep
  s6    

&&(,z(ReadRangeTestCase.test04np_startstopstepc          	   C   s  t jr tdd td| jj  | jjj}d|_g }|	|ddd  |	|dd	d  |	|dd
d  t jrtd|j
d|j td|d  | |j| j | t|d d | t|d d | t|d d x:tdddD ]*}| t|d |d  tj|dd qW x@tdd	dD ]0}| t|d |d d  tj|dd q,W x<tdd
dD ],}| t|d |d  tj|dd qnW dS )z7Checking reads with start, stop & step values in slicesrV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test04b_slices...r   r   r=   r3   r5   r(  r  r+  zNrows inrW   zSecond row in vlarray ==>r2   r4   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   r$  rG   r\   rR   rO   r^   r   r]   r   r   r  )r'   rJ   r_   r%  r   r   r   test04b_slices
  s2    

&,z ReadRangeTestCase.test04b_slicesc          	   C   s  t jr tdd td| jj  | jjj}d|_g }|	|t
dt
dt
d  |	|t
dt
d	t
d  |	|t
dt
d
t
d  t jrtd|jd|j td|d  | |j| j | t|d d | t|d d | t|d d x<tdddD ],}| t|d |d  t
j|dd q&W x@tdd	dD ]0}| t|d |d d  t
j|dd qdW x<tdd
dD ],}| t|d |d  t
j|dd qW dS )z[Checking reads with start, stop & step values in slices.

        (numpy indices)

        rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test04bnp_slices...r   r   r=   r3   r5   r(  r  r+  zNrows inrW   zSecond row in vlarray ==>r2   r4   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   r$  rG   r   r   r6   r   r   r   r\   rR   rO   r^   r   r]   r   r  )r'   rJ   r_   r%  r   r   r   test04bnp_slices
  s2    

&&&(,z"ReadRangeTestCase.test04bnp_slicesc          	   C   st   t jr tdd td| jj  | jjj}t jrBtd|jd|j	 | 
t |dd }td| W d	Q R X d	S )
zChecking out of range readsrV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z!Running %s.test05_out_of_range...zNrows inrW   i  r   zrow-->N)r   rX   rY   r(   r   r"   r#   rJ   r\   rR   r   
IndexErrorr[   )r'   rJ   r_   r   r   r   test05_out_of_range
  s    

z%ReadRangeTestCase.test05_out_of_range)r   r   r   rR   r   rD   r*   r!   r%   r   r!  r"  r&  r'  r)  r*  r,  r-  r.  r/  r1  rr   r   r   )r(   r   r  p	  s$   !###$%#'r  c                   s   e Zd ZdZdZdZdZ fddZdd Zd	d
 Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Z  ZS )GetItemRangeTestCaser  r   r   r   c                s,   t t|   | jj| _|   |   d S )N)r    r2  r!   r"   r#   r$   r%   r   )r'   )r(   r   r   r!     s    
zGetItemRangeTestCase.setUpc             C   s\   | j }tj| j| jd}| jj|dt d|dd}x$t| j	D ]}|
tt| q>W d S )N)r)   r*   rJ   zragged array if intsi  )r0   r1   )r$   rB   rC   rD   r*   r"   rE   r	   r   rR   rG   r   )r'   rI   r0   rJ   ri   r   r   r   r%     s    
z!GetItemRangeTestCase.populateFilec             C   s.  t jr tdd td| jj  | jjj}g }||d  ||t	
d  ||d  t jrtd|jd|j td	|d
  | |j| j | t|d d | t|d
 d | t|d d | t|d t	jddd | t|d
 t	jddd | t|d t	jddd dS )z&Checking reads with only a start valuerV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test01_start...r   r=   r  zNrows inrW   zSecond row in vlarray ==>r2   r3   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   rG   r   rH   r\   rR   rO   r^   r]   r   r  )r'   rJ   r_   r   r   r   r      s*    

z!GetItemRangeTestCase.test01_startc             C   s(  t jr tdd td| jj  | jjj}g }||d  ||d  ||d  t jr~td|j	d|j
 td	|d
  | |j
| j
 | t|d d | t|d
 d | t|d d | t|d tjddd | t|d
 tjddd | t|d tjddd dS )z1Checking reads with only a start value in a slicerV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test01b_start...r   r=   r  zNrows inrW   zSecond row in vlarray ==>r2   r3   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   rG   r\   rR   rO   r^   r]   r   r   r  )r'   rJ   r_   r   r   r   r!  ?  s$    

z"GetItemRangeTestCase.test01b_startc          	   C   s|  t jr tdd td| jj  | jjj}d|_g }|	|dd  |	|dd  |	|dd  t jrtd	|j
d
|j td|d  td|d  | |j| j | t|d d | t|d d | t|d d | t|d d tjddd x4tdD ](}| t|d | tj|dd qW x4tdD ](}| t|d | tj|dd qLW dS )z%Checking reads with only a stop valuerV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test02_stop...r   Nr2   r=   r  zNrows inrW   zFirst row in vlarray ==>r   zSecond row in vlarray ==>r3   r6   )r7   )r   rX   rY   r(   r   r"   r#   rJ   r$  rG   r\   rR   rO   r^   r]   r   r   r  r   )r'   rJ   r_   r%  r   r   r   r&  Y  s0    

"z GetItemRangeTestCase.test02_stopc          	   C   s  t jr tdd td| jj  | jjj}d|_g }|	|dd  |	|dd  |	|dd  t jrtd	|j
d
|j td|d  | |j| j | t|d d | t|d d | t|d d x2tdD ]&}| t|d | tjddd qW x4tdD ](}| t|d | tj|dd qW x4tdD ](}| t|d | tj|dd qPW dS )z0Checking reads with only a stop value in a slicerV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test02b_stop...r   Nr2   r=   r  zNrows inrW   zSecond row in vlarray ==>r   r3   r6   )r7   )r   rX   rY   r(   r   r"   r#   rJ   r$  rG   r\   rR   rO   r^   r   r]   r   r   r  )r'   rJ   r_   r%  r   r   r   r'  {  s2    

z!GetItemRangeTestCase.test02b_stopc          	   C   s  t jr tdd td| jj  | jjj}d|_g }|	|dd  |	|dd  |	|dd	  t jrtd
|j
d|j td|d  | |j| j | t|d d | t|d d | t|d d	 x4tddD ]&}| t|d | tj|dd qW x:tddD ],}| t|d |d  tj|dd qW x6tdd	D ](}| t|d | tj|dd qZW dS )z+Checking reads with a start and stop valuesrV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test03_startstop...r   r   r=   r5   r(  r  zNrows inrW   zSecond row in vlarray ==>r2   r3   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   r$  rG   r\   rR   rO   r^   r   r]   r   r   r  )r'   rJ   r_   r%  r   r   r   r)    s2    

(z%GetItemRangeTestCase.test03_startstopc          	   C   s  t jr tdd td| jj  | jjj}d|_g }|	|dd  |	|dd  |	|d	d	  t jrtd
|j
d|j td|d  | |j| j | t|d d | t|d d | t|d d x4tddD ]&}| t|d | tj|dd qW x:tddD ],}| t|d |d  tj|dd qW x6tddD ](}| t|d | tj|dd qZW d	S )z5Checking reads with a start and stop values in slicesrV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test03b_startstop...r   r   r=   r5   r(  NzNrows inrW   zSecond row in vlarray ==>r2   r3   r  r6   )r7   )r   rX   rY   r(   r   r"   r#   rJ   r$  rG   r\   rR   rO   r^   r   r]   r   r   r  )r'   rJ   r_   r%  r   r   r   r*    s2    

(z&GetItemRangeTestCase.test03b_startstopc          	   C   s  t jr tdd td| jj  | jjj}d|_g }|	|ddd  |	|dd	d  |	|dd
d  t jrtd|j
d|j td|d  | |j| j | t|d d | t|d d | t|d d x:tdddD ]*}| t|d |d  tj|dd qW x@tdd	dD ]0}| t|d |d d  tj|dd q,W x<tdd
dD ],}| t|d |d  tj|dd qnW dS )z/Checking reads with a start, stop & step valuesrV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test04_slices...r   r   r=   r3   r5   r(  r  r+  zNrows inrW   zSecond row in vlarray ==>r2   r4   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   r$  rG   r\   rR   rO   r^   r]   r   r   r   r  )r'   rJ   r_   r%  r   r   r   test04_slices  s2    

&,z"GetItemRangeTestCase.test04_slicesc          	   C   s  t jr tdd td| jj  | jjj}d|_g }|	|t
dt
dt
d  |	|t
dt
d	t
d  |	|t
dt
d
t
d  t jrtd|jd|j td|d  | |j| j | t|d d | t|d d | t|d d x<tdddD ],}| t|d |d  t
j|dd q&W x@tdd	dD ]0}| t|d |d d  t
j|dd qdW x<tdd
dD ],}| t|d |d  t
j|dd qW dS )z=Checking reads with start, stop & step values (numpy indices)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test04np_slices...r   r   r=   r3   r5   r(  r  r+  zNrows inrW   zSecond row in vlarray ==>r2   r4   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   r$  rG   r   r   r\   rR   rO   r^   r   r]   r   r  )r'   rJ   r_   r%  r   r   r   r/    s2    

&&&(,z%GetItemRangeTestCase.test04bnp_slicesc          	   C   sn   t jr tdd td| jj  | jjj}t jrBtd|jd|j	 | 
t |d }td| W dQ R X dS )	zChecking out of range readsrV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z!Running %s.test05_out_of_range...zNrows inrW   i  zrow-->N)r   rX   rY   r(   r   r"   r#   rJ   r\   rR   r   r0  )r'   rJ   r_   r   r   r   r1  *  s    

z(GetItemRangeTestCase.test05_out_of_rangec          	   C   st   t jr tdd td| jj  | jjj}t jrBtd|jd|j	 | 
t |td }td| W dQ R X dS )	z+Checking out of range reads (numpy indexes)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z#Running %s.test05np_out_of_range...zNrows inrW   i  zrow-->N)r   rX   rY   r(   r   r"   r#   rJ   r\   rR   r   r0  r   r6   )r'   rJ   r_   r   r   r   test05np_out_of_range;  s    

z*GetItemRangeTestCase.test05np_out_of_range)r   r   r   rR   r   rD   r*   r!   r%   r   r!  r&  r'  r)  r*  r3  r/  r1  r4  rr   r   r   )r(   r   r2    s    "#####r2  c                   st   e Zd ZdZdZdZdZ fddZdd Zd	d
 Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Z  ZS )SetRangeTestCaser  r   r   r   c                s0   t t|   | jj| _|   | jdd d S )Nrm   )r   )r    r5  r!   r"   r#   r$   r%   r   )r'   )r(   r   r   r!   S  s    
zSetRangeTestCase.setUpc             C   s\   | j }tj| j| jd}| jj|dt d|dd}x$t| j	D ]}|
tt| q>W d S )N)r)   r*   rJ   zragged array if intsi  )r0   r1   )r$   rB   rC   rD   r*   r"   rE   r	   r   rR   rG   r   )r'   rI   r0   rJ   ri   r   r   r   r%   Y  s    
zSetRangeTestCase.populateFilec             C   s  t jr tdd td| jj  | jjj}|d d d |d< |d d d |d< |d d d |d< g }||	dd  ||	dd  ||	dd  t jrtd	|j
d
|j td|d  | |j| j | t|d d | t|d d | t|d d | t|d tjdddd d  | t|d tjdddd d  | t|d tjdddd d  dS )z-Checking updates that modifies a complete rowrV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test01_start...r   r3   r   r=   r  zNrows inrW   zSecond row in vlarray ==>r2   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   rG   r[   r\   rR   rO   r^   r]   r   r   r  )r'   rJ   r_   r   r   r   r   f  s0    

""zSetRangeTestCase.test01_startc             C   s  t jr tdd td| jj  | jjj}|t	d d d |t
d< |t
d d d |t
d< |td d d |td< g }||t
dd  ||t
dd  ||t
dd  t jrtd	|jd
|j td|d  | |j| j | t|d d | t|d d | t|d d | t|d tjdddd d  | t|d tjdddd d  | t|d tjdddd d  dS )z-Checking updates that modifies a complete rowrV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test01np_start...r   r3   r   r=   r  zNrows inrW   zSecond row in vlarray ==>r2   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   r   r   r   r   r6   rG   r[   r\   rR   rO   r^   r]   r   r  )r'   rJ   r_   r   r   r   r"    s0    

   ""zSetRangeTestCase.test01np_startc             C   s  t jr tdd td| jj  | jjj}|d d d |d< |d d d |d< |d dd	 d d |d
< g }||	dd  ||	dd  ||	d
d  t jrtd|j
d|j td|d  | |j| j | t|d d | t|d d | t|d d
 | t|d tjdddd d  | t|d tjdddd d  tjdddd}|d d }| t|d | d	S )z*Checking updates with only a part of a rowrV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test02_partial...r   r3   r   r=   r  N`   zNrows inrW   zSecond row in vlarray ==>r2   r6   )r7   )r   rX   rY   r(   r   r"   r#   rJ   rG   r[   r\   rR   rO   r^   r]   r   r   r  )r'   rJ   r_   rm   r   r   r   test02_partial  s2    

""zSetRangeTestCase.test02_partialc             C   s  t jr tdd td| jj  | jjj}|d d d |d d d |d d d f|dd< g }||	dd	  ||	dd	  ||	dd	  t jrtd
|j
d|j td|d  | |j| j | t|d	 d | t|d d | t|d d | t|d	 tjdddd d  | t|d tjdddd d  | t|d tjdddd d  dS )z4Checking updating several rows at once (slice style)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z"Running %s.test03a_several_rows...r   r3   r4   r5   r9   r   zNrows inrW   zSecond row in vlarray ==>r2   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   rG   r[   r\   rR   rO   r^   r]   r   r   r  )r'   rJ   r_   r   r   r   test03a_several_rows  s,    

&&z%SetRangeTestCase.test03a_several_rowsc             C   s  t jr tdd td| jj  | jjj}|d d d |d d d |d d d f|dddg< g }||	dd  ||	dd  ||	dd  t jrtd	|j
d
|j td|d  | |j| j | t|d d | t|d d | t|d d | t|d tjdddd d  | t|d tjdddd d  | t|d tjdddd d  dS )z3Checking updating several rows at once (list style)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z"Running %s.test03b_several_rows...r   r3   r   r=   r6  zNrows inrW   zSecond row in vlarray ==>r2   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   rG   r[   r\   rR   rO   r^   r]   r   r   r  )r'   rJ   r_   r   r   r   test03b_several_rows  s2    

""z%SetRangeTestCase.test03b_several_rowsc             C   s  t jr tdd td| jj  | jjj}|d d d |d d d |d d d f|t	dddgf< g }|
|dd  |
|dd  |
|dd  t jrtd	|jd
|j td|d  | |j| j | t|d d | t|d d | t|d d | t|d tjdddd d  | t|d tjdddd d  | t|d tjdddd d  dS )z<Checking updating several rows at once (NumPy's where style)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z"Running %s.test03c_several_rows...r   r3   r   r=   r6  zNrows inrW   zSecond row in vlarray ==>r2   r6   )r7   N)r   rX   rY   r(   r   r"   r#   rJ   r   rH   rG   r[   r\   rR   rO   r^   r]   r   r  )r'   rJ   r_   r   r   r   test03c_several_rows  s2    

$""z%SetRangeTestCase.test03c_several_rowsc          	   C   sf   t jr tdd td| jj  | jjj}t jrBtd|jd|j	 | 
t dg|d< W dQ R X dS )	z+Checking out of range updates (first index)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z!Running %s.test04_out_of_range...zNrows inrW   r2   i  N)r   rX   rY   r(   r   r"   r#   rJ   r\   rR   r   r0  )r'   rJ   r   r   r   test04_out_of_range3  s    

z$SetRangeTestCase.test04_out_of_rangec          	   C   sj   t jr tdd td| jj  | jjj}t jrBtd|jd|j	 | 
t dgd |d< W d	Q R X d	S )
zChecking out value errorsrV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=z Running %s.test05_value_error...zNrows inrW   r2   r  r=   N)r   rX   rY   r(   r   r"   r#   rJ   r\   rR   r   r   )r'   rJ   r   r   r   test05_value_errorC  s    

z#SetRangeTestCase.test05_value_error)r   r   r   rR   r   rD   r*   r!   r%   r   r"  r7  r8  r9  r:  r;  r<  rr   r   r   )r(   r   r5  M  s   ""# ##r5  c               @   sH   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d Zdd Z	dd Z
dS )CopyTestCaseTc             C   s  t jr tdd td| jj  tdd}| j| jjd|d}d|_	|
dd	gg |
d
 |
d	dgddgg | jrt jrtd | jdd | jjj}|dd}| jrt jrtd |   | jjj}| jjj}t jrDtdt| tdt| tdt|  tdt|  tdt|j tdt|j | | |  | |j|j | |j|j | |j	|j	 | |jj|jj | t|jt|j | |j|j dS )zChecking VLArray.copy() method.rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test01a_copy...r3   )rP   array1ztitle array1r8   r   r   i  r4   z(closing file version)rm   )r   r   array2z	array1-->z	array2-->zarray1[:]-->zarray2[:]-->zattrs array1-->zattrs array2-->N)r   rX   rY   r(   r   r   r"   rE   r#   rF   rG   r&   r   r>  copyr?  r   r[   attrsrO   rR   rP   r.   r7   r/   )r'   arrr>  r?  r   r   r   test01a_copyV  sH    





zCopyTestCase.test01a_copyc             C   s  t jr tdd td| jj  t }| j| jjd|d}d|_	|
d |
d |
d	 | jrt jrttd
 | jdd | jjj}|dd}| jrt jrtd
 |   | jjj}| jjj}t jr.tdt| tdt| tdt|  tdt|  tdt|j tdt|j | | |  | |j|j | |j|j | |j	|j	 | |jj|jj | t|jt|j | |j|j dS )z1Checking VLArray.copy() method (Pseudo-atom case)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test01b_copy...r>  ztitle array1r8   s   a stringr   s   another stringz(closing file version)rm   )r   r   r?  z	array1-->z	array2-->zarray1[:]-->zarray2[:]-->zattrs array1-->zattrs array2-->N)r   rX   rY   r(   r   r   r"   rE   r#   rF   rG   r&   r   r>  r@  r?  r   r[   rA  rO   rR   rP   r.   rS   r/   )r'   rB  r>  r?  r   r   r   test01b_copy  sH    






zCopyTestCase.test01b_copyc             C   s  t jr tdd td| jj  tdd}| j| jjd|d}d|_	|
dd	gg |
d
 |
d	dgddgg | jrt jrtd | jdd | jjj}| jdd}||d}| jrt jrtd |   | jjj}| jjjj}t jrLtdt| tdt| td|  td|  tdt|j tdt|j | | |  | |j|j | |j|j | |j	|j	 | |jj|jj | t|jt|j | |j|j dS )z0Checking VLArray.copy() method (where specified)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test02_copy...r3   )rP   r>  ztitle array1r8   r   r   i  r4   z(closing file version)rm   )r   r   group1r?  z	array1-->z	array2-->zattrs array1-->zattrs array2-->N)r   rX   rY   r(   r   r   r"   rE   r#   rF   rG   r&   r   r>  Zcreate_groupr@  rE  r?  r   r[   rA  rO   rR   rP   r.   r7   r/   )r'   rB  r>  rE  r?  r   r   r   test02_copy  sJ    




zCopyTestCase.test02_copyc             C   sb  t jr tdd td| jj  tdd}| jj| jjd|dd}d	|_	|
d
 |
d |
d | jrt jrztd | jdd | jjj}|dd}| jrt jrtd |   | jjj}| jjj}t jrtdt|j tdt|j | |j|j | |j|j | |j	|j	 | |jj|jj | t|jt|j | |j|j dS )z0Checking VLArray.copy() method ('python' flavor)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test03_copy...r3   )rP   r>  ztitle array1)r/   r8   ))r3   r   r   ))r   i  )r3   r4   z(closing file version)rm   )r   r   r?  zattrs array1-->zattrs array2-->N)r   rX   rY   r(   r   r   r"   rE   r#   rF   rG   r&   r   r>  r@  r?  r   rA  rO   rR   rP   r.   r7   r/   )r'   r.   r>  r?  r   r   r   test03_copy  s>    







zCopyTestCase.test03_copyc             C   s   t jr tdd td| jj  tdd}| jj| jjd|dd}|	d	 |	d
 |	d d|j
_d|j
_| jrt jrtd | jdd | jjj}|jdddd}| jrt jrtd |   | jjj}| jjj}t jrtd|j | |jd dS )z7Checking VLArray.copy() method (checking title copying)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test04_copy...r3   )rP   r>  ztitle array1)r.   r/   ))r3   r   r   ))r   i  )r3   r4   attr1z(closing file version)rm   )r   r   r?  ztitle array2)r/   ztitle of destination array-->N)r   rX   rY   r(   r   r   r"   rE   r#   rG   rA  rH  attr2r&   r   r>  r@  r?  r/   rO   )r'   r.   r>  r?  r   r   r   test04_copy  s4    







zCopyTestCase.test04_copyc             C   s&  t jr tdd td| jj  tdd}| jj| jjd|dd}|	d	 |	d
 |	d d|j
_d|j
_| jrt jrtd | jdd | jjj}|jdddd}| jrt jrtd |   | jjj}| jjj}t jrtdt|j
 tdt|j
 | |j
jd | |j
jd dS )z7Checking VLArray.copy() method (user attributes copied)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test05_copy...r3   )rP   r>  ztitle array1)r.   r/   ))r3   r   r   ))r   i  )r3   r4   rH  z(closing file version)rm   )r   r   r?  r2   )copyuserattrszattrs array1-->zattrs array2-->N)r   rX   rY   r(   r   r   r"   rE   r#   rG   rA  rH  rI  r&   r   r>  r@  r?  r   rO   )r'   r.   r>  r?  r   r   r   test05_copyF  s8    







zCopyTestCase.test05_copyc             C   s&  t jr tdd td| jj  tdd}| jj| jjd|dd}|	d	 |	d
 |	d d|j
_d|j
_| jrt jrtd | jdd | jjj}|jdddd}| jrt jrtd |   | jjj}| jjj}t jrtdt|j
 tdt|j
 | |j
jd | |j
jd dS )z;Checking VLArray.copy() method (user attributes not copied)rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test05b_copy...r3   )rP   r>  ztitle array1)r.   r/   ))r3   r   r   ))r   i  )r3   r4   rH  z(closing file version)rm   )r   r   r?  r   )rK  zattrs array1-->zattrs array2-->N)r   rX   rY   r(   r   r   r"   rE   r#   rG   rA  rH  rI  r&   r   r>  r@  r?  r   rO   )r'   r.   r>  r?  r   r   r   notest05b_copyq  s8    







zCopyTestCase.notest05b_copyN)r   r   r   r&   rC  rD  rF  rG  rJ  rL  rM  r   r   r   r   r=  S  s   444,(+r=  c               @   s   e Zd ZdZdS )CloseCopyTestCaser2   N)r   r   r   r&   r   r   r   r   rN    s   rN  c               @   s   e Zd ZdZdS )OpenCopyTestCaser   N)r   r   r   r&   r   r   r   r   rO    s   rO  c               @   s   e Zd Zdd ZdS )CopyIndexTestCasec             C   sb  t jr tdd td| jj  tdd}| j| jjd|d}d|_	g }x6t
d	D ]*}|||d
 gg |||d
 g qTW | jrt jrtd | jdd | jjj}|jdd| j| j| jd}|| j| j| j }t jr8td| td|dd  tdt|j tdt|j td|j tdt| | ||dd  | t||j dS )z,Checking VLArray.copy() method with indexes.rV   z<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=zRunning %s.test01_index...)r3   )rP   r>  zt array1r8   r+  r2   z(closing file version)rm   )r   r   r?  )startr#  stepzr2-->z	array2-->Nzattrs array1-->zattrs array2-->znrows in array2-->zand it should be-->)r   rX   rY   r(   r   r	   r"   rE   r#   rF   r   rG   r&   r   r>  r@  rQ  r#  rR  r   rA  rR   r^   rO   )r'   r.   r>  rK   r_   r?  Zr2r   r   r   test01_index  s<    




zCopyIndexTestCase.test01_indexN)r   r   r   rS  r   r   r   r   rP    s   rP  c               @   s   e Zd ZdZdZdZdZdS )CopyIndex1TestCaser   r:   r2   N)r   r   r   r&   rQ  r#  rR  r   r   r   r   rT    s   rT  c               @   s   e Zd ZdZdZdZdZdS )CopyIndex2TestCaser2   r   rn   N)r   r   r   r&   rQ  r#  rR  r   r   r   r   rU    s   rU  c               @   s   e Zd ZdZdZdZdZdS )CopyIndex3TestCaser   r2   r:   N)r   r   r   r&   rQ  r#  rR  r   r   r   r   rV    s   rV  c               @   s   e Zd ZdZdZdZdZdS )CopyIndex4TestCaser2   r   r9   N)r   r   r   r&   rQ  r#  rR  r   r   r   r   rW    s   rW  c               @   s   e Zd ZdZdZdZdZdS )CopyIndex5TestCaser   r   r:   r2   N)r   r   r   r&   rQ  r#  rR  r   r   r   r   rX    s   rX  c               @   s   e Zd ZdZdZdZdZdS )CopyIndex6TestCaser2   r   r9   r3   N)r   r   r   r&   rQ  r#  rR  r   r   r   r   rY    s   rY  c               @   s   e Zd ZdZdZdZdZdS )CopyIndex7TestCaser   r:   r=   N)r   r   r   r&   rQ  r#  rR  r   r   r   r   rZ     s   rZ  c               @   s   e Zd ZdZdZdZdZdS )CopyIndex8TestCaser2   r9   rn   N)r   r   r   r&   rQ  r#  rR  r   r   r   r   r[    s   r[  c               @   s   e Zd ZdZdZdZdZdS )CopyIndex9TestCaser   r   r4   r2   N)r   r   r   r&   rQ  r#  rR  r   r   r   r   r\    s   r\  c               @   s   e Zd ZdZdZdZdZdS )CopyIndex10TestCaser2   r   r4   r3   N)r   r   r   r&   rQ  r#  rR  r   r   r   r   r]    s   r]  c               @   s   e Zd ZdZdZdZdZdS )CopyIndex11TestCaser   rn   r3   N)r   r   r   r&   rQ  r#  rR  r   r   r   r   r^    s   r^  c               @   s   e Zd ZdZdZdZdZdS )CopyIndex12TestCaser2   rn   N)r   r   r   r&   rQ  r#  rR  r   r   r   r   r`  #  s   r`  c                   s,   e Zd Z fddZdd Zdd Z  ZS )ChunkshapeTestCasec                s2   t t|   tdd}| jjdd|ddd d S )N)r3   )rP   r   rJ   zt array1r@   )r.   r/   
chunkshape)r    ra  r!   r	   r"   rE   )r'   r.   )r(   r   r   r!   ,  s
    
zChunkshapeTestCase.setUpc             C   s.   | j jj}tjrtd|j | |jd dS )z3Test setting the chunkshape in a table (no reopen).zchunkshape-->)r@   N)r"   r#   rJ   r   rX   rY   rb  rO   )r'   vlar   r   r   test003  s    
zChunkshapeTestCase.test00c             C   sH   | j   t| jd| _ | j jj}tjr6t	d|j
 | |j
d dS )z0Test setting the chunkshape in a table (reopen).rK   zchunkshape-->)r@   N)r"   r&   rB   rL   rM   r#   rJ   r   rX   rY   rb  rO   )r'   rc  r   r   r   test01;  s    

zChunkshapeTestCase.test01)r   r   r   r!   rd  re  rr   r   r   )r(   r   ra  *  s   ra  c                   s0   e Zd Z fddZ fddZdd Z  ZS )VLUEndianTestCasec                s*   t t|   td| _t| j| _d S )Nzvlunicode_endian.h5)r    rf  r!   r   rM   rB   rL   r"   )r'   )r(   r   r   r!   G  s    
zVLUEndianTestCase.setUpc                s   | j   tt|   d S )N)r"   r&   r    rf  tearDown)r'   )r(   r   r   rg  L  s    
zVLUEndianTestCase.tearDownc             C   s8   | j jjd }| j jjd }| |d | |d dS )z7Accessing ``vlunicode`` data of a different endianness.r   u	   paraŀlelN)r"   r#   Zvlunicode_bigZvlunicode_littlerO   )r'   ZbedataZledatar   r   r   testP  s    zVLUEndianTestCase.test)r   r   r   r!   rg  rh  rr   r   r   )r(   r   rf  F  s   rf  c                   s<   e Zd Z fddZdd Zdd Zdd Zd	d
 Z  ZS )TruncateTestCasec                s`   t t|   tdd}| j| jjd|d}|tj	ddgdd |tj	dgdd d S )	Nr   )Zdfltr>  ztitle array1i  r3   r   )r7   )
r    ri  r!   r   r"   rE   r#   rG   r   rH   )r'   rB  r>  )r(   r   r   r!   [  s    
zTruncateTestCase.setUpc             C   st   | j jj}|d | jr:tjr(td |   | j jj}tjrNtd|	  | 
|jd | 
|dd g  dS )z9Checking VLArray.truncate() method (truncating to 0 rows)r   z(closing file version)z	array1-->N)r"   r#   r>  truncater&   r   rX   rY   r   r[   rO   rR   )r'   r>  r   r   r   test00_truncateg  s    


z TruncateTestCase.test00_truncatec             C   s   | j jj}|d | jr:tjr(td |   | j jj}tjrNtd|	  | 
|jd | t|d tjddgdd d	S )
z9Checking VLArray.truncate() method (truncating to 1 rows)r2   z(closing file version)z	array1-->r   i  r3   r   )r7   N)r"   r#   r>  rj  r&   r   rX   rY   r   r[   rO   rR   r]   r   r   rH   )r'   r>  r   r   r   test01_truncatez  s    


z TruncateTestCase.test01_truncatec             C   s   | j jj}|d | jr:tjr(td |   | j jj}tjrNtd|	  | 
|jd | t|d tjddgdd | t|d tjd	gdd d
S )z@Checking VLArray.truncate() method (truncating to == self.nrows)r3   z(closing file version)z	array1-->r   i  r   )r7   r2   r   N)r"   r#   r>  rj  r&   r   rX   rY   r   r[   rO   rR   r]   r   r   rH   )r'   r>  r   r   r   test02_truncate  s    


z TruncateTestCase.test02_truncatec             C   s   | j jj}|d | jr:tjr(td |   | j jj}tjrNtd|	  | 
|jd | t|d tjddgdd | t|d	 tjd
gdd | t|d tjg dd | t|d
 tjg dd dS )z?Checking VLArray.truncate() method (truncating to > self.nrows)r4   z(closing file version)z	array1-->r   i  r3   r   )r7   r2   r   N)r"   r#   r>  rj  r&   r   rX   rY   r   r[   rO   rR   r]   r   r   rH   )r'   r>  r   r   r   test03_truncate  s    


 z TruncateTestCase.test03_truncate)	r   r   r   r!   rk  rl  rm  rn  rr   r   r   )r(   r   ri  Y  s
   ri  c               @   s   e Zd ZdZdS )TruncateOpenTestCaser   N)r   r   r   r&   r   r   r   r   ro    s   ro  c               @   s   e Zd ZdZdS )TruncateCloseTestCaser2   N)r   r   r   r&   r   r   r   r   rp    s   rp  c                   s,   e Zd Z fddZdd Zdd Z  ZS )PointSelectionTestCasec                s   t t|   g dgddgddgddgftjg ddtjdgddtdddgg| _ddd	gdddgfg| _tjd
dgdd}tjd
ddgdd}tjd
dddgdd}tj|||gdd| _| j	| jj
dt | _| j| | j| | j| d S )Nr3   r   r   )r7   r2   TFr  r5   r9   r:   r<   r;   rk   rJ   )r    rq  r!   r   rH   working_keysetnot_working_keysetnparrr"   rE   r#   r	   vlarrrG   )r'   r  r  r  )r(   r   r   r!     s(    zPointSelectionTestCase.setUpc             C   s^   | j }| j}xL| jD ]B}tjr,tdt| ||  }|| }| t|t|d qW dS )z/Test for point-selections (read, boolean keys).zSelection to test:z3NumPy array and PyTables selections does not match.N)	ru  rv  rs  r   rX   rY   r   tolistrO   )r'   ru  rv  keyrm   r   r   r   r   test01a_read  s    z#PointSelectionTestCase.test01a_readc             C   s:   | j }x.| jD ]$}tjr"td| | t|j| qW dS )z9Test for point-selections (not working selections, read).zSelection to test:N)rv  rt  r   rX   rY   r   r0  __getitem__)r'   rv  rx  r   r   r   test01b_read  s
    
z#PointSelectionTestCase.test01b_read)r   r   r   r!   ry  r{  rr   r   r   )r(   r   rq    s   "rq  c               @   sD   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dS )SizeInMemoryPropertyTestCasec             C   s(   t j|dd}| jjdd||d| _d S )Nrw   )r)   r*   r   rJ   )r.   r0   )rB   rC   r"   rE   rH   )r'   r.   r)   r0   r   r   r   create_array  s    z)SizeInMemoryPropertyTestCase.create_arrayc             C   s*   t  }d}| || | | jjd d S )Nr   )r	   r}  rO   rH   size_in_memory)r'   r.   r)   r   r   r   test_zero_length  s    z-SizeInMemoryPropertyTestCase.test_zero_lengthc             C   s`   t  }| || || j_d}x<tdD ]0}tj|d d dd}| j| ||j7 }q(W |S )Nr   r=   r2   r   )r7   )	r	   r}  rH   rF   r   r   r  rG   nbytes)r'   r)   rF   r.   expected_sizeri   r_   r   r   r   	int_tests  s    z&SizeInMemoryPropertyTestCase.int_testsc             C   s(   d}d}|  ||}| | jj| d S )Nr   r   )r  rO   rH   r~  )r'   r)   rF   r  r   r   r   test_numpy_int_numpy_flavor  s    z8SizeInMemoryPropertyTestCase.test_numpy_int_numpy_flavorc             C   s(   d}d}|  ||}| | jj| d S )Nr2   r   )r  rO   rH   r~  )r'   r)   rF   r  r   r   r   &test_numpy_int_numpy_flavor_compressed$  s    zCSizeInMemoryPropertyTestCase.test_numpy_int_numpy_flavor_compressedc             C   s(   d}d}|  ||}| | jj| d S )Nr   r8   )r  rO   rH   r~  )r'   r)   rF   r  r   r   r   test_numpy_int_python_flavor+  s    z9SizeInMemoryPropertyTestCase.test_numpy_int_python_flavorc             C   sf   t  }d}| || dddg}xtdD ]}| j| q*W ||}d|j }| | jj| d S )Nr   r2   r3   r   r=   )	r
   r}  r   rH   rG   Ztoarrayr  rO   r~  )r'   r.   r)   rT   ri   Zpickle_arrayr  r   r   r   test_object_atom3  s    


z-SizeInMemoryPropertyTestCase.test_object_atomN)
r   r   r   r}  r  r  r  r  r  r  r   r   r   r   r|    s   r|  c               @   s   e Zd Zdd Zdd ZdS )SizeOnDiskPropertyTestCasec             C   s6   t j|dd}| jjdd||d | jdd| _d S )Nrw   )r)   r*   r   rJ   )r0   )rB   rC   r"   rE   rN   rH   )r'   r.   r)   r0   r   r   r   r}  @  s    z'SizeOnDiskPropertyTestCase.create_arrayc             C   s,   t  }d}| || | tt| jd d S )Nr   Zsize_on_disk)r   r}  r   NotImplementedErrorgetattrrH   )r'   r.   r)   r   r   r   test_not_implementedE  s
    z/SizeOnDiskPropertyTestCase.test_not_implementedN)r   r   r   r}  r  r   r   r   r   r  ?  s   r  c                   s<   e Zd Z fddZdd Zdd Zdd Zd	d
 Z  ZS )AccessClosedTestCasec                sL   t t|   | jj| jjdtdd| _| jdd t	dddD  d S )	NrH   r;   )r.   c             S   s   g | ]}t |qS r   )r  ).0ri   r   r   r   
<listcomp>R  s    z.AccessClosedTestCase.setUp.<locals>.<listcomp>r5   i  r  )
r    r  r!   r"   rE   r#   r   rH   rG   r   )r'   )r(   r   r   r!   N  s    zAccessClosedTestCase.setUpc             C   s    | j   | tj| jj d S )N)r"   r&   r   rB   ClosedNodeErrorrH   r[   )r'   r   r   r   	test_readT  s    
zAccessClosedTestCase.test_readc             C   s"   | j   | tj| jjd d S )Nr   )r"   r&   r   rB   r  rH   rz  )r'   r   r   r   test_getitemY  s    
z!AccessClosedTestCase.test_getitemc             C   s$   | j   | tj| jjdd d S )Nr   0)r"   r&   r   rB   r  rH   r   )r'   r   r   r   test_setitem^  s    
z!AccessClosedTestCase.test_setitemc             C   s"   | j   | tj| jjd d S )NZ	xxxxxxxxx)r"   r&   r   rB   r  rH   rG   )r'   r   r   r   test_appendc  s    
z AccessClosedTestCase.test_append)	r   r   r   r!   r  r  r  r  rr   r   r   )r(   r   r  M  s
   r  c               @   s   e Zd ZedddgZdZdZe	ej
ZdZdZdZdZdZdZd	d
 Zdd Zdd Zdd Zdd Zdd Zdd Zdd ZdS )TestCreateVLArrayArgsr2   r3   r   r   rJ   r/   NFc             C   s   | j | j| j| j| j| j| j | j   t	
| j| _ | j | j| j}| |j| j | |jd | |jd | |j| j | |jj| jj d S )N)r   r   )r"   rE   wherer   r.   r/   r0   r1   r&   rB   rL   rM   rN   rO   rP   rR   r7   )r'   ptarrr   r   r   test_positional_args_01u  s    
z-TestCreateVLArrayArgs.test_positional_args_01c             C   s   | j | j| j| j| j| j| j}|| j	 | j 
  t| j| _ | j | j| j}| d }| |j| j | |jd | |d j| j	j | |jd | |j| j | |jj| jj | t| j	| d S )Nr   )r2   r2   )r"   rE   r  r   r.   r/   r0   r1   rG   rT   r&   rB   rL   rM   rN   r[   rO   rP   rR   r7   r]   r   )r'   r  ru  r   r   r   test_positional_args_02  s"    
z-TestCreateVLArrayArgs.test_positional_args_02c             C   s   | j | j| jd | j| j| j| j| j| j	| j

 | j   t| j| _ | j | j| j}| d }| |j| j | |jd | |d j| j
j | |jd | |j| j | |jj| jj | t| j
| d S )Nr   )r2   r2   )r"   rE   r  r   r/   r0   r1   rb  r   createparentsrT   r&   rB   rL   rM   rN   r[   rO   rP   rR   r.   r7   r]   r   )r'   r  ru  r   r   r   test_positional_args_obj  s(    
z.TestCreateVLArrayArgs.test_positional_args_objc             C   s   | j j| j| j| j| jd | j   t| j	| _ | j 
| j| j}| d }| |j| j | |jd | |d j| jj | |jd | |j| j | |jj| jj | t| j| d S )N)r/   rT   r   )r2   r2   )r"   rE   r  r   r/   rT   r&   rB   rL   rM   rN   r[   rO   rP   rR   r.   r7   r]   r   )r'   r  ru  r   r   r   test_kwargs_obj  s    

z%TestCreateVLArrayArgs.test_kwargs_objc             C   s   | j j| j| j| j| jd}|| j | j   t	
| j| _ | j | j| j}| d }| |j| j | |jd | |d j| jj | |jd | |j| j | |jj| jj | t| j| d S )N)r/   r.   r   )r2   r2   )r"   rE   r  r   r/   r.   rG   rT   r&   rB   rL   rM   rN   r[   rO   rP   rR   r7   r]   r   )r'   r  ru  r   r   r   test_kwargs_atom_01  s    

z)TestCreateVLArrayArgs.test_kwargs_atom_01c             C   s   | j j| j| j| j| jd}| j   t| j	| _ | j 
| j| j}| |j| j | |jd | |jd | |j| j | |jj| jj d S )N)r/   r.   )r   r   )r"   rE   r  r   r/   r.   r&   rB   rL   rM   rN   rO   rP   rR   r7   )r'   r  r   r   r   test_kwargs_atom_02  s    

z)TestCreateVLArrayArgs.test_kwargs_atom_02c             C   s   | j j| j| j| j| j| jd}| j   t	| j
| _ | j | j| j}| d }| |j| j | |jd | |d j| jj | |jd | |j| j | |jj| jj | t| j| d S )N)r/   rT   r.   r   )r2   r2   )r"   rE   r  r   r/   rT   r.   r&   rB   rL   rM   rN   r[   rO   rP   rR   r7   r]   r   )r'   r  ru  r   r   r   test_kwargs_obj_atom  s    

z*TestCreateVLArrayArgs.test_kwargs_obj_atomc          	   C   s8   t td}| jt| jj| j| j	| j
| j|d d S )Ncomplex)r/   rT   r.   )r   
from_dtyper   r7   r   r   r"   rE   r  r   r/   rT   )r'   r.   r   r   r   test_kwargs_obj_atom_error  s    z0TestCreateVLArrayArgs.test_kwargs_obj_atom_error)r   r   r   r   rH   rT   r  r   r   r  r7   r.   r/   r0   r1   rb  r   r  r  r  r  r  r  r  r  r  r   r   r   r   r  i  s$   r  c              C   sF  t  } d}x2t|D ]$}| t t | t t | t t | t t | t t	 | t t
 | t t | t t | t t | t t | t t | t t | t t | t t | t t | t t | t t | t t | t t | t t | t t | t t | t t | t t | t t | t t | t t | t t  | t t! | t t" | t t# | t t$ | t t% | t t& | t t' | t t( | t t) | t t* | t t+ | t t, | t t- | t t. | t t/ | t t0 | t t1 | t t2 | t t3 | t t4 | t t5 | t t6 qW | S )Nr2   )7r   Z	TestSuiter   ZaddTestZ	makeSuiters   rt   ru   rv   rx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r  r  r  r  r  r  r2  r5  r   r   r   rN  rO  rT  rU  rV  rW  rX  rY  rZ  r[  r\  r]  r^  r`  ra  rf  ro  rp  rq  r|  r  r  r  )ZtheSuiteZniternr   r   r   suite  sl    r  __main__)ZdefaultTest)gZ
__future__r   r   r   r   Znumpy.testingZtestingr   rB   r   r   r   r   r   r	   r
   r   r   Ztables.testsr   Ztables.tests.commonr   r   r   r   r   ZTestCaseZtables.utilsr   Z	six.movesr   r   ZTempFileMixinr   rs   rt   ru   ZskipIfZblosc_availrv   rx   Zmin_blosc_bitshuffle_versionry   rz   Zblosc_compressor_listr{   r|   r}   r~   r   Z	lzo_availr   Zbzip2_availr   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r  r2  r5  r=  rN  rO  rP  rT  rU  rV  rW  rX  rY  rZ  r[  r\  r]  r^  r`  ra  rf  ri  ro  rp  rq  r|  r  r  r  r  r   Z
parse_argvargvZprint_versionsmainr   r   r   r   <module>   s  , i















         A  O ,  +     I    L1f?9 ;
