ó
\c           @@  s@  d  Z  d d l m Z d d l Z d d l Z d d l Z d d l m Z m	 Z	 d e	 f d „  ƒ  YZ
 d e	 f d	 „  ƒ  YZ d
 e	 f d „  ƒ  YZ d e	 f d „  ƒ  YZ e j e j j d k d ƒ d e	 f d „  ƒ  Yƒ Z d e	 f d „  ƒ  YZ e j e j j d k d ƒ d e	 f d „  ƒ  Yƒ Z d e	 f d „  ƒ  YZ d S(   sÛ  
    Tests the h5py.Dataset.__getitem__ method.

    This module does not specifically test type conversion.  The "type" axis
    therefore only tests objects which interact with the slicing system in
    unreliable ways; for example, compound and array types.

    See test_dataset_getitem_types for type-conversion tests.

    Tests are organized into TestCases by dataset shape and type.  Test
    methods vary by slicing arg type.

    1. Dataset shape:
        Empty
        Scalar
        1D
        3D

    2. Type:
        Float
        Compound
        Array

    3. Slicing arg types:
        Ellipsis
        Empty tuple
        Regular slice
        Indexing
        Index list
        Boolean mask
        Field names
i    (   t   absolute_importNi   (   t   utt   TestCaset	   TestEmptyc           B@  sk   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z RS(   c         C@  s–   t  j |  ƒ t j j t j j ƒ } t j j j ƒ  } | j	 d ƒ t j
 j |  j j d | | ƒ } t j | ƒ |  _ t j t j d ƒ ƒ |  _ d  S(   Ni
   t   xt   S10(   R   t   setUpt   h5pyt   h5st   createt   NULLt   h5tt   C_S1t   copyt   set_sizet   h5dt   ft   idt   Datasett   dsett   Emptyt   npt   dtypet	   empty_obj(   t   selft   sidt   tidt   dsid(    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR   6   s    !c         C@  s   |  j  |  j j d ƒ d S(   s    Verify number of dimensions i    N(   t   assertEqualsR   t   ndim(   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt	   test_ndim?   s    c         C@  s   |  j  |  j j d ƒ d S(   s    Verify shape N(   R   R   t   shapet   None(   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt
   test_shapeC   s    c         C@  s   |  j  |  j j d ƒ d S(   s    Verify shape N(   R   R   t   sizeR    (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt	   test_sizeG   s    c         C@  s   |  j  |  j d |  j ƒ d S(   s    Ellipsis -> ValueError .N(   R   R   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_ellipsisK   s    c         C@  s   |  j  |  j d |  j ƒ d S(   s    () -> IOError N(    (   R   R   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt
   test_tupleO   s    c         C@  s(   |  j  t ƒ  |  j d d !Wd QXd S(   s    slice -> ValueError i    i   N(   t   assertRaisest
   ValueErrorR   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt
   test_sliceS   s    c         C@  s%   |  j  t ƒ  |  j d Wd QXd S(   s    index -> ValueError i    N(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt
   test_indexX   s    c         C@  s.   |  j  t ƒ  |  j d d d g Wd QXd S(   s    index list -> ValueError i   i   i   N(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_indexlist]   s    c         C@  s:   t  j t d d ƒ} |  j t ƒ  |  j | Wd QXd S(   s    mask -> ValueError R   t   boolN(   R   t   arrayt   TrueR&   R'   R   (   R   t   mask(    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt	   test_maskb   s    c         C@  s%   |  j  t ƒ  |  j d Wd QXd S(   s    field name -> ValueError t   fieldN(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_fieldnamesh   s    (   t   __name__t
   __module__R   R   R!   R#   R$   R%   R(   R)   R*   R/   R1   (    (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR   4   s   											t   TestScalarFloatc           B@  sb   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z RS(
   c         C@  sG   t  j |  ƒ t j d d d ƒ|  _ |  j j d d |  j ƒ|  _ d  S(   Ng     @E@R   R   R   t   data(   R   R   R   R,   R5   R   t   create_datasetR   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR   p   s    c         C@  s   |  j  |  j j d ƒ d S(   s    Verify number of dimensions i    N(   R   R   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR   u   s    c         C@  s   |  j  |  j j t ƒ  ƒ d S(   s    Verify shape N(   R   R   R   t   tuple(   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR!   y   s    c         C@  s$   |  j  d } |  j | |  j ƒ d S(   s    Ellipsis -> scalar ndarray .N(   R   t   assertArrayEqualR5   (   R   t   out(    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR$   }   s    c         C@  s*   |  j  d } |  j | |  j j ƒ  ƒ d S(   s    () -> bare item N(    (   R   R8   R5   t   item(   R   R9   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR%   ‚   s    c         C@  s(   |  j  t ƒ  |  j d d !Wd QXd S(   s    slice -> ValueError i    i   N(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR(   ‡   s    c         C@  s%   |  j  t ƒ  |  j d Wd QXd S(   s    index -> ValueError i    N(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR)   Œ   s    c         C@  s.   |  j  t ƒ  |  j d d d g Wd QXd S(   s    index list -> ValueError i   i   i   N(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR*   ’   s    c         C@  s:   t  j t d d ƒ} |  j t ƒ  |  j | Wd QXd S(   s    mask -> ValueError R   R+   N(   R   R,   R-   R&   R'   R   (   R   R.   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR/   ˜   s    c         C@  s%   |  j  t ƒ  |  j d Wd QXd S(   s&    field name -> ValueError (no fields) R0   N(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR1   ž   s    (   R2   R3   R   R   R!   R$   R%   R(   R)   R*   R/   R1   (    (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR4   n   s   									t   TestScalarCompoundc           B@  sb   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z RS(
   c         C@  sP   t  j |  ƒ t j d d d d d g ƒ|  _ |  j j d d |  j ƒ|  _ d  S(   Ng     @E@iŠÿÿÿt   HelloR   t   aR   t   bt   it   cs   |S10R   R5   (   g     @E@iŠÿÿÿR<   (   R=   R   (   R>   R?   (   R@   s   |S10(   R   R   R   R,   R5   R   R6   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR   ¦   s    !c         C@  s   |  j  |  j j d ƒ d S(   s    Verify number of dimensions i    N(   R   R   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR   «   s    c         C@  s   |  j  |  j j t ƒ  ƒ d S(   s    Verify shape N(   R   R   R   R7   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR!   ¯   s    c         C@  sV   |  j  d } |  j | t j ƒ |  j | j |  j j ƒ |  j | j |  j j ƒ d S(   s    Ellipsis -> scalar ndarray .N(   R   t   assertIsInstanceR   t   ndarrayt   assertEqualR   R5   R   (   R   R9   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR$   ³   s    c         C@  s=   |  j  d } |  j | t j ƒ |  j | j |  j j ƒ d S(   s    () -> np.void instance N(    (   R   RA   R   t   voidRC   R   R5   (   R   R9   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR%   »   s    c         C@  s(   |  j  t ƒ  |  j d d !Wd QXd S(   s    slice -> ValueError i    i   N(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR(   Á   s    c         C@  s%   |  j  t ƒ  |  j d Wd QXd S(   s    index -> ValueError i    N(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR)   Æ   s    c         C@  s.   |  j  t ƒ  |  j d d d g Wd QXd S(   s    index list -> ValueError i   i   i   N(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR*   Ì   s    c         C@  s:   t  j t d d ƒ} |  j t ƒ  |  j | Wd QXd S(   s    mask -> ValueError  R   R+   N(   R   R,   R-   R&   R'   R   (   R   R.   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR/   Ò   s    c         C@  s;   |  j  d } |  j | t j ƒ |  j | |  j  d ƒ d S(   s    field name -> bare value R=   N(   R   RA   R   t   float32RC   (   R   R9   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR1   Ù   s    (   R2   R3   R   R   R!   R$   R%   R(   R)   R*   R/   R1   (    (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR;   ¤   s   									t   TestScalarArrayc           B@  sb   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z RS(
   c         C@  su   t  j |  ƒ t j d ƒ |  _ t j d d d g d d	 ƒ|  _ |  j j d
 d d |  j ƒ|  _	 |  j |  j	 d <d  S(   Ns   (3,2)fgš™™™™™	@i‰ÿÿÿi*   g33333óX@g…ëQ¸	@i    R   R   R   .(   gš™™™™™	@i‰ÿÿÿ(   i*   g33333óX@(   g…ëQ¸	@i    (    (
   R   R   R   R   t   dtR,   R5   R   R6   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR   â   s
    !!c         C@  s0   |  j  |  j j d ƒ |  j  |  j j d ƒ d S(   s    Verify number of dimensions i   i    N(   R   R5   R   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR   é   s    c         C@  s3   |  j  |  j j d ƒ |  j  |  j j t ƒ  ƒ d S(   s    Verify shape i   i   N(   i   i   (   R   R5   R   R   R7   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR!   î   s    c         C@  s$   |  j  d } |  j | |  j ƒ d S(   s2    Ellipsis -> ndarray promoted to underlying shape .N(   R   R8   R5   (   R   R9   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR$   ó   s    c         C@  s$   |  j  d } |  j | |  j ƒ d S(   s    () -> same as ellipsis .N(   R   R8   R5   (   R   R9   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR%   ø   s    c         C@  s(   |  j  t ƒ  |  j d d !Wd QXd S(   s    slice -> ValueError i    i   N(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR(   ý   s    c         C@  s%   |  j  t ƒ  |  j d Wd QXd S(   s    index -> ValueError i    N(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR)     s    c         C@  s%   |  j  t ƒ  |  j g  Wd QXd S(   s    index list -> ValueError N(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR*     s    c         C@  s:   t  j t d d ƒ} |  j t ƒ  |  j | Wd QXd S(   s    mask -> ValueError R   R+   N(   R   R,   R-   R&   R'   R   (   R   R.   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR/     s    c         C@  s%   |  j  t ƒ  |  j d Wd QXd S(   s&    field name -> ValueError (no fields) R0   N(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR1     s    (   R2   R3   R   R   R!   R$   R%   R(   R)   R*   R/   R1   (    (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyRF   à   s   									i   i   i   s   HDF5 1.8.7+ requiredt   Test1DZeroFloatc           B@  st   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 e
 j d „  ƒ Z d	 „  Z d
 „  Z RS(   c         C@  sG   t  j |  ƒ t j d d d ƒ|  _ |  j j d d |  j ƒ|  _ d  S(   Ni    R   R   R   R5   (   i    (   R   R   R   t   onesR5   R   R6   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR     s    c         C@  s   |  j  |  j j d ƒ d S(   s    Verify number of dimensions i   N(   R   R   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR      s    c         C@  s   |  j  |  j j d ƒ d S(   s    Verify shape i    N(   i    (   R   R   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR!   $  s    c         C@  s$   |  j  |  j |  j t j d ƒ d S(   s'    Ellipsis -> ndarray of matching shape .N(   t   assertNumpyBehaviorR   R5   R   t   s_(   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR$   (  s    c         C@  s$   |  j  |  j |  j t j d ƒ d S(   s    () -> same as ellipsis N(    (   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR%   ,  s    c         C@  s'   |  j  |  j |  j t j d d !ƒ d S(   s     slice -> ndarray of shape (0,) i    i   N(   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR(   0  s    c         C@  s'   |  j  |  j |  j t j d d !ƒ d  S(   Ni   i   (   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_slice_stop_less_than_start4  s    c         C@  s%   |  j  t ƒ  |  j d Wd QXd S(   s    index -> out of range i    N(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR)   8  s    c         C@  s%   |  j  t ƒ  |  j g  Wd QXd S(   s    index list N(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR*   ?  s    c         C@  s9   t  j d d d ƒ} |  j |  j |  j t  j | ƒ d S(   s#    mask -> ndarray of matching shape i    R   R+   N(   i    (   R   RI   RJ   R   R5   RK   (   R   R.   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR/   E  s    c         C@  s%   |  j  t ƒ  |  j d Wd QXd S(   s&    field name -> ValueError (no fields) R0   N(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR1   J  s    (   R2   R3   R   R   R!   R$   R%   R(   RL   R)   R   t   expectedFailureR*   R/   R1   (    (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyRH     s   									t   Test1DFloatc           B@  s1  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 e j d „  ƒ Z d „  Z d „  Z d „  Z d „  Z d „  Z e j d „  ƒ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  d „  Z! d „  Z" RS(   c         C@  sJ   t  j |  ƒ t j d ƒ j d ƒ |  _ |  j j d d |  j ƒ|  _ d  S(   Ni   R   R   R5   (	   R   R   R   t   aranget   astypeR5   R   R6   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR   R  s    c         C@  s   |  j  |  j j d ƒ d S(   s    Verify number of dimensions i   N(   R   R   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR   W  s    c         C@  s   |  j  |  j j d ƒ d S(   s    Verify shape i   N(   i   (   R   R   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR!   [  s    c         C@  s$   |  j  |  j |  j t j d ƒ d  S(   N.(   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR$   _  s    c         C@  s$   |  j  |  j |  j t j d ƒ d  S(   N(    (   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR%   b  s    c         C@  s'   |  j  |  j |  j t j d d !ƒ d  S(   Ni    i   (   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_slice_simplee  s    c         C@  s'   |  j  |  j |  j t j d d !ƒ d  S(   Ni   (   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_slice_zerosizeh  s    c         C@  s-   |  j  |  j |  j t j d d d … ƒ d  S(   Ni   i   i   (   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_slice_stridesk  s    c         C@  s-   |  j  |  j |  j t j d d d … ƒ d  S(   Niøÿÿÿiþÿÿÿi   (   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_slice_negindexesn  s    c         C@  s'   |  j  |  j |  j t j d d !ƒ d  S(   Ni   i   (   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyRL   q  s    c         C@  s-   |  j  |  j |  j t j d d d … ƒ d  S(   Nid   i  i   (   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_slice_outofranget  s    c         C@  s.   |  j  t ƒ  |  j d d d … Wd QXd S(   s    we disallow negative steps Niÿÿÿÿ(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_slice_backwardsw  s    c         C@  s-   |  j  |  j |  j t j d  d  d … ƒ d  S(   Ni    (   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_slice_zerostride|  s    c         C@  s$   |  j  |  j |  j t j d ƒ d  S(   Ni   (   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_index_simple  s    c         C@  s$   |  j  |  j |  j t j d ƒ d  S(   Niüÿÿÿ(   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_index_neg‚  s    c         C@  s%   |  j  t ƒ  |  j d  Wd  QXd  S(   N(   R&   t	   TypeErrorR   R    (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_index_none†  s    c         C@  s%   |  j  t ƒ  |  j i  Wd QXd S(   s    Illegal slicing argument N(   R&   RZ   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_index_illegalŒ  s    c         C@  s%   |  j  t ƒ  |  j d Wd  QXd  S(   Nid   (   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_index_outofrange“  s    c         C@  s-   |  j  |  j |  j t j d d d g ƒ d  S(   Ni   i   i   (   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_indexlist_simple—  s    c         C@  s-   |  j  |  j |  j t j d g d f ƒ d  S(   Ni    .(   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt$   test_indexlist_single_index_ellipsisš  s    c         C@  s6   |  j  |  j |  j t j t j d g ƒ d f ƒ d  S(   Ni    .(   RJ   R   R5   R   RK   R,   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt/   test_indexlist_numpyarray_single_index_ellipsis  s    c         C@  s<   |  j  |  j |  j t j t j d d d g ƒ d f ƒ d  S(   Ni   i   i   .(   RJ   R   R5   R   RK   R,   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt"   test_indexlist_numpyarray_ellipsis   s    c         C@  s$   |  j  |  j |  j t j g  ƒ d  S(   N(   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_indexlist_empty¤  s    c         C@  s(   |  j  t ƒ  |  j d g Wd  QXd  S(   Nid   (   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_indexlist_outofrange©  s    c         C@  s.   |  j  t ƒ  |  j d d d g Wd QXd S(   s8    we require index list values to be strictly increasing i   i   i   N(   R&   RZ   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_indexlist_nonmonotonic­  s    c         C@  s.   |  j  t ƒ  |  j d d d g Wd QXd S(   s!    we forbid repeated index values i   i   N(   R&   RZ   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_indexlist_repeated²  s    c         C@  s-   |  j  |  j |  j t j |  j d k ƒ d  S(   Niœÿÿÿ(   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_mask_true·  s    c         C@  s-   |  j  |  j |  j t j |  j d k ƒ d  S(   Nid   (   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_mask_falseº  s    c         C@  s-   |  j  |  j |  j t j |  j d k ƒ d  S(   Ni   (   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_mask_partial½  s    c      	   C@  s4   |  j  t ƒ  |  j t j d d d ƒWd QXd S(   s4    we require the boolean mask shape to match exactly i   R   R+   N(   i   (   R&   RZ   R   R   RI   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   test_mask_wrongsizeÀ  s    c         C@  s%   |  j  t ƒ  |  j d Wd QXd S(   s&    field name -> ValueError (no fields) R0   N(   R&   R'   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR1   Å  s    (#   R2   R3   R   R   R!   R$   R%   RQ   RR   RS   RT   RL   RU   RV   RW   RX   RY   R[   R   RM   R\   R]   R^   R_   R`   Ra   Rb   Rc   Rd   Re   Rf   Rg   Rh   Ri   R1   (    (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyRN   P  s>   																												t   Test2DZeroFloatc           B@  s5   e  Z d  „  Z d „  Z d „  Z e j d „  ƒ Z RS(   c         C@  sG   t  j |  ƒ t j d d d ƒ|  _ |  j j d d |  j ƒ|  _ d  S(   Ni    i   R   R   R   R5   (   i    i   (   R   R   R   RI   R5   R   R6   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR   Î  s    c         C@  s   |  j  |  j j d ƒ d S(   s    Verify number of dimensions i   N(   R   R   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR   Ó  s    c         C@  s   |  j  |  j j d ƒ d S(   s    Verify shape i    i   N(   i    i   (   R   R   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR!   ×  s    c         C@  s9   |  j  |  j |  j t j d d … d d d g f ƒ d S(   s    see issue #473 Ni    i   i   (   RJ   R   R5   R   RK   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR*   Û  s    (   R2   R3   R   R   R!   R   RM   R*   (    (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyRj   Ë  s   			t   TestVeryLargeArrayc           B@  s5   e  Z d  „  Z e j e j d k  d ƒ d „  ƒ Z RS(   c         C@  s2   t  j |  ƒ |  j j d d d d f ƒ|  _ d  S(   NR   R   i   i   i   i €  i   (   R   R   R   R6   R   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR   ã  s    i   i   s&   Maximum integer size >= 2**31 requiredc         C@  s   |  j  |  j j d ƒ d  S(   Ni   i   I   €    (   RC   R   R"   (   R   (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyR#   ç  s    I   €    (   R2   R3   R   R   t   skipIft   syst   maxsizeR#   (    (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyRk   á  s   	(   i   i   i   (   i   i   i   (   t   __doc__t
   __future__R    Rm   t   numpyR   R   t   commonR   R   R   R4   R;   RF   t
   skipUnlesst   versiont   hdf5_version_tupleRH   RN   Rj   Rk   (    (    (    sA   lib/python2.7/site-packages/h5py/tests/hl/test_dataset_getitem.pyt   <module>)   s   :6<87{