Module Expr Str ImportFrom alias Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias Assign NameStore Str ClassDef bases NameLoad body Expr Str Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad Str NameLoad NameLoad NameLoad NameLoad NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str Assign AttributeStore NameLoad attr NameLoad Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr CompareEq Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num If CompareGt NameLoad Num body If CompareEq NameLoad Num body Assign AttributeStore NameLoad attr Call AttributeLoad Call NameLoad AttributeLoad NameLoad attr attr Num orelse Raise Call NameLoad Str orelse Raise Call NameLoad Str Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore BinOpSub Call NameLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr If CompareNotEq NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr NameLoad For NameStore Call NameLoad NameLoad body If BoolOpAnd CompareNotEq NameLoad AttributeLoad NameLoad attr CompareNotEq SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad If CompareGt AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults kwarg body Expr Str Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index NameLoad Num Assign NameStore Call NameLoad Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore ListComp Call NameLoad Num NameLoad Num comprehension NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad For NameStore Call NameLoad NameLoad NameLoad BinOpMult NameLoad NameLoad body Assign NameStore BinOpAdd NameLoad BinOpMult NameLoad NameLoad If CompareGt NameLoad NameLoad body Assign NameStore NameLoad Assign SubscriptStore NameLoad Index NameLoad Call NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign NameStore BinOpMult Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad AttributeLoad AttributeLoad NameLoad attr attr Return TupleLoad NameLoad NameLoad decorator_list decorator_list
N/A N/A Here is defined the EArray class. __future__ absolute_import N/A numpy utils convert_to_np_atom2 SizeType carray CArray six.moves range N/A obversion 1.4 EArray N/A CArray N/A N/A This class represents extendable, homogeneous datasets in an HDF5 file.

    The main difference between an EArray and a CArray (see
    :ref:`CArrayClassDescr`), from which it inherits, is that the former
    can be enlarged along one of its dimensions, the *enlargeable
    dimension*.  That means that the :attr:`Leaf.extdim` attribute (see
    :class:`Leaf`) of any EArray instance will always be non-negative.
    Multiple enlargeable dimensions might be supported in the future.

    New rows can be added to the end of an enlargeable array by using the
    :meth:`EArray.append` method.

    Parameters
    ----------
    parentnode
        The parent :class:`Group` object.

        .. versionchanged:: 3.0
           Renamed from *parentNode* to *parentnode*.

    name : str
        The name of this node in its parent group.

    atom
        An `Atom` instance representing the *type* and *shape*
        of the atomic objects to be saved.

    shape
        The shape of the new array.  One (and only one) of
        the shape dimensions *must* be 0.  The dimension being 0
        means that the resulting `EArray` object can be extended
        along it.  Multiple enlargeable dimensions are not supported
        right now.

    title
        A description for this node (it sets the ``TITLE``
        HDF5 attribute on disk).

    filters
        An instance of the `Filters` class that provides information
        about the desired I/O filters to be applied during the life
        of this object.

    expectedrows
        A user estimate about the number of row elements that will
        be added to the growable dimension in the `EArray` node.
        If not provided, the default value is ``EXPECTED_ROWS_EARRAY``
        (see ``tables/parameters.py``).  If you plan to create either
        a much smaller or a much bigger `EArray` try providing a guess;
        this will optimize the HDF5 B-Tree creation and management
        process time and the amount of memory used.

    chunkshape
        The shape of the data chunk to be read or written in a single
        HDF5 I/O operation.  Filters are applied to those chunks of data.
        The dimensionality of `chunkshape` must be the same as that of
        `shape` (beware: no dimension should be 0 this time!).
        If ``None``, a sensible value is calculated based on the
        `expectedrows` parameter (which is recommended).

    byteorder
        The byteorder of the data *on disk*, specified as 'little' or
        'big'. If this is not specified, the byteorder is that of the
        platform.

    Examples
    --------

    See below a small example of the use of the `EArray` class.  The
    code is available in ``examples/earray1.py``::

        import tables
        import numpy

        fileh = tables.open_file('earray1.h5', mode='w')
        a = tables.StringAtom(itemsize=8)

        # Use ``a`` as the object type for the enlargeable array.
        array_c = fileh.create_earray(fileh.root, 'array_c', a, (0,),
                                      "Chars")
        array_c.append(numpy.array(['a'*2, 'b'*4], dtype='S8'))
        array_c.append(numpy.array(['a'*6, 'b'*8, 'c'*10], dtype='S8'))

        # Read the string ``EArray`` we have created on disk.
        for s in array_c:
            print('array_c[%s] => %r' % (array_c.nrow, s))
        # Close the file.
        fileh.close()

    The output for the previous script is something like::

        array_c[0] => 'aa'
        array_c[1] => 'bbbb'
        array_c[2] => 'aaaaaa'
        array_c[3] => 'bbbbbbbb'
        array_c[4] => 'cccccccc'

     N/A _c_classid EARRAY __init__ N/A N/A self parentnode name atom shape title filters expectedrows chunkshape byteorder _log N/A None None None None None None True N/A N/A N/A expectedrows None N/A N/A expectedrows N/A N/A N/A parentnode _v_file params N/A EXPECTED_ROWS_EARRAY N/A N/A self _v_expectedrows expectedrows N/A The expected number of rows to be stored in the array. N/A N/A N/A N/A super EArray self __init__ parentnode name atom shape title filters chunkshape byteorder _log N/A _g_create N/A N/A self N/A N/A N/A Create a new array in file (specific part). N/A zerodims N/A N/A numpy sum N/A N/A N/A numpy array N/A self shape 0 N/A N/A zerodims 0 N/A N/A N/A zerodims 1 N/A N/A N/A self extdim N/A N/A N/A list N/A self shape index 0 N/A N/A N/A NotImplementedError Multiple enlargeable (0-)dimensions are not supported. N/A N/A N/A ValueError When creating EArrays, you need to set one of the dimensions of the Atom instance to zero. N/A N/A N/A self _g_create_common N/A self _v_expectedrows N/A _check_shape_append N/A N/A self nparr N/A N/A N/A Test that nparr shape is consistent with underlying EArray. N/A myrank N/A len N/A self shape N/A narank N/A N/A len N/A nparr shape N/A len N/A N/A self atom shape N/A N/A myrank narank N/A N/A N/A ValueError N/A the ranks of the appended object (%d) and the ``%s`` EArray (%d) differ N/A narank N/A self _v_pathname myrank N/A i N/A range myrank N/A N/A N/A N/A i N/A self extdim N/A N/A N/A self shape N/A i N/A N/A nparr shape N/A i N/A N/A N/A ValueError N/A the shapes of the appended object and the ``%s`` EArray differ in non-enlargeable dimension %d N/A N/A self _v_pathname i N/A append N/A N/A self sequence N/A N/A N/A Add a sequence of data to the end of the dataset.

        The sequence must have the same type as the array; otherwise a
        TypeError is raised. In the same way, the dimensions of the
        sequence must conform to the shape of the array, that is, all
        dimensions must match, with the exception of the enlargeable
        dimension, which can be of any length (even 0!).  If the shape
        of the sequence is invalid, a ValueError is raised.

         N/A N/A N/A self _g_check_open N/A N/A N/A N/A self _v_file _check_writable N/A nparr N/A convert_to_np_atom2 sequence N/A self atom N/A N/A N/A self _check_shape_append nparr N/A N/A N/A nparr size 0 N/A N/A N/A N/A self _append nparr N/A _g_copy_with_stats N/A N/A self group name start stop step title filters chunkshape _log N/A kwargs N/A N/A Private part of Leaf.copy() for each kind of leaf. N/A N/A start stop step N/A N/A self _process_range_read start stop step N/A maindim N/A self maindim N/A shape N/A list N/A self shape N/A N/A shape N/A maindim 0 N/A nrows N/A len N/A range start stop step N/A object N/A EArray group name atom N/A self atom shape shape title title filters filters expectedrows nrows chunkshape chunkshape _log _log N/A nrowsinbuf N/A self nrowsinbuf N/A slices N/A N/A slice 0 dim 1 N/A dim N/A self shape N/A N/A self _v_convert False N/A start2 N/A range start stop N/A step nrowsinbuf N/A N/A stop2 N/A start2 N/A step nrowsinbuf N/A N/A stop2 stop N/A N/A stop2 stop N/A N/A slices N/A maindim N/A slice start2 stop2 step N/A N/A N/A object _append N/A N/A self __getitem__ N/A tuple slices N/A N/A self _v_convert True N/A nbytes N/A N/A N/A numpy prod N/A self shape dtype SizeType N/A N/A self atom itemsize N/A N/A object nbytes N/A N/A