Skip to content

Latest commit

 

History

History
242 lines (151 loc) · 5.61 KB

hierarchy_classes.rst

File metadata and controls

242 lines (151 loc) · 5.61 KB

tables

Hierarchy definition classes

The Node class

Node

Node instance variables - location dependent

Node._v_parent

Node instance variables - location independent

Node._v_attrs

Node._v_isopen

Node instance variables - attribute shorthands

Node._v_title

Node methods - hierarchy manipulation

Node._f_close

Node._f_copy

Node._f_isvisible

Node._f_move

Node._f_remove

Node._f_rename

Node methods - attribute handling

Node._f_delattr

Node._f_getattr

Node._f_setattr

The Group class

Group

Group properties

Group._v_nchildren

Group._v_filters

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 FileClassDescr, 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 NodeClassDescr):

Group._f_close

Group._f_copy

Group._f_copy_children

Group._f_get_child

Group._f_iter_nodes

Group._f_list_nodes

Group._f_walk_groups

Group._f_walknodes

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

Group.__contains__

Group.__delattr__

Group.__getattr__

Group.__iter__

Group.__repr__

Group.__setattr__

Group.__str__

The Leaf class

Leaf

Leaf properties

Leaf.chunkshape

Leaf.ndim

Leaf.filters

Leaf.maindim

Leaf.flavor

Leaf.size_in_memory

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

Leaf.size_on_disk

Leaf instance variables - aliases

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

Leaf.attrs

Leaf.name

Leaf.object_id

Leaf.title

Leaf methods

Leaf.close

Leaf.copy

Leaf.flush

Leaf.isvisible

Leaf.move

Leaf.rename

Leaf.remove

Leaf.get_attr

Leaf.set_attr

Leaf.del_attr

Leaf.truncate

Leaf.__len__

Leaf._f_close