
    utf"                    	   d Z ddlZddlZddlZddlZddlZddlZddlZddl	m
Z
mZ ddlmZ ddlmZmZmZ ddlmZmZ ddlmZmZ dd	lmZ dd
lmZ ddlZddlmc mZ  G d de      Z G d de      Z G d de      Z  G d de      Z! G d d      Z" G d d      Z# G d de      Z$ G d de      Z% G d de      Z&ejN                  jQ                  de)dfejT                  dfejV                  dfe,dfejZ                  dfej\                  df ej^                  dd !      d"f ej^                  d#d !      d"f ej^                  d$      d"f ej^                  d#$      d"f ej^                         d"fg      d%        Z0 G d& d'e      Z1 e
jd                  d(ejf                  jh                  vd)       G d* d+e             Z5 e
jd                  d(ejf                  jh                  vd)       G d, d-e             Z6 e
jd                  d.ejf                  jh                  vd/       G d0 d1e             Z7 e
jd                  d2ejf                  jh                  vd3       G d4 d5e             Z8 e
jd                  d6ejf                  jh                  vd7       G d8 d9e             Z9 e
jd                  d:ejf                  jh                  vd;       G d< d=e             Z: e
jd                  d>ejf                  jh                  vd?       G d@ dAe             Z; G dB dCe      Z< G dD dEe      Z= G dF dGe      Z> G dH dIe      Z? G dJ dKe      Z@ G dL dMe      ZA G dN dOe      ZB G dP dQe      ZC G dR dSe      ZD G dT dUe      ZE G dV dWe      ZF G dX dYe      ZG G dZ d[e      ZH G d\ d]e      ZI G d^ d_e      ZJejN                  j                  ej2                  j                  d`k(  dab      ZM G dc dde      ZN G de dfe      ZO G dg dhe      ZP G di dje      ZQ G dk dle      ZR e
j                  ej2                  j                  dmk\  dn      do        ZT e
j                  ej2                  j                  dpk\  xs4 ej2                  j                  dqk\  xr ej2                  j                  drk  ds      dt        ZUdu ZVdv ZWdw ZXdx ZYdy ZZdz Z[d{ Z\d| Z] G d} d~e      Z^ G d de      Z_y)z
    Dataset testing operations.

    Tests all dataset operations, including creation, with the exception of:

    1. Slicing operations for read and write, handled by module test_slicing
    2. Type conversion for read and write (currently untested)
    N   )utTestCase)get_data_file_path)FileGroupDataset)is_empty_dataspaceproduct)h5fh5t)H5pyDeprecationWarning)versionc                       e Zd Zd Zd Zy)BaseDatasetc                 B    t        | j                         d      | _        y )Nw)r   mktempfselfs    a/var/www/html/software/conda/envs/higlass/lib/python3.12/site-packages/h5py/tests/test_dataset.pysetUpzBaseDataset.setUp'   s    dkkmS)    c                 R    | j                   r| j                   j                          y y N)r   closer   s    r   tearDownzBaseDataset.tearDown*   s    66FFLLN r   N)__name__
__module____qualname__r   r    r   r   r   r   &   s    *r   r   c                       e Zd ZdZd Zy)TestReprz5
        Feature: repr(Dataset) behaves sensibly
    c                     | j                   j                  dd      }| j                  t        |      t               | j                   j                          | j                  t        |      t               y)z( repr() works on live and dead datasets foo   N)r   create_datasetassertIsInstancereprstrr   r   dss     r   test_repr_openzTestRepr.test_repr_open4   sM    VV""5$/d2h,d2h,r   N)r   r    r!   __doc__r/   r"   r   r   r$   r$   /   s    -r   r$   c                       e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Z ej                   eed
       d      d        Zd Zy)TestCreateShapez@
        Feature: Datasets can be created from a shape only
    c                 t    | j                   j                  dd      }| j                  |j                  d       y)z Create a scalar dataset r&   r"   Nr   r)   assertEqualshaper   dsets     r   test_create_scalarz"TestCreateShape.test_create_scalarB   s,    vv$$UB/R(r   c                 t    | j                   j                  dd      }| j                  |j                  d       y)z Create a size-1 dataset r&   r   Nr4   r7   s     r   test_create_simplez"TestCreateShape.test_create_simpleG   s,    vv$$UD1T*r   c                 t    | j                   j                  dd      }| j                  |j                  d       y)z+ Create a size-1 dataset with integer shaper&   r   r;   Nr4   r7   s     r   test_create_integerz#TestCreateShape.test_create_integerL   s,    vv$$UA.T*r   c                 T   | j                   j                  dd      }| j                  |j                  d       | j                  |j                  d       | j                   j                  dd      }| j                  |j                  d       | j                  |j                  d       y) Create an extended dataset r&   ?   rB   bar   
   <   Nr   r)   r5   r6   sizer7   s     r   test_create_extendedz$TestCreateShape.test_create_extendedQ   s~    vv$$UE2U+B'vv$$UG4W-R)r   c                 T   | j                   j                  dd      }| j                  |j                  d       | j                  |j                  d       | j                   j                  dd      }| j                  |j                  d       | j                  |j                  d       y)r@   r&   rB   rA   rC   rD   rG   NrH   r7   s     r   test_create_integer_extendedz,TestCreateShape.test_create_integer_extendedZ   s~    vv$$UB/U+B'vv$$UG4W-R)r   c                     | j                   j                  dd      }| j                  |j                  t	        j                  d             y)) Confirm that the default dtype is float r&   rA   z=f4Nr   r)   r5   dtypenpr7   s     r   test_default_dtypez"TestCreateShape.test_default_dtypec   s4    vv$$UE2RXXe_5r   c                     | j                  t              5  | j                  j                  d       ddd       y# 1 sw Y   yxY w)z  Missing shape raises TypeError r&   NassertRaises	TypeErrorr   r)   r   s    r   test_missing_shapez"TestCreateShape.test_missing_shapeh   s7    y) 	)FF!!%(	) 	) 	)s	   ;Ac                 0   | j                   j                  ddt        j                        }t	        j
                         dv r*t        j                  dt	        j
                         z         | j                  |j                  t        j                         y)rN   r&   rA   rP   )ppc64lez(Storage of long double deactivated on %sN)
r   r)   rQ   
longdoubleplatformmachinepytestxfailr5   rP   r7   s     r   test_long_doublez TestCreateShape.test_long_doublem   se    vv$$UE$G,LLChFVFVFXXYR]]3r   
complex256zNo support for complex256c                     | j                   j                  ddt        j                  d            }| j	                  |j                  t        j                  d             y)rN   r&   rA   ra   rY   N)r   r)   rQ   rP   r5   r7   s     r   test_complex256zTestCreateShape.test_complex256t   sK     vv$$UE+-88L+A % CRXXl%;<r   c                     | j                   j                  dd      }| j                  |j                  d       | j                   j                  dd      }| j                  |j                  d       y )Ns   foor;   s   bar/baz)   r4   r   r8   dset2s      r   test_name_byteszTestCreateShape.test_name_bytes{   sV    vv$$VT2T*%%j$7d+r   N)r   r    r!   r0   r9   r<   r>   rJ   rL   rR   rW   r`   r   skipIfhasattrrQ   rc   rh   r"   r   r   r2   r2   <   sa    )
+
+
**6
)
4 RYY72|,,.IJ= K=,r   r2   c                   ^    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zy)TestCreateDatazA
        Feature: Datasets can be created from existing data
    c                     t        j                  dd      }| j                  j                  d|      }| j	                  |j
                  |j
                         y)z- Create a scalar dataset from existing array r"   r   r&   dataNrQ   onesr   r)   r5   r6   r   ro   r8   s      r   r9   z!TestCreateData.test_create_scalar   sC    wwr3vv$$U$6TZZ0r   c                     t        j                  dd      }| j                  j                  d|      }| j	                  |j
                  |j
                         y)z/ Create an extended dataset from existing data rA   r   r&   rn   Nrp   rr   s      r   rJ   z#TestCreateData.test_create_extended   sC    wwuc"vv$$U$6TZZ0r   c                     | j                   j                  ddd      }| j                  |t        j                         | j                  d| j                   v        y)z1 Create dataset with missing intermediate groups z/foo/bar/bazrF   rF   z<i4)r6   rP   N)r   r)   r*   h5pyr	   
assertTruer-   s     r   test_dataset_intermediate_groupz.TestCreateData.test_dataset_intermediate_group   sF    VV"">"Ob$,,/$&&01r   c                     t        j                  dd      }| j                  j                  dd|      }| j	                  |j
                  d       | j                  |d   |j                  d             y)	z8 Create from existing data, and make it fit a new shape    r   rY   r&   rF      r6   ro   .N)rQ   aranger   r)   r5   r6   assertArrayEqualreshaperr   s      r   test_reshapezTestCreateData.test_reshape   s^    yy3'vv$$U'$EW-d3ig)>?r   c                     | j                  t              5  t        | j                  d   j                         ddd       y# 1 sw Y   yxY w)zE Binding Dataset to a non-DatasetID identifier fails with ValueError /N)rU   
