1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
10
TITLE="PyTables User's Guide"
11
HREF="index.html"><LINK
13
TITLE="Library Reference"
14
HREF="c1381.html"><LINK
16
TITLE="Library Reference"
17
HREF="c1381.html"><LINK
19
TITLE="The Node class"
20
HREF="x2341.html"></HEAD
31
SUMMARY="Header navigation table"
43
> User's Guide: Hierarchical datasets in Python - Release 1.3.2</TH
59
>Chapter 4. Library Reference</TD
89
>An instance of this class is returned when a PyTables file
90
is opened with the <SAMP
91
CLASS="computeroutput"
94
It offers methods to manipulate (create, rename, delete...) nodes
95
and handle their attributes,
96
as well as methods to traverse the object tree.
103
> to the object tree attached to the HDF5 file
104
is represented in the <SAMP
105
CLASS="computeroutput"
108
Other attributes are available.
112
CLASS="computeroutput"
114
> objects support an <SPAN
118
>Undo/Redo mechanism</I
121
which can be enabled with the <SAMP
122
CLASS="computeroutput"
125
Once the Undo/Redo mechanism is enabled,
132
> (with an optional unique name) can be set
133
on the state of the database using the <SAMP
134
CLASS="computeroutput"
137
There are two implicit marks which are always available:
138
the initial mark (0) and the final mark (-1).
139
Both the identifier of a mark and its name can be used
155
>Hierarchy manipulation operations (node creation, movement
156
and removal) and attribute handling operations (setting and
157
deleting) made after a mark can be undone by using the
159
CLASS="computeroutput"
161
> method, which returns the database to
162
the state of a past mark. If <SAMP
163
CLASS="computeroutput"
166
followed by operations that modify the hierarchy or
167
attributes, the <SAMP
168
CLASS="computeroutput"
170
> method can be used to
171
return the database to the state of a future mark. Else,
172
future states of the database are forgotten.
175
>Note that data handling operations can not be undone nor
176
redone by now. Also, hierarchy manipulation operations on
177
nodes that do not support the Undo/Redo mechanism issue an
179
CLASS="computeroutput"
180
>UndoRedoWarning</SAMP
191
>The Undo/Redo mechanism is persistent between sessions and
192
can only be disabled by calling the
194
CLASS="computeroutput"
203
NAME="subsection4.2.1"
220
>The name of the opened file.</P
224
> format_version
229
>The PyTables version number of this file.</P
238
>True if the underlying file is open, false otherwise.</P
247
>The mode in which the file was opened.</P
256
>The title of the root group in the file.</P
265
>A dictionary that maps node names
266
between PyTables and HDF5 domain names.
267
Its initial values are set from the <SAMP
268
CLASS="computeroutput"
272
CLASS="computeroutput"
275
You can change its contents <SPAN
282
and the new map will take effect over any new object
293
>The UEP (user entry point) group in the file
295
HREF="c1381.html#openFileDescr"
307
>Default filter properties for the root group
309
HREF="x4983.html#FiltersClassDescr"
327
> of the object tree hierarchy
329
CLASS="computeroutput"
341
>A dictionary which maps path names to objects,
342
for every visible node in the tree (deprecated, see note
353
>A dictionary which maps path names to objects,
354
for every visible group in the tree (deprecated, see
365
>A dictionary which maps path names to objects,
366
for every visible leaf in the tree (deprecated, see note
379
> From PyTables 1.2 on,
380
the dictionaries <SAMP
381
CLASS="computeroutput"
384
CLASS="computeroutput"
388
CLASS="computeroutput"
390
> are just instances of objects
391
faking the old functionality. Actually, they internally
393
CLASS="computeroutput"
394
>File.getNode()</SAMP
397
HREF="x1533.html#File.getNode"
401
CLASS="computeroutput"
402
>File.walknodes()</SAMP
405
HREF="x1533.html#File.walkNodes"
408
which are recommended instead.
416
NAME="subsection4.2.2"
423
NAME="FileMethodsDescr"
430
NAME="subsubsection4.2.2.1"
431
>4.2.2.1. createGroup(where, name, title='', filters=None)</A
434
NAME="createGroupDescr"
437
>Create a new Group instance with name <SPAN
461
>The parent group where the new
462
group will hang from. <SPAN
469
a path string (for example
471
CLASS="computeroutput"
472
>"/level1/group5"</SAMP
482
>The name of the new group.</P
490
>A description for this
501
CLASS="computeroutput"
503
> class (see section<A
504
HREF="x4983.html#FiltersClassDescr"
507
information about the desired I/O filters applicable
508
to the leaves that hangs directly from this new group
509
(unless other filters properties are specified for
510
these leaves). Besides, if you do not specify filter
511
properties for its child groups, they will inherit
523
NAME="subsubsection4.2.2.2"
524
>4.2.2.2. createTable(where, name,
525
description, title='', filters=None,
526
expectedrows=10000)</A
529
NAME="createTableDescr"
533
CLASS="computeroutput"
548
> location. See the <A
549
HREF="x2981.html#TableClassDescr"
553
CLASS="computeroutput"
566
>The parent group where the new
567
table will hang from. <SPAN
574
a path string (for example
576
CLASS="computeroutput"
577
>"/level1/leaf5"</SAMP
578
>), or Group instance.
587
>The name of the new table.
599
>This is an object that describes the table, that
600
is, how many columns has it, and properties for each
601
column: the type, the shape, etc. as well as other
614
> can be any of the next several
625
>A user-defined class</B
630
inherit from the <SAMP
631
CLASS="computeroutput"
635
HREF="x4389.html#IsDescriptionClassDescr"
638
where table fields are specified.
648
you do not know beforehand which structure will
649
have your table). See <A
650
HREF="x1017.html#secondExample"
659
CLASS="computeroutput"
666
object from the <SAMP
667
CLASS="computeroutput"
670
also accepted, and all the information about
671
columns and other metadata is used as a basis to
673
CLASS="computeroutput"
675
> object. Moreover, if
677
CLASS="computeroutput"
679
> has actual data this is
680
also injected on the newly created
682
CLASS="computeroutput"
690
CLASS="computeroutput"
691
>NestedRecArray</SAMP
696
>Finally, if you want to have nested columns
697
in your table, you can use this object (see <A
698
HREF="a6736.html#NestedRecArrayClassDescr"
701
and all the information about columns and other
702
metadata is used as a basis to create the
704
CLASS="computeroutput"
706
> object. Moreover, if the
708
CLASS="computeroutput"
709
>NestedRecArray</SAMP
710
> has actual data this
711
is also injected on the newly created
713
CLASS="computeroutput"
730
>A description for this object.
741
CLASS="computeroutput"
744
HREF="x4983.html#FiltersClassDescr"
747
information about the desired I/O filters to be
748
applied during the life of this object.
757
>An user estimate of the
758
number of records that will be on table. If not
759
provided, the default value is appropriate for tables
760
until 10 MB in size (more or less). If you plan to
761
save bigger tables you should provide a guess; this
762
will optimize the HDF5 B-Tree creation and management
763
process time and memory used. See <A
764
HREF="c5270.html#expectedRowsOptim"
767
discussion on that issue.
778
NAME="subsubsection4.2.2.3"
779
>4.2.2.3. createArray(where, name,
783
NAME="createArrayDescr"
787
CLASS="computeroutput"
802
> location. See the <A
803
HREF="x3869.html#ArrayClassDescr"
806
description of the <SAMP
807
CLASS="computeroutput"
820
>The regular array to be
821
saved. Currently accepted values are:
823
CLASS="computeroutput"
826
CLASS="computeroutput"
830
CLASS="computeroutput"
834
CLASS="computeroutput"
836
> string numarrays) or other
837
native Python types, provided that they are regular
838
(i.e. they are not like <SAMP
839
CLASS="computeroutput"
842
homogeneous (i.e. all the elements are of the same
843
type). Also, objects that have some of their
844
dimensions equal to zero are not supported (use an
846
CLASS="computeroutput"
848
> object if you want to create an
849
array with one of its dimensions equal to 0).
856
HREF="x1533.html#createTableDescr"
858
CLASS="computeroutput"
862
> for more information on the
890
NAME="subsubsection4.2.2.4"
891
>4.2.2.4. createCArray(where, name, shape, atom,
892
title='', filters=None)</A
895
NAME="createCArrayDescr"
899
CLASS="computeroutput"
914
> location. See the <A
915
HREF="x4041.html#CArrayClassDescr"
918
description of the <SAMP
919
CLASS="computeroutput"
949
CLASS="computeroutput"
952
representing the <SPAN
971
> of the chunk of the objects to be saved.
978
HREF="x1533.html#createTableDescr"
980
CLASS="computeroutput"
984
> for more information on the
1012
NAME="subsubsection4.2.2.5"
1013
>4.2.2.5. createEArray(where, name,
1014
atom, title='', filters=None, expectedrows=1000)</A
1017
NAME="createEArrayDescr"
1021
CLASS="computeroutput"
1023
> instance with name
1036
> location. See the <A
1037
HREF="x4072.html#EArrayClassDescr"
1040
description of the <SAMP
1041
CLASS="computeroutput"
1055
CLASS="computeroutput"
1058
representing the <SPAN
1077
> of the atomic objects to be saved.
1078
One (and only one) of the shape dimensions <SPAN
1084
> be 0. The dimension being 0
1085
means that the resulting <SAMP
1086
CLASS="computeroutput"
1089
can be extended along it. Multiple enlargeable
1090
dimensions are not supported right now. See <A
1091
HREF="x4389.html#AtomClassDescr"
1095
CLASS="computeroutput"
1097
> class descendants.
1107
enlargeable arrays this represents an user estimate
1108
about the number of row elements that will be added to
1109
the growable dimension in the EArray object. If not
1110
provided, the default value is 1000 rows. If you plan
1111
to create both much smaller or much bigger EArrays try
1112
providing a guess; this will optimize the HDF5 B-Tree
1113
creation and management process time and the amount of
1121
HREF="x1533.html#createTableDescr"
1123
CLASS="computeroutput"
1126
description�4.2.2</A
1127
> for more information on the
1161
NAME="subsubsection4.2.2.6"
1162
>4.2.2.6. createVLArray(where,
1163
name, atom=None, title='', filters=None,
1164
expectedsizeinMB=1.0)</A
1167
NAME="createVLArrayDescr"
1171
CLASS="computeroutput"
1173
> instance with name
1186
> location. See the <A
1187
HREF="x4133.html#VLArrayClassDescr"
1190
description of the <SAMP
1191
CLASS="computeroutput"
1205
CLASS="computeroutput"
1208
representing the shape, type and flavor of the atomic
1209
object to be saved. See <A
1210
HREF="x4389.html#AtomClassDescr"
1212
> for the supported set
1214
CLASS="computeroutput"
1216
> class descendants.
1221
>expectedsizeinMB</B
1226
about the size (in MB) in the final
1228
CLASS="computeroutput"
1230
> object. If not provided, the
1231
default value is 1 MB. If you plan to create both
1232
much smaller or much bigger VLA's try providing a
1233
guess; this will optimize the HDF5 B-Tree creation and
1234
management process time and the amount of memory used.
1241
HREF="x1533.html#createTableDescr"
1243
CLASS="computeroutput"
1246
description�4.2.2</A
1247
> for more information on the
1281
NAME="subsubsection4.2.2.7"
1282
>4.2.2.7. getNode(where, name=None, classname=None)</A
1288
>Get the node under <SPAN
1294
> with the given <SPAN
1309
CLASS="computeroutput"
1312
or a path string leading to a node.
1319
> is specified, that node is returned.
1328
> is specified, this must be a string
1329
with the name of a node under <SPAN
1336
In this case the <SPAN
1342
> argument can only lead to
1344
CLASS="computeroutput"
1348
CLASS="computeroutput"
1351
The node called <SPAN
1357
> under the group <SPAN
1367
>In both cases, if the node to be returned does not exist, a
1369
CLASS="computeroutput"
1370
>NoSuchNodeError</SAMP
1372
Please, note that hidden nodes are also considered.
1381
> argument is specified,
1382
it must be the name of a class derived from <SAMP
1383
CLASS="computeroutput"
1386
If the node is found but it is not an instance of that class,
1388
CLASS="computeroutput"
1389
>NoSuchNodeError</SAMP
1398
NAME="subsubsection4.2.2.8"
1399
>4.2.2.8. isVisibleNode(path)</A
1402
NAME="File.isVisibleNode"
1405
>Is the node under <SAMP
1406
CLASS="computeroutput"
1410
>If the node does not exist,
1412
CLASS="computeroutput"
1413
>NoSuchNodeError</SAMP
1421
NAME="subsubsection4.2.2.9"
1422
>4.2.2.9. getNodeAttr(where, attrname, name=None)</A
1425
NAME="File.getNodeAttr"
1428
>Returns the attribute <SPAN
1452
>These arguments work as in <SAMP
1453
CLASS="computeroutput"
1457
HREF="x1533.html#File.getNode"
1460
referencing the node to be acted upon.
1469
>The name of the attribute to get.</P
1479
NAME="subsubsection4.2.2.10"
1480
>4.2.2.10. setNodeAttr(where, attrname, attrvalue, name=None)</A
1483
NAME="File.setNodeAttr"
1486
>Sets the attribute <SPAN
1506
If the node already has a large number of attributes,
1508
CLASS="computeroutput"
1509
>PerformanceWarning</SAMP
1521
>These arguments work as in <SAMP
1522
CLASS="computeroutput"
1526
HREF="x1533.html#File.getNode"
1529
referencing the node to be acted upon.
1538
>The name of the attribute to set on disk.</P
1546
>The value of the attribute
1547
to set. Any kind of python object (like string, ints,
1548
floats, lists, tuples, dicts, small
1549
Numeric/NumPy/numarray objects...) can be stored as an
1550
attribute. However, if necessary,
1552
CLASS="computeroutput"
1554
> is automatically used so as to
1555
serialize objects that you might want to save (see
1557
HREF="x4306.html#AttributeSetClassDescr"
1571
NAME="subsubsection4.2.2.11"
1572
>4.2.2.11. delNodeAttr(where, attrname, name=None)</A
1575
NAME="File.delNodeAttr"
1578
>Delete the attribute <SPAN
1602
>These arguments work as in <SAMP
1603
CLASS="computeroutput"
1607
HREF="x1533.html#File.getNode"
1610
referencing the node to be acted upon.
1619
>The name of the attribute to delete on disk.</P
1629
NAME="subsubsection4.2.2.12"
1630
>4.2.2.12. copyNodeAttrs(where, dstnode, name=None)</A
1633
NAME="File.copyNodeAttrs"
1636
>Copy the attributes from node <SPAN
1660
>These arguments work as in <SAMP
1661
CLASS="computeroutput"
1665
HREF="x1533.html#File.getNode"
1668
referencing the node to be acted upon.
1677
>This is the destination node
1678
where the attributes will be copied. It can be either
1679
a path string or a <SAMP
1680
CLASS="computeroutput"
1693
NAME="subsubsection4.2.2.13"
1694
>4.2.2.13. iterNodes(where, classname=None)</A
1697
NAME="File.iterNodes"
1706
> yielding children nodes
1714
alpha-numerically sorted by its node name.
1725
>This argument works as in <SAMP
1726
CLASS="computeroutput"
1730
HREF="x1533.html#File.getNode"
1733
referencing the node to be acted upon.
1742
>If the name of a class
1744
CLASS="computeroutput"
1746
> is supplied in the
1753
> parameter, only instances of that
1754
class (or subclasses of it) will be returned.
1765
NAME="subsubsection4.2.2.14"
1766
>4.2.2.14. listNodes(where, classname=None)</A
1769
NAME="File.listNodes"
1778
> with children nodes hanging
1785
>. The list is alpha-numerically
1786
sorted by node name.
1797
>This argument works as in <SAMP
1798
CLASS="computeroutput"
1802
HREF="x1533.html#File.getNode"
1805
referencing the node to be acted upon.
1814
>If the name of a class
1816
CLASS="computeroutput"
1818
> is supplied in the
1825
> parameter, only instances of that
1826
class (or subclasses of it) will be returned.
1837
NAME="subsubsection4.2.2.15"
1838
>4.2.2.15. removeNode(where, name=None, recursive=False)</A
1841
NAME="File.removeNode"
1844
>Removes the object node
1868
>These arguments work as in <SAMP
1869
CLASS="computeroutput"
1873
HREF="x1533.html#File.getNode"
1876
referencing the node to be acted upon.
1885
>If not supplied, the object will be removed
1886
only if it has no children;
1888
CLASS="computeroutput"
1891
If supplied with a true value,
1892
the object and all its descendants will be completely removed.
1903
NAME="subsubsection4.2.2.16"
1904
>4.2.2.16. copyNode(where, newparent=None, newname=None, name=None,
1905
overwrite=False, recursive=False, **kwargs)</A
1908
NAME="File.copyNode"
1911
>Copy the node specified by <SPAN
1928
>newparent/newname</I
1940
>These arguments work as in <SAMP
1941
CLASS="computeroutput"
1945
HREF="x1533.html#File.getNode"
1948
referencing the node to be acted upon.
1957
>The destination group that the node will be copied to
1958
(a path name or a <SAMP
1959
CLASS="computeroutput"
1969
CLASS="computeroutput"
1972
the parent of the source node is selected as the new parent.
1981
>The name to be assigned to
1982
the new copy in its destination (a string). If
1990
CLASS="computeroutput"
1993
the name of the source node is used.
2002
>Whether the possibly
2007
>newparent/newname</I
2010
overwritten or not. Note that trying to copy over an
2011
existing node without overwriting it will issue a
2013
CLASS="computeroutput"
2024
>Specifies whether the copy should recurse
2025
into children of the copied node.
2026
This argument is ignored for leaf nodes.
2027
The default is not recurse.
2036
> Additional keyword arguments may be passed to customize
2037
the copying process.
2038
The supported arguments depend on the kind of node being copied.
2039
The following are some of them:
2048
>The new title for the destination.
2050
CLASS="computeroutput"
2052
>, the original title is used.
2053
This only applies to the topmost node for recursive copies.
2062
>Specifying this parameter overrides the original
2063
filter properties in the source node.
2064
If specified, it must be an instance of the <SAMP
2065
CLASS="computeroutput"
2068
class (see section <A
2069
HREF="x4983.html#FiltersClassDescr"
2072
The default is to copy the filter attribute
2073
from the source node.
2082
>You can prevent the user attributes from being copied
2083
by setting this parameter to <SAMP
2084
CLASS="computeroutput"
2087
The default is to copy them.
2092
>start, stop, step</B
2096
>Specify the range of rows in child leaves to be copied;
2097
the default is to copy all the rows.
2106
>This argument may be used to collect statistics
2107
on the copy process. When used, it should be a dictionary
2109
CLASS="computeroutput"
2112
CLASS="computeroutput"
2116
CLASS="computeroutput"
2118
> having a numeric value.
2119
Their values will be incremented to reflect the number of
2120
groups, leaves and bytes, respectively,
2121
that have been copied in the operation.
2132
NAME="subsubsection4.2.2.17"
2133
>4.2.2.17. renameNode(where, newname, name=None)</A
2136
NAME="File.renameNode"
2139
>Change the name of the node specified by <SPAN
2168
>These arguments work as in <SAMP
2169
CLASS="computeroutput"
2173
HREF="x1533.html#File.getNode"
2176
referencing the node to be acted upon.
2185
>The new name to be assigned to the node (a string).
2196
NAME="subsubsection4.2.2.18"
2197
>4.2.2.18. moveNode(where, newparent=None, newname=None, name=None, overwrite=False)</A
2200
NAME="File.moveNode"
2203
>Move the node specified by <SPAN
2220
>newparent/newname</I
2232
>These arguments work as in <SAMP
2233
CLASS="computeroutput"
2237
HREF="x1533.html#File.getNode"
2240
referencing the node to be acted upon.
2249
>The destination group the node will be moved to
2250
(a path name or a <SAMP
2251
CLASS="computeroutput"
2261
CLASS="computeroutput"
2264
the original node parent is selected as the new parent.
2273
>The new name to be assigned to the node in its destination (a string).
2281
CLASS="computeroutput"
2284
the original node name is used.
2295
NAME="subsubsection4.2.2.19"
2296
>4.2.2.19. walkGroups(where='/')</A
2299
NAME="walkGroupsDescr"
2308
> that returns the list of Groups (not
2309
Leaves) hanging from (and including) <SPAN
2322
> Group is listed first (pre-order),
2323
then each of its child Groups (following an
2324
alpha-numerical order) is also traversed, following the
2325
same procedure. If <SPAN
2331
> is not supplied, the
2332
root object is used.
2343
>The origin group. Can be a
2344
path string or <SAMP
2345
CLASS="computeroutput"
2358
NAME="subsubsection4.2.2.20"
2359
>4.2.2.20. walkNodes(where="/", classname="")</A
2362
NAME="File.walkNodes"
2365
>Recursively iterate over the nodes in the
2367
CLASS="computeroutput"
2369
> instance. It takes two parameters:</P
2379
>If supplied, the iteration
2380
starts from (and includes) this group.</P
2395
supplied, only instances of this class are
2404
> # Recursively print all the nodes hanging from '/detector'
2405
print "Nodes hanging from group '/detector':"
2406
for node in h5file.walkNodes("/detector"):
2415
NAME="subsubsection4.2.2.21"
2416
>4.2.2.21. copyChildren(srcgroup, dstgroup,
2417
overwrite=False, recursive=False, **kwargs)</A
2420
NAME="File.copyChildren"
2423
>Copy the children of a group into another group.</P
2425
>This method copies the nodes hanging from the source group <SAMP
2426
CLASS="computeroutput"
2429
into the destination group <SAMP
2430
CLASS="computeroutput"
2433
Existing destination nodes can be replaced by asserting
2435
CLASS="computeroutput"
2439
CLASS="computeroutput"
2442
all descendant nodes of <SAMP
2443
CLASS="computeroutput"
2445
> are recursively copied.
2449
CLASS="computeroutput"
2451
> takes keyword arguments used to customize
2452
the copying process.
2453
See the documentation of <SAMP
2454
CLASS="computeroutput"
2455
>Group._f_copyChildren()</SAMP
2458
HREF="x2546.html#Group._f_copyChildren"
2461
for a description of those arguments.
2469
NAME="subsubsection4.2.2.22"
2470
>4.2.2.22. copyFile(dstfilename, overwrite=False, **kwargs)</A
2473
NAME="File.copyFile"
2476
>Copy the contents of this file to <SAMP
2477
CLASS="computeroutput"
2482
CLASS="computeroutput"
2484
> must be a path string
2485
indicating the name of the destination file. If it
2486
already exists, the copy will fail with an
2488
CLASS="computeroutput"
2491
CLASS="computeroutput"
2494
argument is true, in which case the destination file
2495
will be overwritten in place. In this last case, the
2496
destination file should be closed or ugly errors will
2500
>Additional keyword arguments may be passed to customize the copying process.
2501
For instance, title and filters may be changed,
2502
user attributes may be or may not be copied, data may be sub-sampled,
2503
stats may be collected, etc.
2504
Arguments unknown to nodes are simply ignored.
2505
Check the documentation for copying operations of nodes
2506
to see which options they support.
2509
>Copying a file usually has the beneficial side effect
2510
of creating a more compact and cleaner version of the original file.
2518
NAME="subsubsection4.2.2.23"
2519
>4.2.2.23. flush()</A
2522
>Flush all the leaves in the object tree.
2530
NAME="subsubsection4.2.2.24"
2531
>4.2.2.24. close()</A
2534
>Flush all the leaves in object tree and close the file.
2542
NAME="subsubsection4.2.2.25"
2543
>4.2.2.25. Undo/Redo support</A
2550
> isUndoEnabled()
2557
>Is the Undo/Redo mechanism enabled?</P
2563
CLASS="computeroutput"
2565
> if the Undo/Redo mechanism has been
2566
enabled for this file, <SAMP
2567
CLASS="computeroutput"
2570
Please, note that this mechanism is persistent, so a
2571
newly opened PyTables file may already have Undo/Redo
2579
> enableUndo(filters=Filters(complevel=1))
2586
>Enable the Undo/Redo mechanism.</P
2590
>This operation prepares the database for undoing and redoing
2591
modifications in the node hierarchy.
2593
CLASS="computeroutput"
2596
CLASS="computeroutput"
2600
CLASS="computeroutput"
2602
> and other methods to be called.
2608
CLASS="computeroutput"
2610
> argument, when specified,
2611
must be an instance of class <SAMP
2612
CLASS="computeroutput"
2616
HREF="x4983.html#FiltersClassDescr"
2619
and is meant for setting the compression values for
2620
the action log. The default is having compression
2621
enabled, as the gains in terms of space can be
2622
considerable. You may want to disable compression if
2623
you want maximum speed for Undo/Redo operations.
2629
CLASS="computeroutput"
2632
Undo/Redo mechanism is already enabled raises an
2634
CLASS="computeroutput"
2635
>UndoRedoError</SAMP
2642
> disableUndo()
2649
>Disable the Undo/Redo mechanism.</P
2654
>Disabling the Undo/Redo mechanism leaves the
2655
database in the current state and forgets past and
2656
future database states. This makes
2658
CLASS="computeroutput"
2661
CLASS="computeroutput"
2665
CLASS="computeroutput"
2667
> and other methods fail with an
2669
CLASS="computeroutput"
2670
>UndoRedoError</SAMP
2678
CLASS="computeroutput"
2679
>disableUndo()</SAMP
2681
Undo/Redo mechanism is already disabled raises an
2683
CLASS="computeroutput"
2684
>UndoRedoError</SAMP
2692
> mark(name=None)
2699
>Mark the state of the database.</P
2703
>Creates a mark for the current state of the database.
2704
A unique (and immutable) identifier for the mark is returned.
2706
CLASS="computeroutput"
2708
> (a string) can be assigned to the mark.
2709
Both the identifier of a mark and its name can be used
2711
CLASS="computeroutput"
2714
CLASS="computeroutput"
2718
CLASS="computeroutput"
2720
> has already been used for another mark,
2722
CLASS="computeroutput"
2723
>UndoRedoError</SAMP
2729
>This method can only be called when the Undo/Redo mechanism
2732
CLASS="computeroutput"
2733
>UndoRedoError</SAMP
2741
> getCurrentMark()
2748
>Get the identifier of the current mark.</P
2752
>Returns the identifier of the current mark.
2753
This can be used to know the state of a database
2754
after an application crash,
2755
or to get the identifier of the initial implicit mark
2756
after a call to <SAMP
2757
CLASS="computeroutput"
2764
>This method can only be called when the Undo/Redo mechanism
2767
CLASS="computeroutput"
2768
>UndoRedoError</SAMP
2776
> undo(mark=None)
2783
>Go to a past state of the database.</P
2787
>Returns the database to the state associated with
2789
CLASS="computeroutput"
2792
Both the identifier of a mark and its name can be used.
2794
CLASS="computeroutput"
2796
> is omitted, the last created mark is used.
2797
If there are no past marks, or the specified <SAMP
2798
CLASS="computeroutput"
2801
is not older than the current one,
2803
CLASS="computeroutput"
2804
>UndoRedoError</SAMP
2810
>This method can only be called when the Undo/Redo mechanism
2813
CLASS="computeroutput"
2814
>UndoRedoError</SAMP
2822
> redo(mark=None)
2829
>Go to a future state of the database.</P
2833
>Returns the database to the state associated with
2835
CLASS="computeroutput"
2838
Both the identifier of a mark and its name can be used.
2840
CLASS="computeroutput"
2842
> is omitted, the next created mark is used.
2843
If there are no future marks, or the specified <SAMP
2844
CLASS="computeroutput"
2847
is not newer than the current one,
2849
CLASS="computeroutput"
2850
>UndoRedoError</SAMP
2856
>This method can only be called when the Undo/Redo mechanism
2859
CLASS="computeroutput"
2860
>UndoRedoError</SAMP
2875
>Go to a specific mark of the database.</P
2879
>Returns the database to the state associated with
2881
CLASS="computeroutput"
2884
Both the identifier of a mark and its name can be used.
2889
>This method can only be called when the Undo/Redo mechanism
2892
CLASS="computeroutput"
2893
>UndoRedoError</SAMP
2908
NAME="subsection4.2.3"
2916
>Following are described the methods that automatically
2917
trigger actions when a <SAMP
2918
CLASS="computeroutput"
2921
accessed in a special way.
2928
NAME="subsubsection4.2.3.1"
2929
>4.2.3.1. __contains__(path)</A
2932
NAME="File.__contains__"
2935
>Is there a node with that <SPAN
2944
CLASS="computeroutput"
2946
> if the file has a node
2947
with the given <SPAN
2955
CLASS="computeroutput"
2965
NAME="subsubsection4.2.3.2"
2966
>4.2.3.2. __iter__()</A
2969
NAME="File.__iter__"
2972
>Iterate over the children on the <SAMP
2973
CLASS="computeroutput"
2976
instance. However, this does not accept parameters. This
2988
> # Recursively list all the nodes in the object tree
2989
h5file = tables.openFile("vlarray1.h5")
2990
print "All nodes in the object tree:"
3000
NAME="subsubsection4.2.3.3"
3001
>4.2.3.3. __str__()</A
3007
>Prints a short description of the <SAMP
3008
CLASS="computeroutput"
3016
> >>> f=tables.openFile("data/test.h5")
3017
>>> print f
3018
data/test.h5 (File) 'Table Benchmark'
3019
Last modif.: 'Mon Sep 20 12:40:47 2004'
3021
/ (Group) 'Table Benchmark'
3022
/tuple0 (Table(100L,)) 'This is the table title'
3024
/group0/tuple1 (Table(100L,)) 'This is the table title'
3025
/group0/group1 (Group) ''
3026
/group0/group1/tuple2 (Table(100L,)) 'This is the table title'
3027
/group0/group1/group2 (Group) ''
3035
NAME="subsubsection4.2.3.4"
3036
>4.2.3.4. __repr__()</A
3039
NAME="File.__repr__"
3042
>Prints a detailed description of the <SAMP
3043
CLASS="computeroutput"
3055
SUMMARY="Footer navigation table"
3094
>Library Reference</TD
b'\\ No newline at end of file'