Hierarchy definition classes

The Node class

Node instance variables - location dependent

Node instance variables - location independent

Node instance variables - attribute shorthands

Node methods - hierarchy manipulation

Node methods - attribute handling

The Group class

Group properties

Group methods

Important

Caveat: The following methods are documented for completeness, and they can be used without any problem. However, you should use the high-level counterpart methods in the File class (see The File Class, because they are most used in documentation and examples, and are a bit more powerful than those exposed here.

The following methods are provided in addition to those in Node (see The Node class):

Group special methods

Following are described the methods that automatically trigger actions when a Group instance is accessed in a special way.

This class defines the __setattr__(), __getattr__() and __delattr__() methods, and they set, get and delete ordinary Python attributes as normally intended. In addition to that, __getattr__() allows getting child nodes by their name for the sake of easy interaction on the command line, as long as there is no Python attribute with the same name. Groups also allow the interactive completion (when using readline) of the names of child nodes. For instance:

# get a Python attribute
nchild = group._v_nchildren

# Add a Table child called 'table' under 'group'.
h5file.create_table(group, 'table', my_description)
table = group.table          # get the table child instance
group.table = 'foo'          # set a Python attribute

# (PyTables warns you here about using the name of a child node.)
foo = group.table            # get a Python attribute
del group.table              # delete a Python attribute
table = group.table          # get the table child instance again

The Leaf class

Leaf properties

Leaf.size_in_memory

The size of this leaf’s data in bytes when it is fully loaded into memory.

Leaf instance variables - aliases

The following are just easier-to-write aliases to their Node (see The Node class) counterparts (indicated between parentheses):

Leaf methods