ValueErrorr	   r   idr   s    r   test_appropriate_low_level_idz,TestCreateData.test_appropriate_low_level_id   s9    z* 	$DFF3KNN#	$ 	$ 	$s   #AAc                    |j                   j                         }t        |t        j                        sJ |j                         |k(  sJ ||j                         sJ y |j                         rJ |j                         |k(  sJ y r   )r   get_type
isinstancer   TypeStringIDget_csetis_variable_strget_size)r   r8   csetlengthtids        r   check_h5_stringzTestCreateData.check_h5_string   s{    gg #s//000||~%%%>&&(((**,,,<<>V+++r   c           	      j     fd} | j                   j                  dd              | j                   j                  dddg              | j                   j                  ddgdgg              | j                   j                  dt        j                  ddgt        	                   y
)z= Creating dataset with byte string yields vlen ASCII dataset c                 J    j                  | t        j                  d        y Nr   )r   r   
CSET_ASCIIr8   r   s    r   check_vlen_asciiz?TestCreateData.test_create_bytestring.<locals>.check_vlen_ascii   s      s~~d Cr   a   abcrn   b   defcdrY   Nr   r)   rQ   arrayobject)r   r   s   ` r   test_create_bytestringz%TestCreateData.test_create_bytestring   s    	D..s.@A..s&&9I.JK..s6(VH9M.NO..bhh/v> / 
 	r   c                     | j                   j                  dt        j                  ddgd            }| j	                  |t
        j                  d       y )	Nr   r   r   S3rY   rn   r|   r   )r   r)   rQ   r   r   r   r   r7   s     r   test_create_np_szTestCreateData.test_create_np_s   sE    vv$$Srxx8HPT/U$VT3>>!<r   c           	      j     fd} | j                   j                  dd              | j                   j                  dddg              | j                   j                  ddgdgg              | j                   j                  dt        j                  ddgt        	                   y )
Nc                 J    j                  | t        j                  d        y r   )r   r   	CSET_UTF8r   s    r   check_vlen_utf8z;TestCreateData.test_create_strings.<locals>.check_vlen_utf8   s      s}}T Br   r   abcrn   r   defr   r   rY   r   )r   r   s   ` r   test_create_stringsz"TestCreateData.test_create_strings   s    	C--c->?--c-GH--c%5'8J-KL--bhhu~V< . 
 	r   c                     | j                  t              5  | j                  j                  dt	        j
                  ddgd             d d d        y # 1 sw Y   y xY w)Nr   r   r   U3rY   rn   )rU   rV   r   r)   rQ   r   r   s    r   test_create_np_uzTestCreateData.test_create_np_u   sP    y) 	TFF!!#BHHff5ET,R!S	T 	T 	Ts   5AAc                     | j                   j                  dd       | j                  t        | j                   d   j                               y )Nr&   r   rY   )r   r)   rw   r
   r   r   s    r    test_empty_create_via_None_shapez/TestCreateData.test_empty_create_via_None_shape   s9    e3/*466%=+;+;<=r   c                     | j                   j                  dt        j                  d             | j	                  t        | j                   d   j                               y )Nr&   r   rY   rn   )r   r)   rv   Emptyrw   r
   r   r   s    r   !test_empty_create_via_Empty_classz0TestCreateData.test_empty_create_via_Empty_class   sB    e$**3*?@*466%=+;+;<=r   c                     | j                  t              5  | j                  j                  ddt	        j
                  d             d d d        y # 1 sw Y   y xY w)NrC   r(   r|   r}   )rU   r   r   r)   rQ   r~   r   s    r   test_create_incompatible_dataz,TestCreateData.test_create_incompatible_data   sJ    z* 	FFF!!%q		!!E	F 	F 	Fs   2AAN)r   r    r!   r0   r9   rJ   rx   r   r   r   r   r   r   r   r   r   r   r"   r   r   rl   rl      sK    112@$
,	=T>>Fr   rl   c                      e Zd ZdZej
                  j                  dddej                  dd ej                  dd fddej                  dd ej                  d	d
 fddej                  d
dd
d
f   ej                  d
d
d
df   fddej                  dd
ddf   ej                  d
d
 fg      d        Z	d Z
d Zd Zd Zy
)TestReadDirectlyzI
        Feature: Read data directly from Dataset into a Numpy array
    +source_shape,dest_shape,source_sel,dest_seld   r   rF   2   rG   F   Z   Nrz   rF      r   r         	   rE   re   rE   r|   c                 P   t        j                  t        |      d      j                  |      }|j	                  d||      }t        j
                  |dd      }|j                         }	||   |	|<   |j                  |||       t         j                  j                  ||	       y )Nint64rY   r8   rn   )
rQ   r~   r   r   r)   fullcopyread_directtestingassert_array_equal)
r   writable_filesource_shape
dest_shape
source_seldest_selsource_valuesr8   arrexpecteds
             r   test_read_directz!TestReadDirectly.test_read_direct   s     		',"7wGOOP\]++FL}+Uggj"G488:*:6j(3


%%c84r   c                    |j                  ddt        j                  dd            }t        j                  dd      }|j	                  |       t        j
                  j                  |t        j                  dd             y )Nr8   rF   rF   r   rY   rn   )r)   rQ   r~   rq   r   r   r   r   r   r8   r   s       r   test_no_selzTestReadDirectly.test_no_sel   sb    ++FE		"T[@\+]gge7+


%%c299Rw+GHr   c                    |j                  dd      }t        j                  dd      }t        j                  t
              5  |j                  |t        j                  dd t        j                  dd        d d d        y # 1 sw Y   y xY w	Nedsetr   rY   r   r   rF   r   rG   )r)   rQ   rq   r^   raisesrV   r   s_)r   r   
empty_dsetr   s       r   
test_emptyzTestReadDirectly.test_empty   sr    "11'1I
ggfg&]]9% 	C""3aRUU2b\B	C 	C 	Cs   6BBc                     |j                  ddd      }t        j                  d      }t        j                  t
              5  |j                  |       d d d        y # 1 sw Y   y xY wNr8   r   r   rY      r)   rQ   rq   r^   r   rV   r   r   s       r   test_wrong_shapez!TestReadDirectly.test_wrong_shape   sU    ++FF'+Jggfo]]9% 	"S!	" 	" 	"   AA'c                     |j                  ddd      }t        j                  dd      }t        j                  t
              5  |j                  |       d d d        y # 1 sw Y   y xY wNr8   ru   r   rY   F)orderr   r   s       r   test_not_c_contiguousz&TestReadDirectly.test_not_c_contiguous  sX    ++FHG+Lgghc*]]9% 	"S!	" 	" 	"   A  A))r   r    r!   r0   r^   markparametrizerQ   r   r   r   r   r   r   r"   r   r   r   r      s     [[5VRUU1R["%%2,7FBEE"RL"%%*5xssAva"f>beeArr1HoruuQx8		
55IC""r   r   c                      e Zd ZdZej
                  j                  dddej                  dd ej                  dd fddej                  dd ej                  d	d
 fddej                  d
dd
d
f   ej                  d
d
d
df   fddej                  dd
ddf   ej                  d
d
 fg      d        Z	d Z
d Zd Zy
)TestWriteDirectlyz>
        Feature: Write Numpy array directly into Dataset
    r   r   r   rF   r   rG   r   r   Nr   r   r   r   r   re   rE   r|   c                 4   |j                  d|dd      }t        j                  t        |            j	                  |      }t        j
                  |dd      }||   ||<   |j                  |||       t        j                  j                  |d d  |       y )Nr8   int32r   rP   	fillvaluerY   )	r)   rQ   r~   r   r   r   write_directr   r   )	r   r   r   r   r   r   r8   r   r   s	            r   test_write_directz#TestWriteDirectly.test_write_direct  s     ++FJgY[+\ii-.66|D77:r9 _#z84


%%d1gx8r   c                    |j                  dd      }t        j                  t              5  |j	                  t        j                  d      t
        j                  dd t
        j                  dd        d d d        y # 1 sw Y   y xY wr   )r)   r^   r   rV   r   rQ   rq   r   )r   r   r   s      r   r   zTestWriteDirectly.test_empty!  sj    "11'1I
]]9% 	P##BGGFORUU1R["%%2,O	P 	P 	Ps   A	A??Bc                     |j                  ddd      }t        j                  d      }t        j                  t
              5  |j                  |       d d d        y # 1 sw Y   y xY wr   r)   rQ   rq   r^   r   rV   r   r   s       r   r   z"TestWriteDirectly.test_wrong_shape&  sU    ++FF'+Jggfo]]9% 	#c"	# 	# 	#r   c                     |j                  ddd      }t        j                  dd      }t        j                  t
              5  |j                  |       d d d        y # 1 sw Y   y xY wr   r   r   s       r   r   z'TestWriteDirectly.test_not_c_contiguous,  sX    ++FHG+Lgghc*]]9% 	#c"	# 	# 	#r   )r   r    r!   r0   r^   r   r   rQ   r   r   r   r   r   r"   r   r   r   r     s     [[5VRUU1R["%%2,7FBEE"RL"%%*5xssAva"f>beeArr1HoruuQx8		
99P
##r   r   c                   @    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zy
)TestCreateRequirezS
        Feature: Datasets can be created only if they don't exist in the file
    c                     | j                   j                  ddd      }| j                  |t               | j	                  |j
                  d       y)z& Create new dataset with no conflicts r&   r{   r   N)r   require_datasetr*   r	   r5   r6   r7   s     r   test_createzTestCreateRequire.test_create9  s>    vv%%eWc:dG,W-r   c                     | j                   j                  ddd      }| j                   j                  ddd      }| j                  ||       y)z) require_dataset yields existing dataset r&   r{   r   Nr   r  r5   rf   s      r   test_create_existingz&TestCreateRequire.test_create_existing?  sB    vv%%eWc:&&ugs;u%r   c                    | j                   j                  ddd      }| j                   j                  ddd      }| j                  ||       | j                   j                  ddd      }| j                   j                  ddd      }| j                  ||       | j                   j                  ddd      }| j                   j                  ddd      }| j                  ||       y)	z; require_dataset with integer shape yields existing datasetr&   rF   r   rC   r   bazs   bazNr  rf   s      r   test_create_1Dz TestCreateRequire.test_create_1DE  s    vv%%eR5&&ub#6u%vv%%eUC8&&ub#6u%vv%%eR5&&vuc:u%r   c                     | j                   j                  ddd       | j                  t              5  | j                   j	                  ddd       ddd       y# 1 sw Y   yxY w)z6 require_dataset with shape conflict yields TypeError r&   r{   r   )rF   r(   Nr   r)   rU   rV   r  r   s    r   test_shape_conflictz%TestCreateRequire.test_shape_conflictS  sQ    eWc2y) 	8FF""5'37	8 	8 	8   AA#c                     | j                   j                  d       | j                  t              5  | j                   j	                  ddd       ddd       y# 1 sw Y   yxY w)z< require_dataset with object type conflict yields TypeError r&   r{   r   N)r   create_grouprU   rV   r  r   s    r   test_type_conflictz$TestCreateRequire.test_type_conflictY  sM    E"y) 	8FF""5'37	8 	8 	8s   AA!c                     | j                   j                  ddd      }| j                  t              5  | j                   j	                  ddd       ddd       y# 1 sw Y   yxY w)zL require_dataset with dtype conflict (strict mode) yields TypeError
        r&   r{   r   S10Nr  r7   s     r   test_dtype_conflictz%TestCreateRequire.test_dtype_conflict_  sU     vv$$UGS9y) 	:FF""5'59	: 	: 	:r  c                     | j                   j                  ddd      }| j                   j                  dddd      }| j                  ||       y)z* require_dataset with exactly dtype match r&   r{   r   TexactN)r   r)   r  r5   rf   s      r   test_dtype_exactz"TestCreateRequire.test_dtype_exactf  sI     vv$$UGS9&&ugs$&Gu%r   c                     | j                   j                  ddd      }| j                   j                  dddd      }| j                  ||       | j                  |j                  t        j                  d             y)zJ require_dataset with convertible type succeeds (non-strict mode)
        r&   r{   i4i2Fr  N)r   r)   r  r5   rP   rQ   rf   s      r   test_dtype_closez"TestCreateRequire.test_dtype_closem  se     vv$$UGT:&&ugt5&Iu%bhhtn5r   N)r   r    r!   r0   r  r  r	  r  r  r  r  r  r"   r   r   r   r   3  s/    .&&88:&6r   r   c                   F    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zy)TestCreateChunkedzL
        Feature: Datasets can be created by manually specifying chunks
    c                 x    | j                   j                  ddd      }| j                  |j                  d       y)z Create via chunks tuple r&   r   r   r6   chunksNr   r)   r5   r   r7   s     r   test_create_chunksz$TestCreateChunked.test_create_chunks|  s1    vv$$U&$Ge,r   c                 x    | j                   j                  ddd      }| j                  |j                  d       y)z Create via chunks integer r&   r   rF   r  r   Nr!  r7   s     r   test_create_chunks_integerz,TestCreateChunked.test_create_chunks_integer  s1    vv$$U&$De,r   c                     | j                  t              5  | j                  j                  ddd       ddd       y# 1 sw Y   yxY w)z& Illegal chunk size raises ValueError r&   r   r   r  NrU   r   r   r)   r   s    r   test_chunks_mismatchz&TestCreateChunked.test_chunks_mismatch  sB    z* 	FFF!!%vf!E	F 	F 	F	   >Ac                     | j                  t              5  | j                  j                  dddd       ddd       y# 1 sw Y   yxY w)z3 Chunked format required for given storage options r&   r   r   F)r6   maxshaper   Nr&  r   s    r   test_chunks_falsez#TestCreateChunked.test_chunks_false  sD    z* 	RFF!!%us5!Q	R 	R 	R	    ?Ac                     | j                  t              5  | j                  j                  ddd       ddd       y# 1 sw Y   yxY w)z> Attempting to create chunked scalar dataset raises TypeError r&   r"   )r   r  NrT   r   s    r   test_chunks_scalarz$TestCreateChunked.test_chunks_scalar  sB    y) 	AFF!!%r%!@	A 	A 	Ar(  c                     | j                   j                  ddd      }| j                  |j                  t               | j                  t        |j                        d       y)z Auto-chunking of datasets r&   )r   r   Tr  re   N)r   r)   r*   r   tupler5   lenr7   s     r   test_auto_chunksz"TestCreateChunked.test_auto_chunks  sJ    vv$$U)D$Idkk51T[[)1-r   c                 z    | j                   j                  dddd      }| j                  |j                  d       y)z7 Auto-chunking with pathologically large element sizes r&   r|   
S100000000Tr6   rP   r   r;   Nr!  r7   s     r   test_auto_chunks_abusez(TestCreateChunked.test_auto_chunks_abuse  s4    vv$$U$lSW$Xd+r   c                    | j                   j                  ddt        j                  d      }d|ddddf<   | j	                  t        j
                  |ddddf   dk(               d	|d<   | j	                  t        j
                  |d   d	k(               d
|dd | j	                  t        j
                  |dd d
k(               y)z+ Test scalar assignment of chunked dataset r&   )r|   r   r   )r   r   r   r6  rF   r   N(         r   re   )r   r)   rQ   r   rw   allr7   s     r   test_scalar_assignmentz(TestCreateChunked.test_scalar_assignment  s    vv$$U++-88K % I Q2XtAq"H~345 QtAw"}-. Qq	tAayB/0r   c                 <   t        j                  t        d      5 }| j                  j	                  ddd       ddd       t        j                  t        d      5 }| j                  j	                  ddd	       ddd       y# 1 sw Y   LxY w# 1 sw Y   yxY w)
z, Auto-chunking of empty datasets not allowedr   )matchr&   S100T)rP   r   Nr   rP   r*  )r^   r   rV   r   r)   )r   errs     r   test_auto_chunks_no_shapez+TestCreateChunked.test_auto_chunks_no_shape  s    ]]9G4 	DFF!!%vd!C	D ]]9G4 	DFF!!%v!C	D 	D	D 	D	D 	Ds   BBBBN)r   r    r!   r0   r"  r$  r'  r+  r.  r2  r7  r=  rC  r"   r   r   r  r  v  s8    -
-
F
R
A
.,
1 Dr   r  c                   .    e Zd ZdZd Zd Zd Zd Zd Zy)TestCreateFillvaluez>
        Feature: Datasets can be created with fill value
    c                     | j                   j                  ddd      }| j                  |d   d       | j                  |d   d       y)z- Fill value is reflected in dataset contents r&   r   g      @r   r   r   N)r   r)   r5   r7   s     r   test_create_fillvalz'TestCreateFillvalue.test_create_fillval  sE    vv$$UES$Aa#&a#&r   c                     | j                   j                  ddd      }| j                  |j                  d       | j	                  |j                  t
        j                         y)z( Fill value is recoverable via property r&   r   g      @rG  N)r   r)   r5   r   assertNotIsInstancerQ   ndarrayr7   s     r   test_propertyz!TestCreateFillvalue.test_property  sI    vv$$UES$A-  <r   c                 t    | j                   j                  dd      }| j                  |j                  d       y)z0 .fillvalue property works correctly if not set r&   r   r   N)r   r)   r5   r   r7   s     r   test_property_nonez&TestCreateFillvalue.test_property_none  s,    vv$$UE2+r   c                    t        j                  ddg      }t        j                  d|      d   }| j                  j	                  dd||      }| j                  |j                  |       | j                  |d	   |       y
)z& Fill value works with compound types )r   f4)r   i8r;   rY   r   r&   r   r   r(   N)rQ   rP   rq   r   r)   r5   r   assertAlmostEqual)r   dtvr8   s       r   test_compoundz!TestCreateFillvalue.test_compound  so    XX{K01GGD#A&vv$$UEq$I+tAw*r   c                     | j                  t              5  | j                  j                  ddddgd      }ddd       y# 1 sw Y   yxY w)z$ Bogus fill value raises ValueError r&   r   r   i)r   r   *   r   Nr&  r7   s     r   test_exczTestCreateFillvalue.test_exc  sQ    z* 	B66((%z2b ) BD	B 	B 	Bs   "AA
N)	r   r    r!   r0   rH  rL  rN  rU  rZ  r"   r   r   rE  rE    s!    '=,
+Br   rE  zdt,expected        utf-8r   encodingr   r   asciir^  c                 N    |j                  dd|       }|j                  |k(  sJ y )Nr&   r   rY   )r)   r   )rS  r   r   r8   s       r   test_get_unset_fill_valuerb    s-     ''uB'?D>>X%%%r   c                       e Zd ZdZd Zy)TestCreateNamedTypezC
        Feature: Datasets created from an existing named type
    c                    t        j                  d      | j                  d<   | j                  j                  dd| j                  d         }| j	                  |j                  t        j                  d             | j	                  |j
                  j                         | j                  d   j
                         | j                  |j
                  j                         j                                y)z7 Named type object works and links the dataset to type f8typexr   rY   N)	rQ   rP   r   r)   r5   r   r   rw   	committedr7   s     r   
test_namedzTestCreateNamedType.test_named  s    $vvv$$S&v$GRXXd^4))+TVVF^->->?((*4467r   N)r   r    r!   r0   rj  r"   r   r   rd  rd    s    8r   rd  gzipzDEFLATE is not installedc                   (    e Zd ZdZd Zd Zd Zd Zy)TestCreateGzipz=
        Feature: Datasets created with gzip compression
    c                     | j                   j                  dddd      }| j                  |j                  d       | j                  |j                  d       y)z# Create with explicit gzip options r&   r   rz   rk  r   compressioncompression_optsNr   r)   r5   rq  rr  r7   s     r   	test_gzipzTestCreateGzip.test_gzip  sP    vv$$UH&67 % 9))62..2r   c                     | j                   j                  ddd      }| j                  |j                  d       | j                  |j                  d       y)z+ Create with implicit gzip level (level 4) r&   ro  rk  rq  r(   Nrs  r7   s     r   test_gzip_implicitz!TestCreateGzip.test_gzip_implicit  sI    vv$$UH&$I))62..2r   c                 ^   | j                   j                  ddd      }| j                  |j                  d       | j                  |j                  d       t
        j                  j                  j                  }	 t               t
        j                  j                  _        | j                  t              5  | j                   j                  ddd      }ddd       |t
        j                  j                  _        y# 1 sw Y   )xY w# |t
        j                  j                  _        w xY w)z. Create with gzip level by specifying integer r&   ro  r   rv  rk  N)r   r)   r5   rq  rr  rv   _hldataset_LEGACY_GZIP_COMPRESSION_VALSr0  rU   r   )r   r8   original_compression_valss      r   test_gzip_numberzTestCreateGzip.test_gzip_number  s    vv$$UH!$D))62..2$(HH$4$4$R$R!	W=BWDHH:"":. Mvv,,UH!,LM >WDHH:M M >WDHH:s$   <<D 8C?D ?DD !D,c                    | j                  t        t        f      5  | j                  j	                  ddd       ddd       | j                  t              5  | j                  j	                  ddd       ddd       | j                  t              5  | j                  j	                  dddd       ddd       y# 1 sw Y   xY w# 1 sw Y   SxY w# 1 sw Y   yxY w)	z= Illegal gzip level (explicit or implicit) raises ValueError r&   ro     rv  Nrk  rp  )rU   r   RuntimeErrorr   r)   r   s    r   test_gzip_exczTestCreateGzip.test_gzip_exc#  s    
L9: 	CFF!!%r!B	Cz* 	CFF!!%r!B	Cz* 	7FF!!%v35 " 7	7 	7		C 	C	C 	C	7 	7s#   B=C	 C=C	CCN)r   r    r!   r0   rt  rw  r}  r  r"   r   r   rm  rm    s    33W7r   rm  c                       e Zd ZdZd Zd Zy)TestCreateCompressionNumberz?
        Feature: Datasets created with a compression code
    c                     t         j                  j                  j                  }	 t	               t         j                  j                  _        | j
                  j                  ddt         j                  j                  d      }|t         j                  j                  _        | j                  |j                  d       | j                  |j                  d       y# |t         j                  j                  _        w xY w)z^ Create with compression number of gzip (h5py.h5z.FILTER_DEFLATE) and a compression level of 7r&   ro  )r   rp  rk  r   N)rv   ry  rz  r{  r0  r   r)   h5zFILTER_DEFLATEr5   rq  rr  )r   r|  r8   s      r   test_compression_numberz3TestCreateCompressionNumber.test_compression_number5  s    $(HH$4$4$R$R!	W=BWDHH:66((dhhF]F]pt(uD=VDHH:))62..2 >WDHH:s   AC !C=c                    | j                  t              5 }| j                  j                  ddd       ddd       | j	                  dt        j                               | j                  t              5 }| j                  j                  ddd       ddd       | j	                  dt        |j                               t        j                  j                  j                  }	 t               t        j                  j                  _
        | j                  t              5  | j                  j                  ddt        j                  j                         ddd       |t        j                  j                  _
        y# 1 sw Y   PxY w# 1 sw Y   xY w# 1 sw Y   BxY w# |t        j                  j                  _
        w xY w)	z* Create with invalid compression numbers  r&   ro  irv  NzInvalid filterr   zUnknown compression)rU   r   r   r)   assertInr,   	exceptionrv   ry  rz  r{  r0  
IndexErrorr  r  )r   er|  s      r   test_compression_number_invalidz;TestCreateCompressionNumber.test_compression_number_invalidA  s]   z* 	EaFF!!%t!D	E&AKK(89z* 	DaFF!!%s!C	D+S-=>$(HH$4$4$R$R!	W=BWDHH: "":. \%%eX488CZCZ%[\ >WDHH:!	E 	E	D 	D\ \ >WDHH:s;   F7F(<F( $7FF( FFF%!F( (!G	N)r   r    r!   r0   r  r  r"   r   r   r  r  .  s    
3Wr   r  lzfzLZF is not installedc                       e Zd ZdZd Zd Zy)TestCreateLZF<
        Feature: Datasets created with LZF compression
    c                    | j                   j                  ddd      }| j                  |j                  d       | j                  |j                  d       t        j                  d      }| j                   j                  d|d      }| j                  |j                  d       | j                  |j                  d       | j                   j                          | j                   d   d	   }| j                  ||       y)
z Create with explicit lzf r&   ro  r  rv  Nr   rC   )ro   rq  r"   )	r   r)   r5   rq  rr  rQ   r~   flushr   )r   r8   testdatareaddatas       r   test_lzfzTestCreateLZF.test_lzf]  s    vv$$UH%$H))51..599S>vv$$Uu$M))51..566%=$h1r   c                     | j                  t              5  | j                  j                  dddd       ddd       y# 1 sw Y   yxY w)z& Giving lzf options raises ValueError r&   ro  r  r(   rp  Nr&  r   s    r   test_lzf_exczTestCreateLZF.test_lzf_excm  sE    z* 	6FF!!%u34 " 6	6 	6 	6r,  N)r   r    r!   r0   r  r  r"   r   r   r  r  V  s    2 6r   r  szipzSZIP is not installedc                       e Zd ZdZd Zy)TestCreateSZIPr  c                 B    | j                   j                  dddd      }y)z Create with explicit szip r&   ro  r  )ec   rp  N)r   r)   r7   s     r   	test_szipzTestCreateSZIP.test_szip{  s%    vv$$UH&6@ % Br   N)r   r    r!   r0   r  r"   r   r   r  r  t  s    Br   r  shufflezSHUFFLE is not installedc                       e Zd ZdZd Zy)TestCreateShufflez8
        Feature: Datasets can use shuffling filter
    c                 v    | j                   j                  ddd      }| j                  |j                         y)z Enable shuffle filter r&   ro  T)r  N)r   r)   rw   r  r7   s     r   test_shufflezTestCreateShuffle.test_shuffle  s-    vv$$UHd$C%r   N)r   r    r!   r0   r  r"   r   r   r  r    s    &r   r  
fletcher32zFLETCHER32 is not installedc                       e Zd ZdZd Zy)TestCreateFletcher32z=
        Feature: Datasets can use the fletcher32 filter
    c                 v    | j                   j                  ddd      }| j                  |j                         y)z Enable fletcher32 filter r&   ro  T)r  N)r   r)   rw   r  r7   s     r   test_fletcher32z$TestCreateFletcher32.test_fletcher32  s-    vv$$UH$F(r   N)r   r    r!   r0   r  r"   r   r   r  r    s    )r   r  scaleoffsetzSCALEOFFSET is not installedc                   :    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
y	)
TestCreateScaleOffsetz?
        Feature: Datasets can use the scale/offset filter
    c                     | j                  t              5  | j                  j                  ddt        d      }ddd       y# 1 sw Y   yxY w)z[ Ensure that a scale factor is required for scaleoffset compression of floating point data r&   ro  TrP   r  NrU   r   r   r)   floatr7   s     r    test_float_fails_without_optionsz6TestCreateScaleOffset.test_float_fails_without_options  I     z* 	Y66((SW(XD	Y 	Y 	Y   $AAc                     | j                  t              5  | j                  j                  ddt        d      }ddd       y# 1 sw Y   yxY w)z# Check when scaleoffset is negetiver&   ro  gr  Nr  r7   s     r   test_non_integerz&TestCreateScaleOffset.test_non_integer  r  r  c                     | j                  t              5  | j                  j                  ddt        d      }ddd       y# 1 sw Y   yxY w)z% Check when dtype is unsupported typer&   ro  Tr  N)rU   rV   r   r)   boolr7   s     r   test_unsupport_dtypez*TestCreateScaleOffset.test_unsupport_dtype  sI     y) 	X66((RV(WD	X 	X 	Xr  c                    d}d}dd|z  z  }t        j                  j                  | dz
  |z  }| j                  j	                  d|t         j
                  |      }|j                  J ||d	<   | j                  j                  }| j                  j                          t        j                  |d
      | _        | j                  d   d	   }| j                  ||d| z         ||k(  j                         rJ y)z2 Scaleoffset filter works for floating point data r(   r   i,  r   rF   g      ?r&   r  N.r)	precision)rQ   randomrandr   r)   float64r  filenamer   rv   r   r   r<  )r   scalefacr6   ranger  r8   r  r  s           r   
test_floatz TestCreateScaleOffset.test_float  s     R8^#IINNE*S0E9vv$$UEQY$Z +++ S	66??8S)66%=% 	hBH9<MN (--////r   c                    d}d}t         j                  j                  dd|z  dz
  |t         j                        }| j                  j                  d|t         j                  d	      }|j                  J ||d<   | j                  j                  }| j                  j                          t        j                  |d      | _        | j                  d   d   }| j                  ||       y
)zB Scaleoffset filter works for integer data with default precision r;  r  r   re   r   rI   rP   r&   Tr  N.r  )rQ   r  randintr   r   r)   r  r  r   rv   r   r   r   nbitsr6   r  r8   r  r  s          r   test_intzTestCreateScaleOffset.test_int  s     99$$QU
QU"(($S vv$$UEt$T +++ S	66??8S)66%=%h1r   c                    d}d}t         j                  j                  dd|z  |t         j                        }| j                  j                  d|t         j                  |      }| j                  |j                  dk(         ||d<   | j                  j                  }| j                  j                          t        j                  |d	      | _        | j                  d   d   }| j                  ||       y
)D Scaleoffset filter works for integer data with specified precision r;  r  r   re   r  r&   r  .r  N)rQ   r  r  r   r   r)   rw   r  r  r   rv   r   r   r  s          r   test_int_with_minbitsz+TestCreateScaleOffset.test_int_with_minbits  s     99$$QU
bhh$Ovv$$UEu$U 	((B./ S	66??8S)66%=%h1r   c                    d}d}t         j                  j                  dd|dz   z  dz
  |t         j                        }| j                  j                  d|t         j                  |      }| j                  |j                  dk(         ||d	<   | j                  j                  }| j                  j                          t        j                  |d
      | _        | j                  d   d	   }||k(  j                         rJ y)r  r;  r  r   re   r   r  r&   r  .r  N)rQ   r  r  r   r   r)   rw   r  r  r   rv   r   r<  r  s          r   test_int_with_minbits_lossyz1TestCreateScaleOffset.test_int_with_minbits_lossy  s     99$$Qeai(81(<5PRPXPX$Yvv$$UEu$U 	((B./ S	66??8S)66%=% (--////r   N)r   r    r!   r0   r  r  r  r  r  r  r  r"   r   r   r  r    s-    YYX042*2(0r   r  c                   :    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
y	)
TestExternalzB
        Feature: Datasets with the external storage property
    c                    d}t         j                  j                  |      }| j                         }|dt        j                  fg}| j
                  j                  d||j                  |d      }||d<   |j                  J t        |d      5 }|j                         }ddd       |j                         k(  sJ t        j                  |j                  j                         j!                         j#                               j%                         }t        j                  | j
                  j&                        j(                  j%                         }	||	k(  sJ y# 1 sw Y   xY w)	z' Create and access an external dataset rE   r   r   r&   z	${ORIGIN}rP   externalefile_prefix.Nrb)rQ   r  r   r   	UNLIMITEDr   r)   rP   r  openreadtobytespathlibPathr   get_access_plistget_efile_prefixdecodeas_posixr  parent)
r   r6   r  ext_filer  r8   fidcontentsr  r  s
             r   test_contentszTestExternal.test_contents  s)    99##E* ;;=q#--01vv$$UERZit$uS	}}((( (D! 	"SxxzH	"8++----||DGG$<$<$>$O$O$Q$X$X$Z[ddfdffoo.55>>@v%%%	" 	"s   EE&c           	         d}t         j                  j                  |      }| j                         }t        j                  j                  |      dt        j                  fg}| j                  j                  d||j                  |t        j                  j                  |            }||d<   |j                  J t        |d      5 }|j                         }ddd       |j                         k(  sJ t         j"                  j$                  dk\  rt'        j(                  |j*                  j-                         j/                         j1                               j3                         }t'        j(                  |      j4                  j3                         }	||	k(  sJ | j                  j7                  d||j                  t        j                  j                  |      	      }
|
j                  J |
d
   |k(   y# 1 sw Y   $xY w)z< Create and access an external dataset using an efile_prefixr  r   r&   r  .Nr  )r   rF   r   )r  r"   )rQ   r  r   ospathbasenamer   r  r   r)   rP   dirnamer  r  r  r  rv   r   hdf5_version_tupler  r  r   r  r  r  r  r  r  )r   r6   r  r  r  r8   r  r  r  r  rg   s              r   test_contents_efile_prefixz'TestExternal.test_contents_efile_prefix(  s    99##E* ;;=WW%%h/CMMBCvv$$UERZikipipixix  zB  jC$  DS	}}((( (D! 	"SxxzH	"8++---- <<**h6"<<(@(@(B(S(S(U(\(\(^_hhjL\\(+22;;=F6)))&&ueX^^RTRYRYRaRabjRk&l~~)))b	X	" 	"s   	G<<Hc                 \    | j                   j                  dd| j                                y)z/ External argument may be a file name str only r&   r  r  N)r   r)   r   r   s    r   test_name_strzTestExternal.test_name_strF  s#     	eXFr   c                     | j                   j                  ddt        j                  | j	                                      y)z0 External argument may be a file name path only r&   r  r  N)r   r)   r  r  r   r   s    r   test_name_pathzTestExternal.test_name_pathK  s2     	eX'.||DKKM'B 	 	Dr   c                     | j                         d}t        fdt        |      D              }| j                  j	                  dd|      }t        |j                        |k(  sJ y)z9 External argument may be an iterable of multiple tuples r   c              3   .   K   | ]  }|d z  d f  yw)  Nr"   ).0rh  r  s     r   	<genexpr>z/TestExternal.test_iter_multi.<locals>.<genexpr>V  s     Eq1t8T2Es   poor  r  N)r   iterr  r   r)   r1  r  )r   Nr  r8   r  s       @r   test_iter_multizTestExternal.test_iter_multiQ  s[     ;;=EE!HEEvv$$UHx$H4==!Q&&&r   c           
         d}| j                         }t        |gft        |dgft        |dt        j                  gft        |fgft        |dfgft        |dt        j                  dfgft        |ddfgffD ]=  \  }}| j                  |      5  | j                  j                  d||       ddd       ? y# 1 sw Y   JxY w)z" Test with invalid external lists r  r   zh5f.UNLIMITEDr&   r  N)r   rV   r   r  r   rU   r   r)   )r   r6   r  exc_typer  s        r   test_invalidzTestExternal.test_invalidZ  s     ;;= 
#1&1cmm458+'8Q-)8Qq9:;(A789#
 
	GHh ""8, G%%eUX%FG G
	GG Gs   B77C 	c                     | j                         }d}d}| j                  j                  d|||      }|j                  J |j                  |k(  sJ |j
                  |k(  sJ y)z$ Create expandable external dataset )   @   )Nr  r&   )r6   r*  r  N)r   r   r)   r   r6   r*  )r   r  r6   r*  exp_dsets        r   test_create_expandablez#TestExternal.test_create_expandablel  sq     ;;=66((eh2: ) <&&&~~&&&  H,,,r   N)r   r    r!   r0   r  r  r  r  r  r  r  r"   r   r   r  r    s-    &0<G
D'G$
-r   r  c                   *    e Zd ZdZddZd Zd Zd Zy)TestAutoCreatezP
        Feature: Datasets auto-created from data produce the correct types
    c                    |j                   j                         }| j                  t        |      t        j
                  j                         | j                  |j                         |       |r|j                         sJ y y r   )	r   r   r5   rg  rv   r   r   r   r   )r   r.   r   variabler   s        r   assert_string_typez!TestAutoCreate.assert_string_type~  s`    eenncDHH$9$9:.&&((( r   c                    d| j                   d<   | j                  | j                   d   t        j                  j                         ddg| j                   d<   | j                  | j                   d   t        j                  j                         t        j                  ddgt
        j                        | j                   d<   | j                  | j                   d   t        j                  j                         y)	z<Assigning byte strings produces a vlen string ASCII dataset s   Hello thererh     as   bcyrY   zN)r   r  rv   r   r   rQ   r   object_r   s    r   test_vlen_byteszTestAutoCreate.test_vlen_bytes  s    $ssTXX-@-@AUmssTXX-@-@Ahhe}BJJ?ssTXX-@-@Ar   c                    dt        d      z   | j                  d<   | j                  | j                  d   t        j                  j
                         ddg| j                  d<   | j                  | j                  d   t        j                  j
                         t        j                  ddggt        j                        | j                  d<   | j                  | j                  d   t        j                  j
                         y	)
z?Assigning unicode strings produces a vlen string UTF-8 dataset Hello there4   rh  r   bcr  rY   r  N)	chrr   r  rv   r   r   rQ   r   r  r   s    r   test_vlen_unicodez TestAutoCreate.test_vlen_unicode  s    #c&k1ssTXX-?-?@DkssTXX-?-?@ hhd}BJJ?ssTXX-?-?@r   c                 .   t        j                  d      | j                  d<   | j                  d   }| j                  |t        j
                  j                  d       | j                  |j                  j                         j                         d       y)zV Assignment of fixed-length byte string produces a fixed-length
        ascii dataset r  rh  F)r  r:  N)rQ   bytes_r   r  rv   r   r   r5   r   r   r   r-   s     r   test_string_fixedz TestAutoCreate.test_string_fixed  sj     ii.sVVC[DHH$7$7%H)224b9r   N)T)r   r    r!   r0   r  r  r  r  r"   r   r   r  r  y  s    )	B
A:r   r  c                       e Zd Zd Zd Zd Zy)TestCreateLikec                 H   t        j                  d      j                  dd      | j                  d<   | j                  j	                  d| j                  d          | j                  d   }| j                  |j                  d       | j                  |j                  d        y )N   r   lollike_lolr   r   )	rQ   r~   r   r   create_dataset_liker5   r6   assertIsr   )r   dslikes     r   test_no_chunkszTestCreateLike.test_no_chunks  st    		"--a3u"":tvve}=
#v.fmmT*r   c                 P   | j                   j                  dt        j                  d      d      }| j	                  dt
        j                  j                  |j                        j                         | j                   j                  d|      }| j	                  dt
        j                  j                  |j                        j                         | j                   j                  dt        j                  d      d      }| j                  dt
        j                  j                  |j                        j                         | j                   j                  d	|      }| j                  dt
        j                  j                  |j                        j                         y )
Nhondar;  T)ro   track_timesr   hyundaiibmFlenovo)r   r)   rQ   r~   assertNotEqualrv   h5gget_objinfo_idmtimer  r5   )r   origsimilars      r   test_track_timeszTestCreateLike.test_track_times  s"   vv$$W299R=15 % 7Atxx33DHH=CCD&&,,Y=Atxx33GKK@FFGvv$$U216 % 8DHH00:@@A&&,,Xt<DHH00=CCDr   c                     | j                   j                  ddd      }| j                   j                  d|      }| j                  |j                  d       | j                  |j
                  d       y)z) Test when other.maxshape != other.shape otherr   r   r*  simr   N)r   r)   r  r5   r6   r*  )r   r2  r/  s      r   test_maxshapezTestCreateLike.test_maxshape  s_     %%gur%B&&,,UE:.))51r   N)r   r    r!   r"  r0  r6  r"   r   r   r  r    s    +E2r   r  c                   $    e Zd Zd Zd Zd Zd Zy)TestChunkIteratorc                     | j                   j                  dd      }| j                  t              5  |j	                          d d d        y # 1 sw Y   y xY w)Nr&   r"   )r   r)   rU   rV   iter_chunksr7   s     r   r"  z TestChunkIterator.test_no_chunks  sG    vv$$UB/y) 		 	 	s   AAc           	         | j                   j                  ddd      }t        ddd      ft        ddd      ft        dd	d      ft        d	d
d      ff}| j                  t	        |j                               t	        |             t        ddd      ft        dd	d      ft        d	dd      ff}| j                  t	        |j                  t        j                  dd             t	        |             y )Nr&   r   )    r   r   r<  r   r  `   r   r   a   r   r)   slicer5   listr:  rQ   r   r   r8   r   s      r   test_1dzTestChunkIterator.test_1d  s    vv$$UF5$A1R]$uR1~&7%2a.9J2c!_ d..014>B2b^%bA'85Bq>:KLd..ruuR|<=tH~Nr   c                    | j                   j                  ddd      }t        ddd      t        ddd      ft        ddd      t        dd	d      ft        ddd      t        ddd      ft        ddd      t        dd	d      ft        dd
d      t        ddd      ft        dd
d      t        dd	d      ft        d
d	d      t        ddd      ft        d
d	d      t        dd	d      ff}| j                  t	        |j                               t	        |             t        ddd      t        ddd      ff}| j                  t	        |j                  t        j                  ddddf               t	        |             y )Nr&   r   r   )r<  r  r=  r   r<  r   r  r   r>  0   4   r9  r   r@  rC  s      r   test_2dzTestChunkIterator.test_2d  sp   vv$$UIg$F1b!_eAr1o6q"ab#q9"2r1-uQA?	r2q	5S!,-b"a0@aQ0 R+U2sA->?	r3	E!RO,uRa/@b#q/	 	d..014>B2r1%uRQ'78:d..ruuRU2b5[/ABCT(^Tr   c           	         | j                   j                  ddd      }t        ddd      t        ddd      ft        ddd      t        ddd      ft        ddd      t        ddd      ft        ddd      t        ddd      ff}t        dd      }| j                  t	        |j                  ||f            t	        |             y )	Nr&   r  re   re   r=  r|   r(   r   r   )r   r)   rA  r5   rB  r:  )r   r8   r   sels       r   test_2d_partial_slicez'TestChunkIterator.test_2d_partial_slice  s    vv$$UE%$@1a^U1a^4!QNE!QN3!QNE!QN3!QNE!QN35 Aajd..Sz:;T(^Lr   N)r   r    r!   r"  rD  rI  rM  r"   r   r   r8  r8    s    
OUMr   r8  c                   F    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zy)
TestResizezF
        Feature: Datasets created with "maxshape" may be resized
    c                     | j                   j                  ddd      }| j                  |j                  d       | j	                  |j
                  d       y)z  Create dataset with "maxshape" r&   ro  r   rG   r3  Nr   r)   assertIsNotr   r5   r*  r7   s     r   r  zTestResize.test_create  sE    vv$$UHx$Hd+1r   c                 $   | j                   j                  ddd      }| j                  |j                  d       | j	                  |j
                  d       | j                   j                  ddd      }| j	                  |j
                  d       y)z6 Create dataset with "maxshape" using integer maxshaper&   r5  r   r3  NrC   rR  r7   s     r   r	  zTestResize.test_create_1D  st    vv$$UEB$?d+.vv$$UB$<.r   c                 ,   | j                   j                  ddd      }| j                  |j                  d       |j	                  d       | j                  |j                  d       |j	                  d       | j                  |j                  d       y)z( Datasets may be resized up to maxshape r&   ro  rQ  r3  r   r   Nr   r)   r5   r6   resizer7   s     r   test_resizezTestResize.test_resize  sq    vv$$UHx$HX.HX.HX.r   c                     | j                   j                  ddd      }| j                  |j                  d       |j	                  d       | j                  |j                  d       y)z> Datasets may be resized up to maxshape using integer maxshaper&   r   r9  r3  r5  )rz   NrW  r7   s     r   test_resize_1DzTestResize.test_resize_1D  sQ    vv$$UB$<U+EU+r   c                     | j                   j                  ddd      }| j                  t              5  |j	                  d       ddd       y# 1 sw Y   yxY w)z. Resizing past maxshape triggers an exception r&   ro  rQ  r3  )r   r   N)r   r)   rU   	ExceptionrX  r7   s     r   test_resize_overzTestResize.test_resize_over  sL    vv$$UHx$Hy) 	"KK!	" 	" 	"s   AAc                     | j                   j                  dd      }| j                  t              5  |j	                  d       ddd       y# 1 sw Y   yxY w)z/ Resizing non-chunked dataset raises TypeError r&   ro  rQ  N)r   r)   rU   rV   rX  r7   s     r   test_resize_nonchunkedz!TestResize.test_resize_nonchunked  sG    vv$$UH5y) 	"KK!	" 	" 	"s   AAc                     | j                   j                  ddd      }|j                  dd       | j                  |j                  d       y	)
z Resize specified axis r&   ro  rQ  r3  r   r   axisrV  N)r   r)   rX  r5   r6   r7   s     r   test_resize_axiszTestResize.test_resize_axis  sA    vv$$UHx$HBQX.r   c                     | j                   j                  ddd      }| j                  t              5  |j	                  dd       ddd       y# 1 sw Y   yxY w)	z  Illegal axis raises ValueError r&   ro  rQ  r3  r   re   rb  N)r   r)   rU   r   rX  r7   s     r   test_axis_exczTestResize.test_axis_exc  sP    vv$$UHx$Hz* 	$KKK#	$ 	$ 	$s   AAc                     | j                   j                  ddd      }| j                  |j                  d       | j                  |j                  d       y)z? Allow zero-length initial dims for unlimited axes (issue 111) r&   )   r   )rh  Nr3  N)r   r)   r5   r6   r*  r7   s     r   test_zero_dimzTestResize.test_zero_dim%  sE    vv$$UGj$IW-
3r   N)r   r    r!   r0   r  r	  rY  r[  r^  r`  rd  rf  ri  r"   r   r   rO  rO    s4    2//,""/$4r   rO  c                       e Zd ZdZd Zd Zy)	TestDtypezD
        Feature: Dataset dtype is available as .dtype property
    c                     | j                   j                  ddd      }| j                  |j                  t	        j                  d             y)z Retrieve dtype from dataset r&   r   |S10NrO   r7   s     r   
test_dtypezTestDtype.test_dtype2  s7    vv$$UD&9RXXf%56r   c                     t        j                  dt         j                  fdt         j                  fg      }| j                  j	                  dd|      }| j                  |j                  |       y)z7 Retrieve dtype from complex float16 dataset (gh-2156) r  rX  r&   rm  N)rQ   rP   float16r   r)   r5   )r   	complex32r8   s      r   test_dtype_complex32zTestDtype.test_dtype_complex327  sU     HHsBJJ/#rzz1BCD	vv$$UD)<Y/r   N)r   r    r!   r0   ro  rs  r"   r   r   rk  rk  ,  s    7
0r   rk  c                       e Zd ZdZd Zd Zy)TestLenzG
        Feature: Size of first axis is available via Python's len
    c                 r    | j                   j                  dd      }| j                  t        |      d       y)z Python len() (under 32 bits) r&   )8  rh  rw  N)r   r)   r5   r1  r7   s     r   test_lenzTestLen.test_lenE  s,    vv$$UI6TC(r   c                 |   | j                   j                  dd      }| j                  |j                  d       t        j
                  dk(  r*| j                  t              5  t        |       ddd       n| j                  t        |      d       | j                  |j                         d       y# 1 sw Y   *xY w)z Python len() vs Dataset.len() r&   )        rh  iNrz  )	r   r)   r5   r6   sysmaxsizerU   OverflowErrorr1  r7   s     r   test_len_bigzTestLen.test_len_bigJ  s    vv$$UM:]3;;+%""=1 D	  SY0W-	 s   !B22B;N)r   r    r!   r0   rx  r~  r"   r   r   ru  ru  ?  s    )
	.r   ru  c                       e Zd ZdZd Zd Zy)TestIterz;
        Feature: Iterating over a dataset yields rows
    c                    t        j                  dd      j                  d      }| j                  j	                  d|      }t        ||      D ]2  \  }}| j                  t        |      d       | j                  ||       4 y)	z& Iterating over a dataset yields rows rz   r   rY   r{   r&   rn   r|   N)	rQ   r~   r   r   r)   zipr5   r1  r   )r   ro   r8   rh  r  s        r   	test_iterzTestIter.test_iter\  ss    yy3'//8vv$$U$6dO 	(DAqSVQ'!!!Q'	(r   c                     | j                   j                  dd      }| j                  t              5  |D cg c]  }| c} ddd       yc c}w # 1 sw Y   yxY w)z0 Iterating over scalar dataset raises TypeError r&   r"   )r6   N)r   r)   rU   rV   )r   r8   rh  s      r   test_iter_scalarzTestIter.test_iter_scalard  sT    vv$$U"$5y) 	1Q	 		 	s   A	AAAAN)r   r    r!   r0   r  r  r"   r   r   r  r  V  s    (r   r  c                   v    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zy)TestStringszr
        Feature: Datasets created with vlen and fixed datatypes correctly
        translate to and from HDF5
    c                    t        j                  d      }| j                  j                  dd|      }|j                  j                         }| j                  t        |      t         j                  j                         | j                  |j                         t         j                  j                         t        j                  |j                        }| j                  |j                  d       y)z3 Vlen bytes dataset maps to vlen ascii in the file r_  r`  rh  r   rY   N)rv   string_dtyper   r)   r   r   r5   rg  r   r   r   r   check_string_dtyperP   r^  r   rS  r.   r   string_infos        r   r  zTestStrings.test_vlen_bytesr  s    0VV""3b"9eenncDHH$9$9:)<)<=--bhh7--w7r   c                    t        j                  d      }d}| j                  j                  dd||      }| j	                  | j                  d   d   |       | j	                  | j                  d   j                         d   |j                                | j	                  | j                  d   j                  |       y)	& Vlen bytes dataset handles fillvalue r_  r`     barrh  r   r   r   Nrv   r  r   r)   r5   asstrr  r   r   rS  
fill_valuer.   s       r   test_vlen_bytes_fillvaluez%TestStrings.test_vlen_bytes_fillvalue|  s    0
VV""3bJ"OQ4**,Q/1B1B1DE..
;r   c                    t        j                         }| j                  j                  dd|      }|j                  j                         }| j                  t        |      t         j                  j                         | j                  |j                         t         j                  j                         t        j                  |j                        }| j                  |j                  d       y)z5 Vlen unicode dataset maps to vlen utf-8 in the file rh  r   rY   r\  N)rv   r  r   r)   r   r   r5   rg  r   r   r   r   r  rP   r^  r  s        r   r  zTestStrings.test_vlen_unicode  s     VV""3b"9eenncDHH$9$9:););<--bhh7--w7r   c                    t        j                         }d}| j                  j                  dd||      }| j	                  | j                  d   d   |j                  d             | j	                  | j                  d   j                         d   |       | j	                  | j                  d   j                  |j                  d             y)( Vlen unicode dataset handles fillvalue    bárrh  r   r   r   r\  N)rv   r  r   r)   r5   encoder  r   r  s       r   test_vlen_unicode_fillvaluez'TestStrings.test_vlen_unicode_fillvalue  s     
VV""3bJ"OQ):):7)CD**,Q/<..
0A0A'0JKr   c                    t        j                  d      }| j                  j                  dd|      }|j                  j                         }| j                  t        |      t        j                  j                         | j                  |j                                | j                  |j                         d       | j                  |j                         t        j                  j                         t        j                   |j                        }| j                  |j"                  d       | j                  |j$                  d       y)zK Fixed-length bytes dataset maps to fixed-length ascii in the file
        rn  rh  r   rY   rF   r_  N)rQ   rP   r   r)   r   r   r5   rg  rv   r   r   assertFalser   r   r   r   r  r^  r   r  s        r   test_fixed_asciizTestStrings.test_fixed_ascii  s     XXfVV""3b"9eenncDHH$9$9:,,./,)<)<=--bhh7--w7++R0r   c                    t        j                  dd      }d}| j                  j                  dd||      }| j	                  | j                  d   d   |       | j	                  | j                  d   j                         d   |j                                | j	                  | j                  d   j                  |       y	)
r  r_  rF   r]  r  rh  r   r   r   Nr  r  s       r   test_fixed_bytes_fillvaluez&TestStrings.test_fixed_bytes_fillvalue  s    ;
VV""3bJ"OQ4**,Q/1B1B1DE..
;r   c                    t        j                  dd      }| j                  j                  dd|      }|j                  j                         }| j                  |j                         t         j                  j                         d}|j                  d      |d<   ||d	<   ||g|d
d t        j                  ||gt              |dd t        j                  |j                  d      gd
z  |      |dd | j                  t              5  t        j                  ||gd      |dd d d d        t        j                   j#                  |d d t        j                  |j                  d      gdz  d             y # 1 sw Y   UxY w)Nr\  r   r]  rh  r   rY      cùr   r   re   r(   rE      UrF   S)rv   r  r   r)   r   r   r5   r   r   r   r  rQ   r   r   rU   rV   r   r   )r   rS  r.   r   ss        r   test_fixed_utf8zTestStrings.test_fixed_utf8  sE   :VV""3b"9eenn););<!11a&1Q((Aq601Q((AHHW-.2"=1Qy) 	3xxAc2BqH	3 	

%%b!fbhh8I7JQ7NVY.Z[	3 	3s   E==Fc                    t        j                  dd      }dj                  d      }| j                  j	                  dd||      }| j                  | j                  d   d   |       | j                  | j                  d   j                         d   |j                  d             | j                  | j                  d   j                  |       y	)
r  r\  rF   r]  r  rh  r   r   r   N)	rv   r  r  r   r)   r5   r  r  r   r  s       r   test_fixed_utf_8_fillvaluez&TestStrings.test_fixed_utf_8_fillvalue  s    ;]]7+
VV""3bJ"OQ4**,Q/1B1B71KL..
;r   c                     t        j                  d      }| j                  t              5  | j                  j                  dd|      }ddd       y# 1 sw Y   yxY w)zA Fixed-length unicode datasets are unsupported (raise TypeError) z|U10rh  r   rY   N)rQ   rP   rU   rV   r   r)   r   rS  r.   s      r   test_fixed_unicodezTestStrings.test_fixed_unicode  sN    XXfy) 	>&&sF"&=B	> 	> 	>s   AAc                     t        j                  d      }| j                  j                  dd|      }d}||d<   |d   }| j	                  t        |      t               | j	                  ||       y)	zN writing and reading to vlen bytes dataset preserves type and content
        r_  r`  rh  r   rY      Hellor   N)rv   r  r   r)   r5   rg  bytesr   rS  r.   ro   outs        r   test_roundtrip_vlen_bytesz%TestStrings.test_roundtrip_vlen_bytes  sj     0VV""3b"91ecE*d#r   c                     t        j                  d      }| j                  j                  dd|      }d}||d<   |d   }| j	                  t        |      t         j                         | j	                  ||       y)z[ Writing to and reading from fixed-length bytes dataset preserves
        type and content rn  rh  r   rY   r  r   N)rQ   rP   r   r)   r5   rg  r  r  s        r   test_roundtrip_fixed_bytesz&TestStrings.test_roundtrip_fixed_bytes  sl     XXfVV""3b"91ecBII.d#r   c                    t        j                         }| j                  j                  dd|      }d}||d<   | j	                  |d   t
               |j                         d   }| j	                  |t               | j                  ||       y )Nrh  r   rY      fàilter   )	rv   r  r   r)   r*   r  r  r,   r5   r  s        r   test_retrieve_vlen_unicodez&TestStrings.test_retrieve_vlen_unicode  s|     VV""3R"81beU+hhjmc3'd#r   c                 *   | j                   j                  ddt        j                               }d}||d<   |j	                  d      }| j                  t              5  |d   }d d d        | j                  |j	                  dd      d   d       | j                  |j	                  d	      d   |       | j                  d
t        |j	                                      t        j                  j                  |j	                         d d t        j                  |gt                     t        j                  j                  t        j                  |j	                               d d t        j                  |gt                     y # 1 sw Y   &xY w)Nrh  r   rY   r  r   r_  ignorefiltelatin-1rF   r   )r   r)   rv   r  r  rU   UnicodeDecodeErrorr5   r)  r1  rQ   r   r   r   r   asarray)r   r.   ro   strwrap1r  s        r   
test_asstrzTestStrings.test_asstr  s;   VV""3T5F5F5H"I188G$12 	1+C	 	'84Q7A 	BHHY/2D9 	S_- 	

%%HHJrNBHHdV6:	
 	

%%JJrxxz"2A&$v(F	
#	 	s   FFc                    t        j                  d      }| j                  j                  dd|      }d}t	        j
                  |j                  d      |      |d<   | j                  |d   t        j                         |j                         d   }| j                  |t               | j                  ||       | j                  |j                  d	d
      d   d       | j                  |j                  d      d   |       t        j                  j                  |j                         d d t	        j
                  |gt                     y )Nr   r   rh  r   rY   r  r\  r   r_  r  r   r  r   )rv   r  r   r)   rQ   r   r  r*   r  r  r,   r5   r)  r   r   r   r  s        r   test_asstr_fixedzTestStrings.test_asstr_fixed	  s
   a(VV""3R"8W-R81beRYY/hhjmc3'd# 	'84Q7= 	BHHY/2D9 	

%%HHJrNBHHdV6:	
r   c                     t        j                  d      }| j                  j                  dd|      }d}| j	                  t
              5  ||d<   ddd       y# 1 sw Y   yxY w)zGEncoding error when writing a non-ASCII string to an ASCII vlen datasetr_  rh  r   rY   r  r   N)rv   r  r   r)   rU   UnicodeEncodeError)r   rS  r.   ro   s       r   test_unicode_write_errorz$TestStrings.test_unicode_write_error  s_    w'VV""3b"912 	BqE	 	 	s   AA#c                    t        j                         }| j                  j                  dd|      }dt	        d      z   j                  d      }||d<   |d   }| j                  t        |      t               | j                  ||       y)	zJ Writing valid utf-8 byte strings to a unicode vlen dataset is OK
        rh  r   rY   r  r  utf8r   N)	rv   r  r   r)   r  r  r5   rg  r  r  s        r   test_unicode_write_bytesz$TestStrings.test_unicode_write_bytes'  s|      VV""3b"9V,44V<1ecE*d#r   c                    t        j                  d      }| j                  j                  dd|      }d}||d<   |d   }| j	                  t        |      t               | j	                  ||j                  d             y)z: Writing an ascii str to ascii vlen dataset is OK
        r_  rh  r   rY   zASCII stringr   N)rv   r  r   r)   r5   rg  r  r  r  s        r   test_vlen_bytes_write_ascii_strz+TestStrings.test_vlen_bytes_write_ascii_str2  ss     w'VV""3b"91ecE*dkk'23r   N)r   r    r!   r0   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r"   r   r   r  r  k  s^    
8<8L1<\ <>	$	$$
6
,	$	4r   r  c                   (    e Zd ZdZd Zd Zd Zd Zy)TestCompoundz:
        Feature: Compound types correctly round-trip
    c           
         t        j                  dt         j                  fdt         j                  fdt         j                  fdt         j                  fdt         j                  fdt         j                  fdt         j                  fg      }t        j
                  d|	      }|j                  D ]'  }t         j                  j                  d      d
z  ||<   ) || j                  d<   | j                  d   d   }| j                  t        j                  ||k(               | j                  |j                  |j                         y)z: Compound types are read back in correct order (issue 236)weightcputimewalltimeparents_offset	n_parentsstatusendpoint_typer  rY   r   test.N)rQ   rP   r  uint32uint8rK  fieldsr  r   rw   r<  r5   )r   rS  r  keyoutdatas        r   test_rtzTestCompound.test_rtD  s     XX2::.'4("**5.		:)2995&1-rxx8< = ::e2.99 	:CII,,U3c9HSM	: "v&&.%w(2347r   c                 X   t        j                  dt         j                  dffdt         j                  fg      }t        j                  d|      }|j
                  D ]5  }t         j                  j                  ||   j                        dz  ||<   7 | j                  j                  dd|      }|j
                  D ]
  }||   ||<    | j                  d   d	   }| j                  t        j                  ||k(               | j                  |j                  |j                         y )
Nr  r|   r  r  rY   rI   r   r  .)rQ   rP   r  r  rK  r  r  r6   r   r)   rw   r<  r5   )r   rS  r  r  r.   r  s         r   test_assignzTestCompound.test_assignX  s   XXBJJ?3)28848 9 ::e2.99 	MCII,,(3-2E2E,FLHSM	M VV""65";99 	$CsmBsG	$ &&.%w(2347r   c                 v   t        j                  dt         j                  fdt         j                  fdt         j                  fg      }t        j                  d|      }|j                  D ]'  }t         j
                  j                  d      dz  ||<   ) || j                  d<   t         j                  j                  | j                  d   j	                  ddg      d d  |ddg          t         j                  j                  | j                  d   j	                  d      d d  |d          t         j                  j                  t        j                  | j                  d   j	                  ddg            |ddg          t        j                  dt         j                  fg      }t         j                  j                  t        j                  | j                  d   j	                  dg      |      |dg   j                  |             t        | j                  d   j	                  d            dk(  sJ y )	Nrh  r  r  r  rY   r   r  r  )rQ   rP   r  rK  r  r  r   r   r   r  r   astyper1  )r   rS  r  r  dt_ints        r   test_fieldszTestCompound.test_fieldsi  s   XX"**"**"**
  ::e2.99 	:CII,,U3c9HSM	: "v 	

%%FF6N!!3*-a0(C:2F	
 	

%%FF6N!!#&q)8C=	
 	

%%JJtvvf~,,c3Z898S#J;O	
 C?+,


%%JJtvvf~,,cU36BcUO""6*	
 466&>((-."444r   c                    t        j                  dt        j                  t         j                        fdt        j                  t         j                        fg      }t        j                  dt        j                  |      fdt         j
                  fg      }t        j                  t        dd      t         j                        t        j                  t        dd	      t         j                        f}t        j                  t        d
d      t         j                        t        j                  t        dd      t         j                        f}t        j                  t        j                  ||g|      dft        j                  |g|      dfg|      }|| j                  d<   | j                  d   }| j                  ||d       y )Nr   r   f1f2r   r|   rY   rE   r   rF   r  r     re   r.   F)check_alignment)
rQ   rP   rv   
vlen_dtyper   r   r   r  r   r   )r   dt_innerrS  inner1inner2ro   r  s          r   test_nested_compound_vlenz&TestCompound.test_nested_compound_vlen  sY   88c4??288#<= $//"((";<> ? XXdooh78bhh') * ((5A;bhh7((5A;bhh79 ((5R=9((5R=9; xx"((FF#38DaH6((;Q?A " tffTl 	c4?r   N)r   r    r!   r0   r  r  r  r  r"   r   r   r  r  >  s    8(8"!5F@r   r  c                       e Zd Zd Zd Zy)TestSubarrayc                     | j                   j                  ddd      }g d|d<   t        j                  j	                  |d d  g dg       g dg|d d  t        j                  j	                  |d d  g dg       y Nr   r;   3int8rY   r   re   r|   r   )r(   r   rE   )r   r)   rQ   r   r   r-   s     r   test_write_listzTestSubarray.test_write_list  se    VV""3G"<1


%%bei[91


%%bei[9r   c                 B   | j                   j                  ddd      }t        j                  g d      |d<   t        j                  j                  |d d  g dg       t        j                  g dg      |d d  t        j                  j                  |d d  g dg       y r  )r   r)   rQ   r   r   r   r-   s     r   test_write_arrayzTestSubarray.test_write_array  sw    VV""3G"<#1


%%bei[9)%1


%%bei[9r   N)r   r    r!   r  r  r"   r   r   r  r    s    ::r   r  c                   (    e Zd ZdZddddZd Zd Zy)	TestEnumzM
        Feature: Enum datatype info is preserved, read/write as integer
    r   r   rY  )REDGREENBLUEc                     t        j                  | j                  d      }| j                  j	                  dd|      }|j
                  }t        j                  |      }| j                  || j                         y)z= Enum datasets can be created and type correctly round-trips rX  basetyperh  rF  rY   N)rv   
enum_dtypeEDICTr   r)   rP   check_enum_dtyper5   )r   rS  r.   dt2dict2s        r   r  zTestEnum.test_create  s^    __TZZ#6VV""3
""=hh%%c*

+r   c                 $   t        j                  | j                  d      }| j                  j	                  dd|      }d|d<   d|dd	d	f<   | j                  |d   d       | j                  |dd	d	f   t        j                  d
d             y	)z/ Enum datasets can be read/written as integers r  r  rh  rF  rY   rY  )#   %   r   N)dr   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   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   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   )	rv   r  r  r   r)   r5   r   rQ   r   r  s      r   test_readwritezTestEnum.test_readwrite  s~    __TZZ$7VV""3
""=6
1a4FR(bAh4(HIr   N)r   r    r!   r0   r  r  r  r"   r   r   r  r    s      2.E,Jr   r  c                   \    e Zd ZdZd Z ej                   eed      d      d        Z	d Z
y)
TestFloatszA
        Test support for mini and extended-precision floats
    c                     | j                   j                  dd|      }| j                  |j                  |       t	        j
                  d|      }||d<   | j                  |d   |       y )Nrh  r   rY   .)r   r)   r5   rP   rQ   rq   r   )r   rS  r8   ro   s       r   	_exectestzTestFloats._exectest  s^    vv$$S&$;R(wwvR(S	d3i.r   rq  zNumPy float16 support requiredc                 L    | j                  t        j                  d             y)z Mini-floats round trip rq  N)r	  rQ   rP   r   s    r   	test_minizTestFloats.test_mini  s     	rxx	*+r   c                    t        t        d      r>| j                  t        j                  j
                  t        j
                  d             y| j                  t        j                  j
                  t        j
                  d             y)z Test mapping for float16 rq  z<f2z<f4N)rj   rQ   r5   r   
IEEE_F16LErP   r   s    r   test_mini_mappingzTestFloats.test_mini_mapping  sP    2y!S^^11288E?CS^^11288E?Cr   N)r   r    r!   r0   r	  r   
skipUnlessrj   rQ   r  r  r"   r   r   r  r    s<    / R]]72y)+KL, M,
Dr   r  c                       e Zd ZdZd Zd Zy)TestTrackTimesz"
        Feature: track_times
    c                     | j                   j                  ddd      }t        j                  j	                  |j
                        j                  }| j                  d|       y)zC check that when track_times=False, the time stamp=0 (Jan 1, 1970) r&   r'   Fr%  r   N)r   r)   rv   r*  r+  r,  r-  r5   )r   r.   ds_mtimes      r   test_disable_track_timesz'TestTrackTimes.test_disable_track_times  sK    VV""5$E"B88''/55H%r   c                     | j                  t              5  | j                  j                  ddd       ddd       y# 1 sw Y   yxY w)z3 check that when give track_times an invalid value r&   r'   nullr  NrT   r   s    r   test_invalid_track_timesz'TestTrackTimes.test_invalid_track_times  sB    y) 	CFF!!%6!B	C 	C 	Cr(  N)r   r    r!   r0   r  r  r"   r   r   r  r    s    &Cr   r  c                       e Zd ZdZd Zd Zy)TestZeroShapez7
        Features of datasets with (0,)-shape axes
    c                    | j                   j                  ddd      }| j                  |j                  t	        j
                  |      j                         | j                   j                  ddd      }| j                  |j                  t	        j
                  |      j                         | j                   j                  dd	d
      }| j                  |j                  t	        j
                  |      j                         y)z1 Empty datasets can be converted to NumPy arrays rh  r   Nr3  r  r   r   r  r   r   )NN)r   r)   r5   r6   rQ   r   r-   s     r   test_array_conversionz#TestZeroShape.test_array_conversion  s    VV""3D"9288B<#5#56VV""3w"?288B<#5#56VV""3"F288B<#5#56r   c                    ddg}| j                   j                  dd|d      }t        j                  d|      }| j	                  |d   j
                  |j
                         | j	                  |d   j                  |j                         | j	                  |d	   j
                  |j
                         | j	                  |d	   j                  |j                         y
)z- Slicing into empty datasets works correctly )r   r   )r   rX  rh  r  r   rA  rY   .r"   N)r   r)   rQ   emptyr5   r6   rP   )r   rS  r.   r   s       r   test_readingzTestZeroShape.test_reading  s    *%VV""3B"Ihht2&C		2C		2Bsyy1Bsyy1r   N)r   r    r!   r0   r  r!  r"   r   r   r  r    s    	7	2r   r  )r   rF   rE   z+Issue with empty region refs in HDF5 1.10.6)reasonc                   B    e Zd ZdZd Zd Zed        Zed        Zd Z	y)TestRegionRefsz3
        Various features of region references
    c                 
   t         j                  |        t        j                  d      j	                  d      | _        | j                  j                  d| j
                        | _        | j
                  | j                  d<   y )Ni'  rF  rh  rn   .)	r   r   rQ   r~   r   ro   r   r)   r8   r   s    r   r   zTestRegionRefs.setUp&  s[    $IIi(00<	FF))#DII)>			#r   c                     t         j                  dddddf   }| j                  j                  |   }| j	                  | j                  |   | j
                  |          y)z4 Region references can be used as slicing arguments r  r  rF   r   r   N)rQ   r   r8   	regionrefr   ro   r   slicrefs      r   test_create_refzTestRegionRefs.test_create_ref,  sR    uuRUBs1H_%ii!!$'diindiio>r   c                 v    | j                   j                  d d }| j                   |   }|j                  dk(  sJ y )Nr   )r8   r'  rI   )r   r*  r  s      r   test_empty_regionz TestRegionRefs.test_empty_region2  s5    ii!!"1%iinxx1}}r   c                 x   | j                   j                  ddd      }t        j                  j	                  t        j                  j
                        }|j                          t        j                  j	                  |j                  dt        j                  j                  |      }||   t        j                  t        j                  d            k(  sJ |j                          t        j                  j	                  |j                  dt        j                  j                  |      }||   |d   k(  sJ y )Nscalar      ?rP  ro   rP      .r"   )r   r)   rv   h5screateSCALARselect_noneh5rr   DATASET_REGIONr   rQ   rP   
select_all)r   r.   sidr*  s       r   test_scalar_datasetz"TestRegionRefs.test_scalar_dataset9  s    VV""8#T"Bhhoodhhoo. 	hhoobeeT488+B+BCH#w$**RXXd^4444 	hhoobeeT488+B+BCH#w"R&   r   c                 f   t         j                  dddddf   }| j                  j                  |   }| j	                  | j                  j                  j                  |      | j                  j
                         | j	                  | j                  j                  j                  |      d       y)z, Region reference shape and selection shape r  r  rF   r   r   )rF      N)rQ   r   r8   r'  r5   r6   	selectionr(  s      r   test_ref_shapezTestRegionRefs.test_ref_shapeH  s    uuRUBs1H_%ii!!$',,2237I,,66s;XFr   N)
r   r    r!   r0   r   r+  empty_regionref_xfailr-  r;  r?  r"   r   r   r$  r$     s?    #?   ! !Gr   r$  c                   "    e Zd ZdZd Zd Zd Zy)
TestAstypez(.astype() wrapper & context manager
    c                     | j                   j                  ddd      }t        j                  d      |d<   |j	                  d      d d  }| j                  |t        j                  dd             y Nrh  r   r  rY   r   .rP  )r   r)   rQ   r~   r  r   r   r8   r   s      r   test_astype_wrapperzTestAstype.test_astype_wrapperS  s\    vv$$S&$=IIcNS	kk$"c299S#=>r   c                     | j                   j                  ddd      }t        j                  d      |d<   | j	                  dt        |j                  d                   y rD  )r   r)   rQ   r~   r5   r1  r  r7   s     r   test_astype_wrapper_lenz"TestAstype.test_astype_wrapper_lenZ  sL    vv$$S&$=IIcNS	c$++d"345r   c                 
   | j                   j                  ddd      }t        j                  d      |d<   t        j                  |j                  d      d      }| j                  |t        j                  dd             y rD  )r   r)   rQ   r~   r  r  r   rE  s      r   test_astype_wrapper_asarrayz&TestAstype.test_astype_wrapper_asarray_  sb    vv$$S&$=IIcNS	jjT*$7c299S#=>r   N)r   r    r!   r0   rF  rH  rJ  r"   r   r   rB  rB  P  s    ?6
?r   rB  c                       e Zd ZdZd Zy)TestScalarCompoundzl
        Retrieval of a single field from a scalar compound dataset should
        strip the field info
    c                     t        j                  dg      }| j                  j                  dd|      }| j	                  |d   j                  t        j                  d             y )NrW  rh  r"   rY   r   rX  )rQ   rP   r   r)   r5   )r   rS  r8   s      r   test_scalar_compoundz'TestScalarCompound.test_scalar_compoundm  sM    XXzl#vv$$S"B$7c"((3-8r   N)r   r    r!   r0   rN  r"   r   r   rL  rL  f  s    
9r   rL  c                   P    e Zd Zd Zd Zd Zd Zd ZddZd Z	d Z
d	 Zd
 Zd Zy)TestVlenc                    t        j                  t              }| j                  j	                  dd|      }t        j                  d      |d<   t        j                  d      |d<   g d|d<   t        j                  d      |d<   | j                  |d   t        j                  d             | j                  |d   t        j                  d             | j                  |d   t        j                  g d             | j                  |d   t        j                  d             t        j                  t        j                  d	      t        j                  d
      gt              |dd | j                  |d   t        j                  d	             | j                  |d   t        j                  d
             t        j                  t        j                  d      t        j                  d      g      |dd | j                  |d   t        j                  d             | j                  |d   t        j                  d             y )Nvlenr'   rY   r|   r   r   r  re   r   r(   )
rv   r  intr   r)   rQ   r~   r   r   r   r  s      r   r  zTestVlen.test_intu  s   __S!VV""64r":		!1		!11		!1beRYYq\2beRYYq\2beRXXi%89beRYYq\2((BIIaL"))A,7vF1QbeRYYq\2beRYYq\2((BIIaL"))A,781QbeRYYq\2beRYYq\2r   c                     t        j                  t              }| j                  j	                  dd|      }| j                  j	                  dd|d   j
                         y )NrR  r;   rY   vlen2r"   )rv   r  rS  r   r)   rP   r  s      r   test_reuse_from_otherzTestVlen.test_reuse_from_other  sI    __S!VV""64r":gtRV\\:r   c                    dt         fdt        j                  t               fg}| j                  j	                  dd|      }| j                  j
                  }| j                  j                          t        j                  |d      | _        | j                  j	                  dd| j                  d   d   d   j                         y )Nr   r   rR  r;   rY   rU  r"   )	rS  rv   r  r   r)   r  r   r   rP   )r   rS  r.   fnames       r   test_reuse_struct_from_otherz%TestVlen.test_reuse_struct_from_other  s    Cj3 456VV""64r":5#&gtTVVF^C-@-D-J-JKr   c                    t        j                  t              }| j                  j	                  dd|      }t        j                  ddg      |d<   t        j                  dg      |d<   g d|d	<   | j                  |d   t        j                  ddg             | j                  |d   t        j                  dg             | j                  |d	   t        j                  g d
             t        j                  g dt        j                  d      gt              |dd	 | j                  |d   t        j                  d             | j                  |d   t        j                  d             t        j                  t        j                  g d      t        j                  g d      g      |dd	 | j                  |d   t        j                  d             | j                  |d   t        j                  d             y )NrR  r4  rY   gffffff?333333?r   r   )r[  re   r|   re   r  )皙?g?g @g@r(   r(   r   )r\  r[  皙@)皙?r[  r]  r|   )
rv   r  rS  r   r)   rQ   r   r   r~   r   r  s      r   test_convertzTestVlen.test_convert  s}   __S!VV""64r":#s$1#11beRXXq!f%56beRXXqc]3beRXXi%89((3RYYq\B&Q1QbeRYYq\2beRYYq\2((BHH_5HH_57 81QbeRYYq\2beRYYq\2r   c                 n   t        j                  t              }| j                  j	                  dd|      }t        j                  d      |d<   t        j                  t        j                  d      t        j                  d      gt        j                  d      t        j                  d      ggt              |d d d d f<   t        j                  t        j                  d      t        j                  d      gt        j                  d      t        j                  d      gg      |d d d d f<   y )NrR  rK  rY   r   r  r|   re   )	rv   r  rS  r   r)   rQ   r~   r   r   r  s      r   test_multidimzTestVlen.test_multidim  s    __S!VV""66"<99Q<488biilBIIaL9YYq\299Q<8:AGI1a488biilBIIaL9 iilBIIaL9; <1a4r   c                    t        j                  |      }| j                  j                  |d|      }t	        j
                  g d|      }t	        j
                  g d|      }t	        j
                  g dt	        j                  d            }|j                  |      }g d}	t	        j
                  |	|      }
g d}t	        j
                  ||      }||d	<   ||d
<   ||d<   |	|d<   ||d<   | j                  ||d	          | j                  ||d
          | j                  ||d          | j                  |
|d          | j                  ||d          t	        j
                  ddg|      }
|
dd |d	<   | j                  |
|d	          | j                  j                          | j                  j                          y)z
        Helper for testing various vlen numpy data types.
        :param np_dt: Numpy datatype to test
        :param dataset_name: String name of the dataset to create for testing.
        rm  rY   )r0         @g      >@)g33333Y@gi@gfffffX@g      %g     r)r   re   r  r   )r0  rc  g      @r[  g      )r   ir   r   i'  r   r   r   re   r|   r(   g333333?r]  N)rv   r  r   r)   rQ   r   rP   r  r   r  r   )r   np_dtdataset_namerS  r.   array_0array_1array_2casted_array_2list_3list_array_3list_4list_array_4s                r   _help_float_testingzTestVlen._help_float_testing  s    __U#VV""<R"@ ((=6((>eL ((9BHHW,=> . *xxe4 ,xxe411111gr!u-gr!u-nbe4lBqE2lBqE2 xxc
%8Q1lBqE2 	r   c                 P    t        j                  d      }| j                  |       y )Nrq  rQ   rP   rn  r   rd  s     r   test_numpy_float16zTestVlen.test_numpy_float16      #  'r   c                 P    t        j                  d      }| j                  |       y )Nfloat32rp  rq  s     r   test_numpy_float32zTestVlen.test_numpy_float32  rs  r   c                 P    t        j                  d      }| j                  |       y )Nr  rp  rq  s     r   test_numpy_float64_from_dtypez&TestVlen.test_numpy_float64_from_dtype  rs  r   c                 F    t         j                  }| j                  |       y r   )rQ   r  rn  rq  s     r   test_numpy_float64_2zTestVlen.test_numpy_float64_2  s    

  'r   c                    | j                   j                  ddt        j                  d             t	        j
                  g d      }|ddd   | j                   d   d<   t        | j                   d   d   |ddd   k(        s"J | j                   d   d    d	|ddd           | j                   j                  d
dt        j                  d             t	        j
                  g d      }|ddd   | j                   d
   d<   t        | j                   d
   d   |ddd   k(        s"J | j                   d
   d    d	|ddd           y)z4Test that non-contiguous arrays are stored correctlyncr   r  rY   )TFTTFFFNre   r   z != nc2int8)re   r(   r   r   r   r|   r   )r   r)   rv   r  rQ   r   r<  )r   rh  r  s      r   test_non_contiguous_arraysz#TestVlen.test_non_contiguous_arrays  s1   dE1HIHHCDCaC&tQ466$<?a!f,-O$&&,q/1B$q1vh/OO-eU$//&2IJHH+,SqS6ua466%=#q1v-.Q466%=3C2DD3Q30QQ.r   N)rR  )r   r    r!   r  rV  rY  r_  ra  rn  rr  rv  rx  rz  r  r"   r   r   rP  rP  t  s<    3$;
L3"<.`((((Rr   rP  c                       e Zd Zd Zd Zy)TestLowOpenc                 p    | j                   j                  dd      }|j                  j                         }y)z Test H5Dget_access_plist r&   r'   N)r   r)   r   r  )r   r.   p_lists      r   test_get_access_listz TestLowOpen.test_get_access_list  s*    VV""5$/'')r   c                 j   t         j                  j                  t         j                  j                        }| j                  j                  dd      }~t         j                  j                  | j                  j                  d|      }| j                  |t         j                  j                         y)z# Test the dapl keyword to h5d.open rh  r      xN)rv   h5pr4  DATASET_ACCESSr   r)   h5dr  r   r*   	DatasetID)r   daplr8   dsids       r   	test_daplzTestLowOpen.test_dapl  so    xxtxx667vv$$S&1xx}}TVVYYd3dDHH$6$67r   N)r   r    r!   r  r  r"   r   r   r  r    s    *
8r   r  )r   rF   r   z#chunk info requires  HDF5 >= 1.10.5c            
      D   ddl m}   |        }t        j                  |d      5 }|j	                  dddd       d	|d   d d  d d d        |j                  d       t        j                  |d
      5 }|d   j                  }|j                         dk(  sJ t        d      D ]  }t        t        j                  t        j                  |d            dz        }|j                  |      }|j                  |k(  sJ |j                  dk(  sJ |j                   J |j"                  dkD  rJ  |j%                  d      }|j                  dk(  sJ |j                  dk(  sJ |j                   J |j"                  dkD  sJ 	 d d d        y # 1 sw Y   IxY w# 1 sw Y   y xY w)Nr   BytesIOr   r  rF  ru   r  r6   r   rP   r   r  r   rF   r  )ior  rv   r   r)   seekr   get_num_chunksr  r0  rQ   r   unravel_indexget_chunk_infochunk_offsetfilter_maskbyte_offsetrI   get_chunk_info_by_coord)r  buffoutfinr.   joffsetsis           r   test_get_chunk_detailsr    s    
)C	3	 F*XTRVQ HHQK	3	 [^^  "c)))s 	A288B$4$4Q$ABRGHF""1%B??f,,,>>Q&&&>>---77Q;;	 ''/&(((~~"""~~)))ww{{#  
 s   F	1B8F*AF	FF)r   r;  r|   )r   rF   rF   )r   rF   c   zJchunk iteration requires  HDF5 1.10.10 and later 1.10, or 1.12.3 and laterc                     ddl m}   |        }t        j                  |d      5 }|j	                  dddd       d	|d   d
d
 d
d
d
       |j                  d       t        j                  |d      5 }|d   j                  }|j                         }|dk(  sJ i t        |      D ]"  }|j                  |      }||j                  <   $ fd}|j                  |       d
d
d
       y
# 1 sw Y   xY w# 1 sw Y   y
xY w)z%H5Dchunk_iter() for chunk informationr   r  r   r  rF  ru   r  r  r   Nr  r   c                     | j                      }| j                   |j                   k(  sJ | j                  |j                  k(  sJ | j                  |j                  k(  sJ | j                  |j                  k(  sJ y r   )r  r  r  rI   )
chunk_infoknowncis     r   callbackz!test_chunk_iter.<locals>.callbackA  sw    z../E**e.@.@@@@))U->->>>>))U->->>>>??ejj000r   )r  r  rv   r   r)   r  r   r  r  r  r  
chunk_iter)	r  r  r   r  
num_chunksr  r  r  r  s	           @r   test_chunk_iterr  +  s   
 
)C	3	 	z($O&	! HHQK	3	 "y||((*
S   z" 	%A$$Q'B"$Br	%	1 	!#" " 
" "s   C*2A/C6*C36C?c                 b    | j                  dd      }|j                  J |j                  J y )Nr   r   rY   )r)   r6   r*  )r   r.   s     r   test_empty_shaper  K  s7    		%	%gW	%	=B88;;r   c                     ddl m}   |        }t        j                  |d      5 }|j	                  dd       d d d        |j                  d       t        j                  |d      5 }|d   j                  J |d   j                  j                         J |d   j                  j                         dk(  sJ 	 d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)Nr   r  r   r   r  rY   r  )
r  r  rv   r   r)   r  r   r   
get_offsetget_storage_size)r  r  r  r  s       r   test_zero_storage_sizer  Q  s    
)C	3	 4G734 HHQK	3	 77|""***7|))+3337|//1Q6667 7	4 47 7s   C'ACCCc                    t        j                  t         j                        j                  t        j                  t         j                        j                  dz   g}| j	                  d|t         j
                        }|j                  t        j                  t         j
                        k(  sJ t         j                  j                  |d d  t        j                  |t         j
                               ||d d  t         j                  j                  |d d  t        j                  |t         j
                               y )Nr   rh  r1  rY   )
rQ   iinfor   maxr)   uint64rP   r   r   r   )r   ro   r.   s      r   test_python_int_uint64r  _  s    HHRXX""BHHRXX$6$:$:Q$>?D 
	%	%cBII	%	FB88rxx		****JJ!!"Q%$bii)HI BqEJJ!!"Q%$bii)HIr   c                     | j                  ddt        j                        }t        j                  j	                  dd      }||d d g ddf<   y )	Nro   )r   r  re   rY      )r   r|   re   r  )r   re   r(   .)r)   rQ   r  r  r  )r   r   blocks      r   test_setitem_fancy_indexingr  m  sG    

&
&v|288
&
LCIIc	2E"C9cr   c                  r    t        t        d            5 } | d   d   dk(  sJ 	 d d d        y # 1 sw Y   y xY w)Nzvlen_string_dset.h5DS1r   s   Partingr   r   r   s    r   test_vlen_spacepadr  t  s>    	 !67	8 )Ax{j((() ) )   -6c                  r    t        t        d            5 } | d   d   dk(  sJ 	 d d d        y # 1 sw Y   y xY w)Nzvlen_string_dset_utc.h5ds1r   s   2009-12-20T10:16:18.662409Zr  r  s    r   test_vlen_nulltermr  y  s?    	 !:;	< =x{<<<<= = =r  c                     d}| j                  ddt        j                  |d      }t        |      |j                  v sJ y )N   ro   ru   T)r6   rP   rq  allow_unknown_filter)r)   rQ   r  r,   _filters)r   fake_filter_idr.   s      r   test_allow_unknown_filterr  ~  sE    N		%	%hbhhN! 
& 
B ~"++---r   c            
         ddl m}   |        }t        j                  |d      5 }|j	                  dddddd	d
      }|j
                  j                         j                         }|j
                  j                         j                         dd |k7  sJ |dk(  sJ 	 ddd       |j                  d       t        j                  |d      5 }|j                  dddddd      }|j
                  j                         j                         }|j
                  j                         j                         dd |k7  sJ |dk(  sJ 	 ddd       y# 1 sw Y   xY w# 1 sw Y   yxY w)z2Chunk cache configuration for individual datasets.r   r  r   rh  )rF   r   )r   r(   r      r^    )r6   r   rP   rdcc_nbytesrdcc_w0rdcc_nslotsr   N)r  r  r^  r    0 q=
ףp?  )r6   rP   r  r  r  )r  r  r  )r  r  rv   r   r)   r   r  get_chunk_cache	get_cacher  r  )r  r  r  r.   ds_chunk_cacher  s         r   test_dset_chunk_cacher    s`   
)C	3	 =  xd'# ! G //1AACww'')335ab9^KKK!<<<<= HHQK	3	 >  xt'3 ! H //1AACvv&&(224QR8NJJJ!====> >= => >s   A8EA7EEE"c                       e Zd ZdZd Zd Zy)TestCommutativez|
    Test the symmetry of operators, at least with the numpy types.
    Issue: https://github.com/h5py/h5py/issues/1947
    c                    d}| j                   j                  d|t        t        j                  j
                  |       }t        j                  |d         }t        j                  ||k(  ||k(  k(        sJ t        j                  ||k7  ||k7  k(        sJ d}t        j                  |      |z   }t        j                  ||k(  ||k(  k(        sJ t        j                  ||k7  ||k7  k(        sJ y)z
        Create a h5py dataset, extract one element convert to numpy
        Check that it returns symmetric response to == and !=
        r   r   r  rP   ro   r  gMbP?N)	r   r)   r  rQ   r  r  r  r<  nanmax)r   r6   r8   valdeltanvals         r   test_numpy_commutativez&TestCommutative.test_numpy_commutative  s    
 vv$$VU%*,))..%*@ % B
 jjd$vvsd{4555vvsd{4555 yyu$vvtt|6777vvtt|6777r   c                     d}| j                   j                  d|t        t        j                  j
                  |       }t        d      }||k(  ||k(  k(  sJ ||k7  ||k7  k(  sJ y)z
        Create a h5py dataset and check basetype compatibility.
        Check that operation is symmetric, even if it is potentially
        not meaningful.
        r  r  r  r[  N)r   r)   r  rQ   r  r  )r   r6   r8   r  s       r   test_basetype_commutativez)TestCommutative.test_basetype_commutative  sp     vv$$VU%*,))..%*@ % B
 Bit---t---r   N)r   r    r!   r0   r  r  r"   r   r   r  r    s    80.r   r  c                       e Zd ZdZd Zd Zy)TestVirtualPrefixz%
    Test setting virtual prefix
    c                 D   d}d}| j                   j                  d|t        t        j                  j
                  | |      }t        j                  |j                  j                         j                         j                               j                         }||k(  sJ y )Nr  /path/to/virtualr  )rP   ro   virtual_prefix)r   r)   r  rQ   r  r  r  r  r   r  get_virtual_prefixr  r  )r   r6   r  r8   virtual_prefix_readbacks        r   test_virtual_prefix_createz,TestVirtualPrefix.test_virtual_prefix_create  s    +vv$$VU%*,))..%*@6D % F #*,,tww/G/G/I/\/\/^/e/e/g"h"q"q"s&.888r   c                 |   d}| j                   j                  ddd|      }t        j                  |j                  j                         j                         j                               j                         }| j                  ||       | j                  |t               | j                  |j                  d       y )Nr  r&   r{   r   )r  )r   r  r  r  r   r  r  r  r  r5   r*   r	   r6   )r   r  r8   r  s       r   test_virtual_prefix_requirez-TestVirtualPrefix.test_virtual_prefix_require  s    +vv%%eWcN%["),,tww/G/G/I/\/\/^/e/e/g"h"q"q"s)@AdG,W-r   N)r   r    r!   r0   r  r  r"   r   r   r  r    s    9.r   r  )`r0   r  r  r{  numpyrQ   r\   r^   warningscommonr   r   
data_filesr   rv   r   r   r	   h5py._hl.baser
   r   r   r   h5py.h5py_warningsr   r   h5py._hl.selectionsry  
selectionsrL  r   r$   r2   rl   r   r   r   r  rE  r   r   rS  r   r   r  ru  r  r  rb  rd  ri   filtersr  rm  r  r  r  r  r  r  r  r  r  r8  rO  rk  ru  r  r  r  r  r  r  r  r  r_   r  r@  r$  rB  rL  rP  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r"   r   r   <module>r     sO    	 
       * % % 5  5   ! !( 
-{ 
-D,k D,LVF[ VFr." ."`%# %#P@6 @6F@D @DF#B+ #BL !HXXqMXXqM
CLZZZZT2C8T2C8T(#.T(#.T#) &&
8+ 8 6,,,.HI)7[ )7 J)7X 6,,,.HI$W+ $W J$WN 5+++-CD6K 6 E6: 6,,,.EF	B[ 	B G	B 9DLL///1KL	& 	& M	& <t||2224QR); ) S) = 3 335STn0K n0 Un0bj-; j-Z):[ ):X2[ 2:"M "MLA4 A4H0 0&.k ..{ *P4+ P4fd@; d@N:; :$J{ J4D D6C[ C$2K 2: ))LL##z18 *  
-G[ -G`? ?,9 9FR{ FRR8+ 8  t||..*<4668 t||..*< r//;>p4<<CbCbepCp[]"]":7J#)
=
.>,+.k +.Z. .r   